-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add BIP: QES2 – Hybrid PQC-based Digital Signature Algorithm #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Would it make sense to just add QES2 support to BIP-360? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions
|
||
QES2 can be integrated with BIP-340 (Taproot) by: | ||
|
||
1. Using the QES2-based signature in place of the Schnorr signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You specify QES2 as ECDSA, but ECDSA doesn't support all that Schnorr does. This seems like a step backwards that could break Taproot compatibility. Would it not make sense to implement QES2 with Schnorr and remove mention of ECDSA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like @cryptoquick, I’m confused that this proposal focuses only on ECDSA signatures, when about 1/3 of all existing UTXOs use the P2TR output type that employs BIP340 signatures. Could you please provide rationale for this approach and further address the implications for existing P2TR outputs intended to be spent via the scriptpath?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the great question. Let me clarify the intention behind QES2 in more detail.
First, QES2 is a general-purpose dual-signature scheme initially designed by combining ECDSA and our Dilithium-based post-quantum signature component. The reason we included ECDSA was to ensure compatibility with the existing Bitcoin infrastructure—especially since many legacy UTXOs and current wallet software still rely on ECDSA. Moreover, in the early stages of our research, we chose to develop on top of ECDSA to maintain control over Dilithium signatures and to align with digital signature types commonly used in the financial sector. We are also exploring the expansion to Schnorr signatures and actively working on methods to control and implement signatures more efficiently. Therefore, this proposal is part of a research roadmap and will be developed step-by-step.
That said, as you rightly pointed out, about one-third of UTXOs utilize the P2TR output type that uses BIP340 (Schnorr) signatures. From a BIP-level integration perspective, it indeed makes more sense to consider Schnorr-based design, and we are currently evaluating this actively. We plan to provide a Schnorr-variant of QES2 in the near future.
Our research roadmap is as follows:
-
In the short term, we aim to provide an ECDSA + Dilithium hybrid signature model that can be practically deployed and is compatible with existing infrastructure.
-
In the long term, our goal is to propose a post-quantum signature scheme optimized for Bitcoin, likely based on isogeny-based cryptography.
We are currently developing an isogeny-based signature system that addresses known protocol vulnerabilities (as seen in NIST’s Round 3 competition). We believe this approach offers strong long-term security with small key sizes and resistance to quantum attacks.
To summarize:
- We initially adopted ECDSA for general applicability and control over Dilithium.
- We are actively researching integration with Schnorr-based signatures.
- Our ultimate goal is not to finalize a hybrid scheme, but to fully transition to a PQC-based signature model.
Thank you again for your thoughtful feedback—we see this as a valuable opportunity to ensure QES2 evolves to meet both current and future Bitcoin use cases.
|
||
2. **ECDSA Security**: While vulnerable to quantum attacks, ECDSA remains secure against classical adversaries. | ||
|
||
3. **Binding Property**: The ECDSA signature validates the Dilithium signature, creating a binding that requires breaking both schemes or finding hash collisions to forge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to sign the PQ signature? Can't it just be included separately and still benefit from the same guarantees if committed to in the same address as BIP-360 does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary concern — and the motivation for this work — is that quantum computing poses a real and growing threat to the cryptographic foundations of Bitcoin and other blockchains. In response, we are actively exploring ways to strengthen these systems with post-quantum cryptography.
In the case of QES2, simply appending a PQ signature is not sufficient, as it does not provide a verifiable commitment to the signature within Bitcoin’s existing validation logic. By signing the PQ signature with a currently supported scheme such as ECDSA or Schnorr, we ensure that the signature is cryptographically bound and verifiable in the current infrastructure, without requiring consensus changes or new opcodes.
This hybrid dual-signature design provides a practical path for backward compatibility while introducing post-quantum security guarantees. Ultimately, our goal is to transition toward a fully post-quantum signature scheme, but this intermediate approach offers a secure and deployable solution today.
Hi @j1729labs, have you posted about this to the bitcoin-dev mailing list at https://groups.google.com/g/bitcoindev? Please refer to https://github.com/bitcoin/bips/blob/master/bip-0002.mediawiki#user-content-BIP_workflow for details. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take another look at the formatting. The document’s syntax doesn’t seem to be MediaWiki, and especially the preamble does currently not conform to the required formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your submission. The content of this document shows potential, however it is still lacking some important details (see other review comments). It also currently does not meet the formatting requirements for the BIPs process. Please fix the formatting to conform to the MediaWiki syntax and amend the Preamble to use preformatted text with the required formatting.
As this document is currently not ready to be merged, I’m turning it into a Draft pull request at this time.
New Opcode | ||
~~~~~~~~~~ | ||
|
||
We introduce a new opcode, tentatively assigned as ``OP_QES2_CHECKSIG (0xba)``, that performs verification of the hybrid QES2 signature by checking both the ECDSA signature (which validates the PQC signature) and the Dilithium signature itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opcode 186 was designated OP_CHECKSIGADD
by BIP 342.
|
||
QES2 can be integrated with BIP-340 (Taproot) by: | ||
|
||
1. Using the QES2-based signature in place of the Schnorr signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like @cryptoquick, I’m confused that this proposal focuses only on ECDSA signatures, when about 1/3 of all existing UTXOs use the P2TR output type that employs BIP340 signatures. Could you please provide rationale for this approach and further address the implications for existing P2TR outputs intended to be spent via the scriptpath?
This BIP maintains backward compatibility through several mechanisms: | ||
|
||
1. **Opt-in Deployment**: QES2 addresses are distinct from traditional addresses | ||
2. **Traditional Scripts**: Existing P2PKH, P2SH, P2WPKH, and P2WSH scripts continue to function normally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, this does not address P2TR outputs which make up about 1/3 of all existing UTXOs.
Acknowledgments | ||
============== | ||
|
||
This proposal builds on the work of several other BIPs, including BIP-340, BIP-341, and BIP-342 (Taproot), and incorporates concepts from ongoing research in post-quantum cryptography for blockchains. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m confused that this proposal mentions BIP 340 several times, but insufficiently addresses BIP 340 signatures.
This BIP introduces a new script template: | ||
|
||
.. code-block:: | ||
|
||
<pq_signature_push> <ecdsa_signature_push> <pubkey_push> OP_QES2_CHECKSIG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide more detail how this new script template would be used in transactions. How is it split between output script, input script, witness section, or a newly introduced transaction section? How would this transaction be serialized? If it is intended to be a soft fork, what mechanism is used to allow unupgraded nodes to accept transactions using this signature scheme?
:BIP: Unassigned | ||
:Title: QES2 - A Hybrid Post-Quantum and Classical Digital Signature Scheme for Bitcoin | ||
:Author: [Caleb Lee] director@j1729labs.online, [Justin Park] justin7361@j1729labs.online, [Eunice Lee] cuspro0103@j1729labs.online, [Sophia Shim] zypo1015@j1729labs.online | ||
:Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-XXXX | ||
:Status: Draft | ||
:Type: Standards Track | ||
:Created: 2025-04-18 | ||
:License: BSD-2-Clause | ||
:Requires: 340, 341, 342 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document must start with the preamble adhering to the required format. Beyond the formatting needing to be amended, the title is too long and the authors need to be on separate lines with the format Name <addr@dom.ain>
.
Thank you for the guidance. I will make sure to post this to the mailing list. |
Hi @j1729labs, are you still working on this proposal? |
Based on your advice, I intend to deliver meaningful outcomes and build upon them to develop further proposals. Thank you for your support. |
To @murchandamus, @cryptoquick, and @jonatack, First of all, thank you very much for your valuable advice. Initially, we focused on developing general-purpose technologies, but your insights helped us recognize the importance of building solutions tailored specifically for Bitcoin. Based on this, we extended our original QES2 framework into a hybrid signature scheme incorporating the Schnorr algorithm. Considering existing protocols, the implementation was not particularly difficult. As a result, we split QES2 into two variants — QES2_ECDSA and QES2_Schnorr — and have completed the corresponding whitepaper. [QES2_Schnorr Architecture and Design] A hybrid signature algorithm that performs the first signature using Dilion (an improved version of Dilithium) and the second signature using Schnorr. The Dilion signature is generated off-chain, and the resulting signature is wrapped with a Schnorr signature so that Bitcoin can perform verification using its native Schnorr support. [Benefits of QES2_Schnorr] It is structured to enable seamless compatibility with Bitcoin’s Schnorr verification without additional processing of the off-chain Dilion signature. Although the total signature size is about 4000 bytes (similar to Dilion), only a 64-byte Schnorr signature is used on-chain, achieving lightweight on-chain performance. The scheme maintains post-quantum security due to its structural integration with Dilion. We have built a website to provide access to the whitepaper and allow you to try out the demo. 🔗 Website: https://pqc-function.xyz/ About the site: |
If you're still committing to a secp256k1 key, which is what you'd need to do if you use a P2TR address, you're still vulnerable against quantum attackers. I'm not sure what this gets you without key path spends disabled. |
QES2_Schnorr: A Hybrid Signature Scheme that Achieves Post-Quantum Security in Taproot Without Public Key ExposureBitcoin's Taproot (P2TR) was introduced to simplify signature structures, improve privacy, and enable greater scripting capabilities. It utilizes the Schnorr signature algorithm as its core. However, Taproot still requires the commitment of a secp256k1-based public key on-chain, which becomes a security liability in a post-quantum context, where quantum computers could eventually derive private keys from exposed public keys. To address this structural vulnerability, we introduce QES2_Schnorr, a hybrid signature scheme designed to retain full Taproot compatibility while providing post-quantum resilience without revealing the committed public key. QES2_Schnorr Architecture OverviewQES2_Schnorr generates signatures through two distinct phases:
In this model, while the address remains in Taproot format ( |
Whatever Taproot address is committed to, that corresponds to a valid private key, no matter if it's part of your scheme or not. A CRQC running Shor's could absolutely compromise the funds in that address if the key path spend is not disabled. |
Thanks for the insight — your point about Taproot committing to a secp256k1 key is absolutely valid. However, in the QES2_Schnorr scheme we're working on, key path spend is deliberately disabled. So although the Taproot address includes a commitment to a classical key, it’s never used to authorize spending. This effectively removes the classical path that a quantum attacker would exploit. Instead, spending is enforced entirely through the script path, where we include post-quantum signatures like Dilithium in the MAST structure. QES2_Schnorr isn’t about relying solely on Schnorr — it’s used selectively within a hybrid architecture that combines compatibility (with Bitcoin’s existing stack) and forward-looking quantum resistance. So in practice, the design stays secure against CRQC, while remaining deployable in today's ecosystem. I would appreciate it if you could understand that, for now, this primarily represents the cryptographic approach required for such development, rather than the overall system architecture. |
That's not quite what the BIP says: Also, P2QRH is being trimmed down quite a bit in the recent edits. If you want, you can review the changes and see if you might want to make it a dependency of this BIP: |
Yes, I understand! Actually, I haven't made the changes yet, but I'm planning to revise the BIP proposal based on the advice you kindly shared, @cryptoquick. I just wanted to leave a comment first to show that I'm taking your suggestions seriously and planning to make improvements! I was hoping for a bit of encouragement, so I was a little sad to get corrected instead. 😅 |
I think it is totally okay that the changes aren't made yet; just showing you're engaged and planning to improve is already a big step forward. |
I'll admit I would be more encouraging if I understood it better. I still don't really understand the why behind this. Please be sure to do your best to explain, in simple but comprehensive terms, why this necessary. I also invite you to find flaws in P2QRH as it stands now, or how this might be capable of being integrated into that in some way. |
Hey @j1729labs, it has been about four months since this pull request was opened. My understanding is that you are working on the implementation corresponding to this proposal, but this proposal itself has not seen any updates since then. We prefer pull requests to be opened against this repository when a proposal is close to ready for publication and actively being developed. It doesn’t make sense to me for this pull request to be open, if the proposal is not getting updates. Could you please share your timeline when you expect work on this proposal to pick up? If this is not expected to be updated within the next month, perhaps it would make more sense if the pull request were closed for now and you would submit your document at a later time when you are focused on it. |
Summary:
This pull request introduces a new Bitcoin Improvement Proposal (BIP) for QES2, a hybrid digital signature algorithm that combines post-quantum cryptography (PQC) with traditional ECDSA. The proposal aims to address the potential vulnerabilities posed by quantum computing while preserving backward compatibility with existing Bitcoin infrastructure.
Details:
Abstract: QES2 leverages a dual-signature mechanism to incorporate both a post-quantum signature and a classical ECDSA signature into Bitcoin transactions.
Motivation: With the emerging threat of quantum computers, classical cryptographic methods may become vulnerable. QES2 presents a transitional solution that enhances security during the shift towards quantum-safe systems.
Specification: The BIP outlines the structure, key generation, signing, and verification methods for the hybrid scheme.
Rationale: The hybrid approach ensures that if one signature method is compromised, the other still provides protection, offering a balanced trade-off between security and backward compatibility.
Reference Implementation: A reference implementation will be linked later for further review and testing.