1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-08-03 18:21:54 +00:00

bip360: correct the claimed P2MR witness size saving

The Transaction Size and Fees section says a P2MR witness is always 32
bytes smaller than an equivalent P2TR script path spend witness. The
control blocks are 1 + 32*m and 33 + 32*m bytes, each serialised with
a compact size prefix, so at m = 7 the P2TR control block is 257 bytes
and takes a 3-byte prefix while the P2MR one is 225 bytes and takes 1.
The saving there is 34 bytes, not 32. Every other depth up to 128
gives 32.

The section already footnotes this boundary for the P2MR side a few
paragraphs earlier.
This commit is contained in:
JP
2026-07-28 15:22:24 +01:00
parent 9783d61f1b
commit 33202403b3

View File

@@ -307,7 +307,7 @@ control block = [size] [control byte] [Merkle path] (1 + 1 + 32*m = 2 + 32*m byt
====Comparison with P2TR script path spend====
A P2MR witness will be smaller than the witness to an equivalent P2TR script path spend. This is because P2MR does not require inclusion of an internal public key in the control block to unlock and spend an output. For this reason, a P2MR witness will always be 32 bytes smaller than an equivalent P2TR script path spend witness.
A P2MR witness will be smaller than the witness to an equivalent P2TR script path spend. This is because P2MR does not require inclusion of an internal public key in the control block to unlock and spend an output. For this reason, a P2MR witness will be 32 bytes smaller than an equivalent P2TR script path spend witness, except at ''m = 7'', where the two control blocks fall on opposite sides of the compact size boundary and the saving is 34 bytes.
==Performance Impact==