{
 "number": 35377,
 "input_hash": "bbe5dc58d3337a71",
 "model": "openrouter/google/gemini-3.8-flash",
 "batch": false,
 "created": "2026-09-17T16:18:59+00:00",
 "provider": "Google",
 "stop_reason": "end_turn",
 "usage": {
  "input_tokens": 19795,
  "cache_creation_input_tokens": 0,
  "cache_read_input_tokens": 0,
  "output_tokens": 3996
 },
 "cost_usd": 0.02983125,
 "error": null,
 "result": {
  "display": {
   "goal": [
    "Allow importing public descriptors into wallets with private keys when the wallet already holds those keys",
    "Avoid forcing users to handle or export plaintext private keys during descriptor imports"
   ],
   "reviewability": [
    "Ready to review",
    "Base PR #34861 recently merged so branch may be rebased to drop merged commits"
   ],
   "agreement": [
    "Strong concept support with multiple reviewers wanting the workflow improvement (rkrux, polespinasa, Sjors)",
    "Sjors suggested an alternative design integrating keys during parsing instead of post-parse substitution"
   ],
   "categories": [
    {
     "name": "wallet",
     "why": [
      "P2 because it fixes a significant gap in descriptor wallet workflows that forced users to export plaintext private keys",
      "Resolves long-standing issue #27336 and simplifies external coordinator and multisig integrations"
     ]
    }
   ]
  },
  "summary": "This PR enables importing public descriptors (including xpubs and individual pubkeys) into wallets that have private keys enabled, provided the wallet already holds the corresponding private keys. During import, the wallet inspects the descriptor for known keys and substitutes master xprvs and individual private keys in place of the public keys before loading.",
  "problem": "Descriptor wallets with private keys currently reject public descriptors unless the private keys are explicitly supplied in the descriptor string. This creates friction and safety hazards for users and external coordinator software, requiring manual private key extraction and plaintext exposure to import derived or multisig descriptors.",
  "discussion": {
   "open_concerns": [
    "Sjors suggested an alternative approach exploring whether descriptor parsing could be given direct access to known keys rather than performing substitution after parsing"
   ],
   "resolved_concerns": [],
   "author_status": "Active, recently force-pushed updates"
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "The code is clean, CI passes, and the core changes are isolated to descriptor substitution and wallet import logic."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong concept ACKs from multiple reviewers, with design feedback from Sjors",
   "reason": "Reviewers strongly agree with the goal of avoiding manual private key handling during descriptor imports, and multiple contributors expressed intent to use this functionality.",
   "evidence": [
    "rkrux gave a Concept ACK noting it 'allows the users to not deal with private keys manually'",
    "polespinasa gave a Concept ACK pending review after base PR #34861",
    "Sjors gave a Concept ACK and shared an experimental branch testing an alternative key resolution approach"
   ]
  },
  "dependencies": {
   "depends_on": [
    34861
   ],
   "enables": [
    "#36133"
   ]
  },
  "categories": [
   {
    "name": "wallet",
    "member": true,
    "evidence": "Modifies wallet import logic in src/wallet/imports.cpp and src/wallet/wallet.cpp, as well as Descriptor key substitution in src/script/descriptor.cpp",
    "band": "P2",
    "reason_tag": "fund safety",
    "score": 0.65,
    "factors": {
     "security_stability": 2,
     "bug_severity": 0,
     "performance": 0,
     "user_value": 2,
     "leverage": 1
    },
    "rationale": "P2 because it addresses a long-standing key-safety and usability deficiency where users must expose private key material in plaintext to import descriptors into privkey-enabled wallets. Resolves issue #27336 ('Should be able to import an xpub descriptor to a privkey-enabled wallet if the wallet has the privkeys') which has been a recurring pain point for multisig and coordinator workflows."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": [],
  "card": "This PR allows descriptor wallets with private keys enabled to import public descriptors when the wallet already holds the matching private keys or master xprvs. Currently, importing such descriptors fails unless private keys are provided in the descriptor, forcing users and coordinator tools to handle and expose raw private key material. The PR implements key substitution during import and closes issue #27336. Concept support is strong across multiple reviewers, with minor discussion regarding whether key resolution should happen inside descriptor parsing or via post-parse substitution."
 },
 "raw_text": null
}