Hi all,
Pursuant to the discussions about standardizing an unspendable NUMS key for an script path only taproot policy Unspendable keys in descriptors and BIP Draft: unspendable() Descriptor Key Expression by andrewtoth · Pull Request #1746 · bitcoin/bips · GitHub ; we undertook the issue with these guiding principles:
- We don’t police adherence to other bips except when they directly affect the issue at hand.
- We use the already in place mechanisms in other bips.
- We don’t claim semantic canonicalization of the script and only normalize the policy to some opinionated extent.
The gist is, we define _ as a placeholder for the unspendable NUMS key. We sort keys inside musig(…) and sortedmulti_a. We sort sibling pairs of the tree. If there is multipath extension, we add the same length tuple to the _ so that we don’t fall to reuse. Then we pull the keys out and us @i placeholders and hash the whole thing consisting of the normalized descriptor and the keys. That would be the chain code for the H defined in BIP 341.
The details can be found here:
Best,