delvingbitcoin

Unspendable keys in descriptors

Unspendable keys in descriptors

Original Postby salvatoshi

Posted on: January 16, 2024 14:20 UTC

The correspondence identifies a specific technical issue concerning the order of keys in wallet policies and their representation in descriptor templates.

The crux of the problem lies in the mismatch between the natural order of extended public keys (xpubs) listed within wallet policies and the left-to-right sequence found in descriptor templates. A provided example illustrates this discordance, where a descriptor template is defined as "tr(_,{pk(@1/**),pk(@0/**)})", yet the associated keys are arranged as ["xpubA", "xpubB"]. In this scenario, the expected left-to-right ordering does not align with the actual order, which should be pubkeyA||pubkeyB.

The discussion suggests that if the placeholder _ used to denote a deterministic NUMS key is exclusively determined by wallet policies, then adopting an approach native to wallet_policy would be more favorable. This recommendation hints at a resolution where the inherent structure of wallet policies would guide the organization and referencing of keys, potentially alleviating inconsistencies brought about by the current system's design.