Skip to content

Commit 3cb95fb

Browse files
committed
Update with more accurate language
1 parent 8388cc4 commit 3cb95fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bip-0360.mediawiki

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ We designed P2TSH with an eye towards integrating post-quantum signatures in the
174174

175175
While P2TR outputs (and the use of key path spend) will remain an option for folks wishing to use them, we aim to be clear about the tradeoffs of using P2TSH outputs, which disable the key path spend for the benefit of quantum resistance.
176176

177-
First off, P2TSH script path spends are larger than P2TR key path spends, because you have to include the control byte, merkle path (if depth > 0), and script in the transaction. That said, P2TSH script path spends will be smaller than P2TR script path spends because there is no longer an internal key that must also be revealed. For a more complete comparison of output type transaction sizes, the "Transaction Size and Fees" section may be reviewed later in this proposal.
177+
The witness to a P2TSH spend is always larger than the witness to a P2TR key path spend. This is because a P2TR key path spend requires only a Schnorr signature in the witness. For P2TSH, the witness must include your chosen leaf script, its inputs, and a control block consisting of the control byte and Merkle path (if any).
178+
179+
That said, the witness to a P2TSH spend will always be smaller than the witness to an equivalent P2TR script path spend, because there is no longer any internal key in P2TSH that must be revealed in the control block. For a more complete comparison of output type transaction sizes, the "Transaction Size and Fees" section may be reviewed later in this proposal.
178180

179181
Additionally, there is a privacy tradeoff when comparing P2TSH and P2TR, which is that users reveal they are spending to a script tree whenever they are using P2TSH outputs, since P2TSH outputs can only be spent via script path spend. In P2TR when you spend an output as a key path spend, you don't reveal if you have any script path spends. This trade-off only exists when comparing P2TR key path spends to P2TSH script path spends; P2TR and P2TSH provide the same level of privacy when both are script path spends.
180182

@@ -251,7 +253,7 @@ Equivalent P2TSH and P2TR outputs are always the same size. P2TSH inputs can be
251253

252254
====Comparison with P2TR key path spend====
253255

254-
A P2TSH witness will be larger than a P2TR witness when the P2TR output is spent via the key path spend. A witness to a P2TR key path spend is simply a signature. P2TSH quantum resistance comes from removing the P2TR key path spend. Every P2TSH spend is a P2TR script path spend and so requires a script, its inputs and a control block. Consequently, P2TSH loses this size advantage of P2TR key path spends in order to gain quantum resistance. If the taptree only has a single leaf script, no Merkle path is needed in the control block, giving us a minimal size control block of 1 byte.
256+
A P2TSH witness will be larger than a P2TR witness when the P2TR output is spent via the key path spend. A witness to a P2TR key path spend is simply a signature. P2TSH quantum resistance comes from removing the P2TR key path spend. Every P2TSH spend is a P2TR script path spend and so requires a script, its input stack and a control block. Consequently, P2TSH loses this size advantage of P2TR key path spends in order to gain quantum resistance. If the taptree only has a single leaf script, no Merkle path is needed in the control block, giving us a minimal size control block of 1 byte.
255257

256258
P2TSH witness for depth-0 tree (103 bytes):
257259

@@ -269,9 +271,9 @@ P2TR key path spend witness (66 bytes):
269271
[size] signature (1 + 64 bytes = 65 bytes)
270272
</source>
271273

272-
Thus, the P2TSH input would be 103 - 66 = 37 bytes larger than a P2TR key path spend input.
274+
Thus, the P2TSH witness would be 103 - 66 = 37 bytes larger than a P2TR key path spend witness.
273275

274-
If the Merkle tree has more than a single leaf, then the Merkle path must be included in the control block, increasing the size by ''32 * m'' bytes, where m is the depth of the Merkle tree. This would make such input 37 + 32 * m bytes larger than a P2TR key path spend input.<ref>If ''m >= 8'', then the compact size will use 3 bytes rather than 1 byte</ref>
276+
If the Merkle tree has more than a single leaf, then the Merkle path must be included in the control block, increasing the size by ''32 * m'' bytes, where m is the depth of the Merkle tree. This would make such witness 37 + 32 * m bytes larger than a P2TR key path spend witness.<ref>If ''m >= 8'', then the compact size will use 3 bytes rather than 1 byte</ref>
275277

276278
P2TSH witness ''(103 + 32*m bytes)'':
277279

0 commit comments

Comments
 (0)