public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoindev] [BIP Proposal] mr() Output Script Descriptors
@ 2026-12-04 16:39 Jean Pablo
  0 siblings, 0 replies; only message in thread
From: Jean Pablo @ 2026-12-04 16:39 UTC (permalink / raw)
  To: bitcoindev

BIP 360 defines P2MR, but there's no descriptor for it, so I wrote a draft for mr(), which takes a BIP 386 tree and no internal key:

https://github.com/jeanpablojp/bips/blob/mr-descriptors/bip-mr.mediawiki

It follows the shape of BIP 394, the rawtr() one I wrote, and the vectors reuse keys from BIPs 386, 390 and 394.

The one rule that isn't copied from tr() is that the tree needs at least two leaves, since BIP 360 makes a depth-zero tree anyone-can-spend. One of the spend vectors I added to BIP 360 in bips#2232 spends such a tree with no signature.

The reference implementation is on top of my regtest P2MR branch of Core [0], with the vector generator and a separate Python check that recomputes all 16 scripts without Core. Three of the seven positive construction vectors in BIP 360 can be written as mr(), and they reproduce their scriptPubKeys. The rest are the single-leaf case or need raw leaves.

I left three things out and would like opinions on them. Leaf versions other than 0xc0 have no syntax in BIP 386, and the rawleaf() idea [1], which fametrano already has in btclib, would cover tr() and mr() alike. Hashed EC keys, as in ajtowns's hpkh([origin]HASH) sketch [2], matter most for P2MR but apply to tr() too, so I didn't define them for mr() alone. And musig() under mr() would need a change to BIP 390, like the one bips#2050 made for rawtr().

Feedback welcome.

[0] https://github.com/jeanpablojp/bitcoin/tree/p2mr-descriptors
[1] https://delvingbitcoin.org/t/tr-rawnode-and-rawleaf-support/901
[2] https://delvingbitcoin.org/t/public-key-recovery-for-ec-leaves-in-p2mr-bip-360/2603/14

-- 
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/3E4E6F84-74C2-49EF-9191-37E10E8B120D%40jeanpablo.jp.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-04 16:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 16:39 [bitcoindev] [BIP Proposal] mr() Output Script Descriptors Jean Pablo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox