spec-bip-0360-mediawiki
Draft BIP 360 proposes P2MR, a SegWit v2 script-tree output with the quantum-vulnerable key path spend removed, to resist long exposure quantum key recovery while keeping tapscript.
Schemes: P2MR, P2TR, BIP 341, BIP 342, tapscript, P2WSH, ML-DSA, SLH-DSA, CRYSTALS-Dilithium, XMSS, Lamport, WOTS, OP_CAT
Findings (quotes checked against the source text)
-
P2MR protects against long exposure quantum key recovery by omitting the internal key and key path spend, but does not protect against short exposure attacks.
P2MR does not, by itself, protect against short exposure quantum attacks, but these attacks can be mitigated by future activation of post-quantum signatures.
-
P2MR commits only to the script tree Merkle root as a 32-byte witness program in a SegWit version 2 output.
A P2MR output is then a SegWit version 2 byte followed by the Merkle root of the script tree as the witness program.
-
P2MR is chosen over P2WSH because it supports tapscript and the OP_SUCCESSx upgrade path needed for future post-quantum OP_CHECKSIG opcodes.
P2WSH, for instance, does not support tapscript and as such does not support the OP_SUCCESSx opcode update path that will be critical for the integration of post-quantum OP_CHECKSIG opcodes into Bitcoin.
-
P2MR witnesses are larger than P2TR key path spends, because every P2MR spend is a script path spend requiring a leaf script and control block.
The witness to a P2MR spend is always larger than the witness to a P2TR key path spend.
-
Lamport and WOTS signatures built with OP_CAT are one-time signatures, so reuse risks leaking the private key, a significant security downgrade for everyday users.
Lamport and WOTS (Winternitz One-Time Signatures) built from CAT are quantum resistant, but are one-time signatures — meaning, if you sign twice for the same public key, you risk leaking your private key, which is a significant security concern for everyday users.
-
Depth-zero script trees are anyone-can-spend in P2MR, which discourages their use while leaving them repurposable by a future soft fork.
Unlike P2TR, script trees of depth 0 - those with a single leaf script - are considered anyone-can-spend in P2MR, which discourages the use of depth-zero script trees today while still allowing them to be repurposed in a future soft-fork.
Numbers (as extracted, not quote-checked)
- P2MR witness for depth-1 tree with a single-key OP_CHECKSIG leaf: 135 bytes
- P2TR key path spend witness: 66 bytes
- P2MR witness general size: 103 + 32*m bytes
- P2MR control block length: 1 + 32*m bytes
- P2MR hash security: 128 bits collision resistance, 256 bits preimage resistance
- Shor's algorithm operations to break 256-bit EC key (as stated): 10^8 operations
For builders
Use P2MR-style script-tree outputs with an OP_CHECKSIG leaf now to get long-exposure protection, and reserve a leaf-version/OP_SUCCESS path for future post-quantum signature opcodes.
Limits
Draft spec only, not activated; protects only long exposure attacks; key reuse or exposed public keys still leak; post-quantum signatures are deferred to a separate proposal.
Topics: bitcoin-migration chain-design threat-model quantum-resource-estimates hybrid-schemes sig-lattice sig-hash-based standards-policy