Expand description
Canonical-origin map per spec §4 (v0.13 wallet-policy layer).
Given the top-level wrapper of a descriptor template, return the canonical
path-from-master for elided origin paths — or None if the wrapper shape
is not in the canonical table (in which case the encoder must emit
explicit OriginPathOverrides entries for all @N placeholders).
Wrapper shape → canonical:
| Shape | Canonical |
|---|---|
pkh(@N) single-key | m/44'/0'/0' |
wpkh(@N) single-key | m/84'/0'/0' |
tr(@N) key-path only (no TapTree) | m/86'/0'/0' |
wsh(multi/sortedmulti) | m/48'/0'/0'/2' |
sh(wsh(multi/sortedmulti)) | m/48'/0'/0'/1' |
sh(sortedmulti) legacy P2SH multi | None (forced explicit) |
tr(@N, TapTree) | None (forced explicit) |
| anything else | None (forced explicit) |
Functions§
- canonical_
origin - Compute the canonical origin path for the top-level wrapper
tree, per spec §4. ReturnsNonefor shapes that require explicitOriginPathOverrideson the wire.