Subject: Re: [bitcoindev] Pre-emptive commit/reveal for quantum-safe migration (poison-pill)

From: "'conduition' via Bitcoin Development Mailing List" <[email-masked]>
Date: Mon, 09 Jun 2025 16:29:48 +0000

Thanks for clarifying, Leo, that does make a bit more
sense now.

I'm not in love with the duplication of TX data
on-chain, but it could technically be workable. 

Possible improvement: instead of committing to the
wTXID and revealing the entire transaction, maybe
reveal only the wTXID at step 3. After all, you're not
mining the TX yet, just initiating a challenge phase
to see which is the oldest committed spending TX.
The actual spending TX data is not necessary at this stage
unless you want the TX to be automatically published
(by being stored on-chain already).

Either way this would be quite complicated to implement.
Nodes would have to maintain a DB which tracks the info
needed to validate these new spending rules.

I think i still prefer Martin's commit/reveal solution
[0] better for a few reasons. 

1. It doesn't require nodes keep track of commitments,
   reveals, and counter-reveals independently of the UTXO
   set.
2. It's more space efficient.
3. It requires no convoluted "counter reveal" stage.

I realize your announcement-based approach could, in
theory, protect exposed pubkeys, but I see a bit of a
problem there. For an exposed pubkey to be protected
with this commit/reveal protocol, its owner must

- sign a TX which spends all the UTXOs in the exposed
  pubkey address
- commit to that TX in an on-chain announcement TX
  (e.g. via OP_RETURN)
- repeat and publish a new announcement any time the
  UTXOs in the address change
- do all of this before a quantum attacker inverts
  their pubkey and publishes their own announcement

If the user has the ability and awareness to actively
prepare for Q-day like this, why wouldn't they simply
move their funds to a quantum safe address? Or lacking
that, even just to a hashed address without an exposed
pubkey, from which they'd stand a better chance to evade
quantum attack?

I think the real problem with exposed-pubkey addresses
is for cases where the owners are offline, unaware,
unable, or unwilling to make quantum preparations.
Without active preparation, i suspect exposed-pubkey
addresses are lost causes. (happy to be proven wrong though)

regards,
conduition

[0]: https://groups.google.com/g/bitcoindev/c/jr1QO95k6Uc/m/2UDYJ-z6AgAJ

On Monday, June 9th, 2025 at 6:10 AM, Leo Wandersleb <[email-masked]> wrote:

> Hi conduition,
> I see the confusion - let me clarify step 3:
> 

> The "reveal" is an on-chain announcement that includes the full transaction data, but it's not executed as a spending transaction yet. Think of it as:
> 

> ```
> Block N: Announcement TX containing:
> - Full spending transaction (with signatures, witness data)
> - Merkle proof linking to prior commitment
> - Reference to target UTXO
> ```
> 

> This announcement transaction gets mined immediately (paying fees with other inputs), but the vulnerable UTXO remains unspent. It's essentially storing the transaction data on-chain for the contest period.
> 

> After 144 blocks, the winning transaction (oldest valid commitment) can be executed as a normal spend. No double-spending or special states needed - the UTXO simply can't be spent until the contest period ends and we know which commitment won.
> 

> So yes, we're storing the transaction data twice (once in announcement, once in actual execution), but this avoids any consensus-breaking changes while protecting against quantum attacks.
> 

> Regards,

> Leo

> ---
> On Thursday, 5 June 2025 at 17:10:46 UTC+2 conduition wrote:
> 

> > Hi Leo,

> > When a user reveals a transaction + commitment proof, are you
> > assuming it will be included in a block? Or is the reveal TX
> > somehow put "on ice" for those 144 blocks, and only then mined?
> > 

> > If the former, this implies your protocol would need to allow
> > double-spending of UTXOs even after many confirmations, as
> > Tim has noted. Otherwise having an older announcement wouldn't
> > give any advantage. I don't see how you'd implement this without
> > breaking many founding assumptions of Bitcoin, maybe introducing
> > some new special "confirmed-but-pending" state specifically
> > for the outputs of these reveal TXs.
> > 

> > If the latter, and the TX isn't immediately mineable, then how
> > exactly do nodes know when to consider it consensus-valid?
> > Imagine you're a node and you receive a reveal transaction
> > with a valid (old enough) commitment proof. The TX claims
> > to have been created 144 blocks ago and thus should be
> > mineable. But how do you verify that, if the TX wasn't
> > included in a past block?
> > 

> > regards,
> > conduition

> > On Thursday, June 5th, 2025 at 7:55 AM, Leo Wandersleb <[email-masked]> wrote:
> > 

