Quantum-Resistant Addresses and Signatures (QRAS) #31459

issue tgaeta openend this issue on December 10, 2024
  1. tgaeta commented at 2:37 pm on December 10, 2024: none

    Status: Draft
    Created: 20241210

    Motivation

    As quantum computing advances, the security of classical cryptographic primitives—especially those relying on discrete logarithms and factoring—may diminish over time. Bitcoin’s current reliance on ECDSA for signatures is expected to remain secure against foreseeable quantum computers, but preparing preemptively for a smooth transition to post-quantum (PQ) algorithms avoids rushed changes later. Introducing quantum-resistant signatures now provides long-term resilience.

    Abstract

    This BIP proposes a new witness version and script rules enabling quantum-resistant signature schemes, starting with a well-studied, standardized scheme like SPHINCS+. It maintains backward compatibility, allowing legacy addresses and signatures to coexist. Over time, users may voluntarily migrate funds to PQ addresses as quantum threats materialize. The design supports multiple PQ schemes and can adapt if a particular PQ algorithm is compromised, ensuring Bitcoin’s long-term security.

    Specification

    New Witness Version and Script Structure

    • Introduce a new witness version to signal that the output requires a PQ signature.
    • For example, use OP_1Q in ScriptPubKey to indicate a PQ public key and the associated verification operation:
    0\text{ScriptPubKey} = OP_1Q \; <PK> \; OP_CHECKPQSIGN
    

    Here, <PK> is a public key compatible with the chosen PQ scheme. OP_CHECKPQSIGN is a new opcode that verifies a provided PQ signature against <PK> and the transaction message.

    Supported PQ Schemes

    • Start with SPHINCS+, a hash-based signature scheme standardized by NIST and backed by well-understood security properties (collision-resistant hash functions).
    • The framework allows for future extension:
      • Define a <SchemeID> field to support multiple PQ schemes, e.g.:
    0\text{ScriptPubKey} = OP_1Q \; <SchemeID> <PK> \; OP_CHECKPQSIGN
    
    • Additional schemes (e.g., CRYSTALS-Dilithium) can be introduced via new <SchemeID> values.

    PQ Signature Verification

    The transaction message $M$ (a hash of the input and output data) is verified against a PQ signature $\sigma$ and public key $PK$.

    0\text{Verify}_{PQ}(PK, \sigma, M) = 
    1\begin{cases}
    2\text{True}, & \text{if $\sigma$ is a valid PQ signature on $M$ w.r.t. $PK$}\\
    3\text{False}, & \text{otherwise}
    4\end{cases}
    

    For SPHINCS+, this involves hashing-based verification. If $\text{Verify}_{PQ}(PK, \sigma, M)$ returns True, the input is valid.

    Parameter and Size Considerations

    • Let the underlying hash function be:
    0H: \{0,1\}^* \to \{0,1\}^{256}
    
    • SPHINCS+ typically uses parameters ensuring classical and quantum security at standardized levels.
    • Signatures are larger than ECDSA, often tens of kilobytes, which impacts bandwidth and block space. Future PQ schemes may reduce size and improve performance.

    Attack Vectors and Mitigations

    • Quantum Attacks:
      SPHINCS+ resists known quantum attacks by relying on hard-to-find hash collisions, which remain infeasible even for powerful quantum adversaries.

    • Side-Channel Attacks:
      Wallets should implement PQ operations using constant-time methods to prevent key leaks.

    • Parameter Backdoors and Broken Schemes:
      Only deploy schemes vetted by the cryptographic community and standardized by reputable bodies. If a scheme weakens, introduce a new <SchemeID> and encourage migration.

    • Multiple PQ Schemes (Chess Moves Against the Future):
      By supporting multiple schemes, Bitcoin can pivot quickly if one scheme is compromised. This future-proofing ensures no single point of cryptographic failure.

    Backward Compatibility and Deployment

    • Legacy addresses and transaction types remain valid. Non-upgraded nodes treat PQ outputs as anyone-can-spend, incentivizing them to upgrade to retain full validation security.
    • Introduce the feature as a soft fork (e.g., using methods like BIP9 or BIP8). Miners signal support, and after activation, upgraded nodes begin enforcing PQ signatures on PQ-designated outputs.
    • Users can initially create hybrid outputs that accept ECDSA or PQ signatures, allowing a gradual transition.

    Testing and Rollout

    • Test the PQ changes on Signet/Testnet to gather performance data and confirm compatibility.
    • Benchmark verification speeds, block size impacts, and confirm no consensus splits occur among upgraded nodes.
    • Provide reference implementations, test vectors, and developer tools.

    Example PQ Transaction

    1. Alice generates a PQ key pair using SPHINCS+ and produces an address bc1q_pq... referencing OP_1Q <PK> OP_CHECKPQSIGN.
    2. Bob sends BTC to Alice’s PQ address.
    3. When spending, Alice includes a PQ signature $\sigma$ in the witness:
    0\text{Verify}_{PQ}(PK, \sigma, M) = \text{True} \implies \text{Spend allowed.}
    

    Conclusion

    This BIP ensures Bitcoin can smoothly adapt to a post-quantum world. By introducing PQ signatures preemptively, the network stays secure against potential future quantum attacks. The flexible design allows multiple PQ schemes, continual cryptanalysis, and incremental user adoption. This future-proofs Bitcoin’s cryptographic foundation, maintaining trust and stability in the decades ahead.

  2. willcl-ark commented at 2:45 pm on December 10, 2024: member

    Hey @tgaeta. Thanks for opening this discussion.

    I am going to close this issue in this repository as this type of protocol specification will need to go through some review on the bitcoindev mailing list and/or Delving Bitcoin.

    It would likely also want to be opened in the BIPS repo before we can consider it useful in this repository.

    The mailing list can be found here: bitcoindev mailing list and Delving Bitcoin here: Delving Bitcoin.

    Please re-open this spec in another one of those forums to gather technical review for your proposed BIP.

    Thanks again!

  3. willcl-ark closed this on Dec 10, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me