# Unspendable keys in descriptors

**URL:** <https://delvingbitcoin.org/t/unspendable-keys-in-descriptors/304>\
**Category:** Implementation\
**Tags:** miniscript, taproot\
**Created:** [December 19, 2023, 12:46pm UTC](https://delvingbitcoin.org/t/unspendable-keys-in-descriptors/304 "2023-12-19T12:46:39Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![AntoineP](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/antoinep/32/483_2.png) [@AntoineP](https://delvingbitcoin.org/u/AntoineP)\
**Post date:** [January 16, 2024, 11:03am UTC](https://delvingbitcoin.org/t/unspendable-keys-in-descriptors/304/21 "2024-01-16T11:03:51Z")

</div>

I’m now implementing [Taproot support in Liana](https://github.com/wizardsardine/liana/issues/55). Ideally i’d like to derive unspendable internal keys in a way which would be forward compatible with an eventual standard used in wallet policies. This way, once support is implemented in signing devices, our users won’t have to “verify” a meaningless internal key on their device’s screen. A friendlier “no keypath spend” UX could be presented.

It seems the less ugly way of getting all 4 properties is what Salvatore [suggests in s4](https://delvingbitcoin.org/t/unspendable-keys-in-descriptors/304#s4-recycle-the-entropy-of-the-descriptor-6) (in the simpler version). From a wallet policy, the unspendable internal key is an `xpub/<0;1>/*` such as:

- The `xpub`’s key is the NUMS suggested in BIP341: `H = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)`.
- The `xpub`’s chaincode is the `sha256` of the concatenation of the key part (as a compressed pubkey) of all the xpubs in the wallet policy. (In the wallet policy standard all key expressions must be xpubs with derivation path of the form `/<m;n>/*`.) “Left to right” order as they appear in the string representation, which is just a depth-first search.

Of course, this can also be expressed in descriptors using `unspend(computed chaincode)/<0;1>/*` as the internal key.

---

_[View the full topic](https://delvingbitcoin.org/t/unspendable-keys-in-descriptors/304)._