> > > Hi Boris, hi list,
> > > I think the weak announcement is a bad idea once EC crypto is broken to the point where an attacker can break the key before the transaction gets mined but the strong announcements should still hold as they have less urgency. If the attacker sees the transaction in a strong announcement with a full transaction, he cannot win even if he gets into a block first, as the strong announcement proves a prior commitment to that transaction and would win even if it gets mined only some blocks later.
> > >
> > 

> > > A scheme where the announcement does not contain the full transaction is problematic as the transaction might then turn out to not be valid. Then nodes would wait for the "winning" wtxid blocking the UTXO forever.
> > >
> > 

> > > So the scheme is:

> > > After activation at block height X:
> > >
> > 

> > > 1. **Vulnerable UTXOs cannot be spent directly** - they require a prior announcement
> > > 2. **Commitment** to a wTXID that spends the vulnerable UTXO. Multiple wTXIDs can be stored in a hash tree in an OP_RETURN
> > > 3. **Reveal** full transaction with proof of prior commitment but not as a normal transaction yet
> > > 4. **Counter Reveal**: For 144 blocks, others can reveal older commitments. This protects exposed pubkeys!
> > > 5. **After 144 blocks**: The UTXO can be spent according to the strongest announcement (oldest commitment of valid transaction wins).
> > >
> > 

> > > As (5) is just the normal transaction, the scheme is a soft fork and compatible with pre-recorded transactions where the keys were lost. It would at least double the on-chain costs for these vulnerable UTXOs as they would have to store the full transaction twice. We can make the announcements prunable again though.
> > >
> > 

> > > Best,

> > > Leo
> > > On Wednesday, 4 June 2025 at 20:40:32 UTC+2 Boris Nagaev wrote:
> > >
> > 

> > > > Hi Leo,

> > > > I think it is possible to provide privacy for Satoshi and also reduce the size of a weak announcement (strong announcements can already be small: just a txid or a Merkle root of many txids).
> > > >
> > 

> > > > Importantly, we cannot include the whole signed transaction in the weak announcement. Doing so would leak the EC public key immediately, allowing an attacker to create their own valid weak announcement. We must avoid revealing the public key until the actual spending transaction is broadcast.
> > > >
> > 

> > > > We need a scheme where the EC public key is not leaked in a weak announcement, but the legitimate owner can verify it, while no one else can. Also, once the EC public key is revealed, anyone should be able to verify a past weak announcement (to validate the transaction when it is broadcast). This reduces to the following requirement: we need a proof of knowledge of the EC public key that can be verified if the public key is known and provides no information otherwise.
> > > >
> > 

> > > > I think this is called a zero-knowledge proof. One simple approach could be to apply a tagged hash function to the concatenation of the EC public key and the future wTXID, and include this in the weak announcement. The structure would be:
> > > >
> > 

> > > > - UTXO (previous TXID and output index)
> > > > - future spending wTXID
> > > > - proof := tagged_hash(EC public key || wTXID)
> > > >
> > 

> > > > The wTXID is included in the concatenation to bind the proof to a particular future transaction. Otherwise, someone could copy a weak announcement and substitute their own wTXID.
> > > >
> > 

> > > > Satoshi could publish a strong announcement now and then monitor all weak announcements involving his UTXOs. If someone publishes a weak announcement for one of his coins, he could verify the "proof" field. If it is valid, it would mean someone has cracked his key with a quantum computer, and he would need to use his strong announcement immediately to reclaim the funds before the attacker does.
> > > >
> > 

> > > > Best,
> > > > Boris

> > > > On Wednesday, June 4, 2025 at 2:40:53 PM UTC-3 Leo Wandersleb wrote:
> > > >
> > 

> > > > > Hi Boris,
> > > > > the announcements, weak and strong would have to not be transactions yet to be compatible with legacy nodes and thus keep it a soft-fork. They could be OP_RETURN data. Only after the 144 blocks, the upgraded full nodes would allow the inclusion of the actual transaction. This would mean the transaction would be both in full in the OP_RETURN strong announcement and without the witness part later, so it would be a bit expensive this way but maybe we can do better?
> > > > >
> > 

> > > > > A node that gets updated would have to re-index all the blockchain to find announcements if we don't introduce a time frame for actually using the announcements. We could also say that any announcement has to be used within another 1000 blocks. Then the upgrading node would have to re-index the last 1000 blocks.
> > > > >
> > 

> > > > > The legitimate owner of a UTXO might wait for an attack for privacy reasons. My proposal would allow Satoshi himself to make all his UTXOs quantum safe without any of us learning about him being active. He could add one 64B OP_RETURN in 2027 and when QC becomes an issue, we would learn about him having been active in 2027 in 2040 when actually somebody tried to attack and not in 2027 when people started to panic because of imminent quantum breakthroughs.
> > > > > Hmm ... a problem is the weak announcement doesn't require keys, so anybody could provoke Satoshi to come forward. Maybe we have to add key ownership as a requirement for the "weak" announcement, too. So it should also contain a serialized transaction.
> > > > >
> > 

