delvingbitcoin
Unspendable keys in descriptors
Posted on: December 4, 2024 12:17 UTC
To enhance the standardization between descriptors and wallet policies regarding unspendable internal extended public keys (xpubs), a proposal suggests sorting and removing duplicates from all xpubs.
This process involves concatenating the compressed public keys after sorting and dropping key origins, followed by a SHA256 hash. This method aims to simplify implementation across different platforms.
In dealing with descriptors, the approach requires careful consideration on how to handle key expressions that do not involve xpubs, including the treatment of unsupported characters such as _
. Furthermore, it introduces a restriction that limits all xpubs to the format xpub/<0;1>/*
, eliminating the allowance for optional derivation paths as outlined in the Bitcoin Improvement Proposals. This constraint is deemed acceptable since its primary impact would be on legacy wallets which lack support for taproot, a recent enhancement in Bitcoin's protocol.
However, this restriction poses challenges within the context of wallet policies, where it is common practice to utilize the same xpub with varying 'endings' to denote different spending paths. This flexibility is crucial for enabling diverse transaction types through a single wallet policy. The proposed method acknowledges this necessity by retaining the //*
in the descriptor template rather than in the individual key information, allowing for the differentiation of spending paths under a unified xpub framework.
Wallet vendors and developers have the liberty to support a specific subset of valid descriptors or policies to achieve additional properties or functionalities not covered by the general class of descriptors. This flexibility ensures that despite the overarching guidelines, there remains room for customization and optimization according to specific needs and preferences.