Bitcoin Forum
May 22, 2026, 04:01:57 AM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [PQ Witness] Dilithium in Bitcoin without killing block capacity  (Read 26 times)
h1j2k27 (OP)
Newbie
*
Offline

Activity: 9
Merit: 0


View Profile
May 21, 2026, 12:30:51 AM
 #1

Hi everyone. I would like to start this technical discussion with the topic of protecting Bitcoin from possible future threats
At the moment, one of the first practical approaches to reducing this risk has already been proposed: not revealing the public key until the moment of spending. Quantum resistance for Bitcoin is no longer a distant topic, it is actively discussed at the protocol level. One of the first practical approaches is already on the table: BIP360 / P2QR, where the public key is not placed in the output in advance, but is only revealed during the spend. This reduces the dangerous window to the time between broadcasting the transaction and confirming it in a block. For Bitcoin, that is around 10 minutes on average.

In my opinion, this method is only the first step toward a stronger protection model. Based on developer discussions, it is clear that many people are considering a future move from ECDSA to XMSS signatures for several reasons. First, XMSS is closer to the hash-based signatures model, which fits the Bitcoin philosophy well. It is also a very natural structure for integration and migration. Second, weight: XMSS wins in transaction weight compared to other cryptographic schemes, for example Dilithium. Third, the one-time / few-time signature limitation can be partially adapted to the UTXO model. Bitcoin wallets have long used change outputs, meaning that after a spend, the change goes to a new output / new address. This allows a model where funds move to new key material after each spend. Bitcoin already has this function when change is returned to a new change output / new address.

The other side of the discussion is Falcon, Dilithium and other NIST PQC signatures. The core problem is straightforward, signature sizes are large. With blocks of only a few megabytes, only a few hundred heavy transactions may fit into a block. For Bitcoin, where thousands of transactions per block are expected under normal conditions, this creates real pressure: higher fees, a bloated mempool and long confirmation times.

Among these schemes, Dilithium stands out as a reasonable candidate despite its size. It is NIST-standardized, well-analyzed, and has a relatively predictable security model. The size argument is real, but I think it is an engineering problem, not a reason to reject the scheme outright. So instead of dismissing Dilithium, I decided to test whether changing how this data is stored and accounted for could make it viable.

I prepared a working technical example of PQ Witness for Dilithium.
Dilithium signature data is moved from legacy scriptSig into the witness part of the transaction.
A separate weight accounting model is introduced for PQ witness.
Legacy outputs remain valid, and migration is not forced.
PQ sigops are counted separately, so the network understands the real cost of verifying post-quantum signatures.
Mempool, block validation, wallet/RPC and transaction weight/vsize paths are updated for the new model.

This approach uses a witness accounting factor K = 16. The value is based on the SegWit witness discount ratio scaled up to reflect the verification cost of Dilithium relative to ECDSA, roughly 4x compute overhead on top of the size difference. It is a starting point, not a final value. A heavy Dilithium signature is accounted for much more efficiently in the block than with the direct legacy approach. In my tests, this gives roughly a 12.7x improvement in effective block usage for PQ signature data. If the legacy model can fit roughly 50 heavy PQ transactions into a block, then after PQ Witness activation the capacity can be around 600-700 PQ transactions per block. With proper integration and math, the coefficient could potentially be increased to 32/64 and bring capacity to around 2,500-3,000 transactions per 10 minutes. The exact numbers depend on the structure of specific transactions: the number of inputs, outputs, witness data and selected block parameters. But the order of improvement shows that Dilithium does not necessarily have to be dismissed only because of signature size.
I think that instead of sacrificing the level of cryptographic protection for lower weight, we can try to keep a NIST-standardized signature scheme and adapt the transaction layer to the real size of post-quantum signatures.

XMSS also has a weak point, it is a more fragile model for wallets and users. If a wallet manages indexes incorrectly, reuses a leaf/key, or a user manually builds a transaction carelessly, a situation may happen where part of the funds is sent, while another part remains tied to already revealed key material. This is a separate operational risk. That is why I personally do not consider XMSS to be the only convenient path.
The implementation is available here, check it out and tear it apart. I think it adds one more technical perspective worth having in the discussion.

https://github.com/q-bitx/pq-witness-technical
BattleDog
Full Member
***
Offline

Activity: 237
Merit: 220



View Profile WWW
May 21, 2026, 12:04:03 PM
 #2

I agree with you on XMSS being a wallet-footgun. Stateful signatures are fine in a lab and terrifying in the hands of humans, backup scripts, half-broken mobile wallets, and "I restored an old seed from 2022, why did my coins evaporate?" type situations. Bitcoin already has enough ways for people to shoot themselves in the leg. Adding "reuse this internal signing state and you may expose yourself" is not exactly Grandma-proof, lol.

Dilithium / ML-DSA being stateless is a big practical win, but I would be careful with the "just an engineering problem" framing. In Bitcoin, engineering problems become political problems, then mempool problems, then DoS problems, then ten years of mailing list archaeology. A separate PQ witness bucket makes sense conceptually, but the weight discount has to be brutally honest about validation cost. If the discount is too generous, you didn't solve capacity, you just invented a new spam coupon with a NIST sticker on it.

The part I like most is preserving legacy outputs and making migration opt-in instead of trying to boil the ocean. That is how Bitcoin actually moves. Give people a path, make the cost visible, don't break old assumptions, and let paranoid wallets move first.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!