> > > > > Best,

> > > > > Leo

> > > > > On Wednesday, 4 June 2025 at 04:15:59 UTC+2 Nagaev Boris wrote:
> > > > >
> > 

> > > > > > Hi Leo,

> > > > > > Thanks for the clarifications, much appreciated!
> > > > > > I have a couple of questions:
> > > > > >
> > 

> > > > > > 1. How is a weak announcement stored in the blockchain and in the UTXO set?
> > > > > > I assume it must be a transaction, correct? And it should somehow mark
> > > > > > the UTXO as planned to be spent for 144 blocks?
> > > > > > How would older (non-upgraded) nodes interpret a transaction
> > > > > > containing a weak announcement? Would they just skip over it without
> > > > > > any special processing?
> > > > > > If so, is there a problem for nodes that upgrade after the fork: would
> > > > > > they have to reprocess all blocks since the fork to find and index all
> > > > > > missed weak announcements?
> > > > > >
> > 

> > > > > > 2. In the case of reclaiming a UTXO after a weak announcement by an
> > > > > > attacker: why would the legitimate owner wait for a weak announcement
> > > > > > at all?
> > > > > > If the EC public key was already leaked, it seems they should publish
> > > > > > a strong announcement themselves rather than wait. If the EC public
> > > > > > key wasn't leaked, there's nothing to worry about even if someone
> > > > > > publishes a weak announcement: they are most likely bluffing, since
> > > > > > they wouldn't have the actual public key.
> > > > > >
> > 

> > > > > > Best,
> > > > > > Boris

> > > > > > On Tue, Jun 3, 2025 at 3:29 PM Leo Wandersleb <[email-masked]> wrote:
> > > > > > >
> > > > > > > Hi conduition,
> > > > > > >
> > > > > > > Thanks for your careful analysis - excellent catches.
> > > > > > >
> > > > > > > You're absolutely right about the txid vulnerability. The commitment must be to the complete transaction including witness data (wTXID or equivalent) to prevent an attacker from pre-committing to unsigned transactions. This is essential - otherwise an attacker could indeed enumerate the UTXO set and create commitments without knowing the private keys.
> > > > > > >
> > > > > > > Regarding updates: You're correct that frequent updates would be needed as wallets receive new UTXOs. However, I don't see this as a major issue - users could batch their commitments periodically (say, monthly) rather than after every transaction. The scheme is particularly important for existing UTXOs that already have exposed pubkeys (old P2PK, reused addresses, etc.). For new UTXOs, wallets should ideally migrate to quantum-safe addresses once available. OpenTimestamps aggregation would indeed help with scaling and provide plausible deniability about the number of UTXOs being protected.
> > > > > > >
> > > > > > > The time delay serves a different purpose than you might expect. It's not about preventing commitment forgery after pubkey exposure, but rather about allowing priority based on commitment age when multiple parties claim the same UTXO:
> > > > > > >
> > > > > > > 1. Weak announcement starts the 144-block window
> > > > > > > 2. During this window, anyone with a strong commitment can reveal it
> > > > > > > 3. The oldest valid commitment wins
> > > > > > >
> > > > > > > This creates the "poison pill" effect: an attacker might crack a key and try to spend a UTXO, but if the original owner has an older commitment, they can reclaim it during the window. The uncertainty about which UTXOs have poison pills makes attacking large "lost" UTXOs risky - hence less disruptive to the network.
> > > > > > >
> > > > > > > The delay essentially allows a "commitment priority contest" where age determines the winner, protecting users who prepared early while still allowing these users to not move their funds.
> > > > > > >
> > > > > > > Best,
> > > > > > >
> > > > > > > Leo
> > > > > > >
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
> > > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to [email-masked].
> > > > > > > To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/5e393f57-ac87-40fd-93ef-e1006accdb55n%40googlegroups.com.
> > > > > >
> > 

> > > > > > --
> > > > > > Best regards,
> > > > > > Boris Nagaev

> > > --
> > > You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [email-masked].
> > > To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/ea71bbd5-1325-445b-977f-a52b8017eab4n%40googlegroups.com.
> 

> --
> You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email-masked].
> To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/d6196c29-267f-4172-8b39-9e2abd344378n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email-masked].
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/ejSZyf9UmYgOm9D40yAcKNk03pKBLk82dAmdgjq0xNGRZK4R2jd0DcbZqiXoSiYNBBzMpGcezGwTe3wLN96VCl7R0yqPbChWlsKWTphUqUw%3D%40proton.me.