Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive 2026

P2MR ML-DSA-65 Transaction Authorization

1 message, Dec 3, 2026. Started by Song Zihui.

Song Zihui

Permalink Original thread on gnusha.org

Song Zihui permalink original

Hi all, I would like feedback on a proposed P2MR spending leaf for post-quantum BTC transaction authorization using FIPS 204 ML-DSA-65. Specification: https://github.com/zhiran233/bitcoin-quantum-resilience/blob/main/bip-p2mr-mldsa65.md Code and reproducible experiments: https://github.com/zhiran233/bitcoin-quantum-resilience The proposal extends BIP 360 with a fixed-format authorization leaf. It uses leaf version 0xc4 as a proposed value, subject to coordination. Its witness is [signature, public_key, leaf_script, control_block], where the 32-byte leaf script commits to SHA256(public_key). It verifies a 3,309-byte ML-DSA-65 signature and a 1,952-byte public key. Distinct primary and recovery keys can occupy separate leaves. The signature uses pure ML-DSA with context Bitcoin-P2MR-MLDSA65 over a canonical transaction transcript. It binds all input outpoints, spent amounts and scripts, sequences, all outputs, the input index, and the leaf hash. The initial rule has ALL-only semantics and no annex. One motivation for the transcript is FIPS 204 section 5.4: signing an application-level 256-bit digest does not preserve ML-DSA-65's full classical collision-strength target. The specification also distinguishes collision attacks from target second-preimage attacks against a funded P2MR output. I would welcome review of that argument and the end-to-end security target. The current BIP 360 depth-zero success rule is another integration point: the proposal dispatches this leaf before that success case and rejects depth zero for it. The proposal also caps aggregate signed-message bytes per block at 16,777,216 to bound repeated transcript hashing. Both choices need consensus review. The Python implementation includes two loopback validators and signature cross-verification with dilithium-py and pqcrypto. Its 356 recorded authorization checks match the expected outcomes. The bounded candidate-search simulations are implementation experiments, not a cryptographic security proof or hardware attack benchmark. Bitcoin Core integration is further work. I am particularly interested in feedback on:

  1.
A native P2MR leaf versus a separate witness-version output for this authorization rule.
  2.
The message serialization, context, and ALL-only semantics.
  3.
Depth-zero handling and compatibility with BIP 360.
  4.
Verification-cost accounting and the signed-message byte cap.
  5.
The commitment security argument and recovery-path requirements.

Best, Zhi ran imbue2025@outlook•com