Cointime

Download App
iOS & Android

How to hard-fork to save most users’ funds in a quantum emergency

From ethresearch by vbuterin

Suppose that it is announced tomorrow that quantum computers are available, and bad actors already have access to them and are able to use them to steal users’ funds. Preventing such a scenario is the goal of quantum-resistant cryptography (eg. Winternitz signatures, STARKs), and once account abstraction is in place, any user can switch to using a quantum-resistant signature scheme on their own schedule. But what if we don’t have that much time, and a sudden quantum transition happens long before that?

I argue that actually, we are already well-positioned to make a pretty simple recovery fork to deal with such a situation. The blockchain would have to hard fork and users would have to download new wallet software, but few users would lose their funds.

The main challenge with quantum computers is as follows. An Ethereum address is defined as keccak(priv_to_pub(k))[12:], where k is the private key, and priv_to_pub is an elliptic curve multiplication to convert the privkey into a pubkey. With quantum computers, elliptic curve multiplications become invertible (because it’s a discrete-log problem), but hashes are still safe. If a user has not made any transactions with their account, then only the address is publicly visible and they are already safe. But if a user has made even one transaction, then the signature of that transaction reveals the public key, which in a post-quantum world allows revealing the private key. And so most users would be vulnerable.

But we can do much better. The key realization is that in practice, most users’ private keys are themselves the result of a bunch of hash calculations. Many keys are generated using BIP-32 13, which generates each address through a series of hashes starting from a master seed phrase. Many non-BIP-32 methods of key generation work similarly: eg. if a user has a brainwallet, it’s generally a series of hashes (or medium-hard KDF) applied to some passphrase.

This implies the natural structure of an EIP to hard-fork the chain to recover from a quantum emergency:

  1. Revert all blocks after the first block where it’s clear that large-scale theft is happening
  2. Traditional EOA-based transactions are disabled
  3. A new transaction type is added to allow transactions from smart contract wallets (eg. part of RIP-7560 20), if this is not available already
  4. A new transaction type or opcode is added by which you can provide a STARK proof which proves knowledge of (i) a private preimage x, (ii) a hash function ID 1 <= i < k from a list of k approved hash functions, and (iii) a public address A, such that keccak(priv_to_pub(hashes[i](x)))[12:] = A. The STARK also accepts as a public input the hash of a new piece of validation code for that account. If the proof passes, your account’s code is switched over to the new validation code, and you will be able to use it as a smart contract wallet from that point forward.

For gas efficiency reasons (after all, STARKs are big), we can allow the STARK to be a batch proof, proving N STARKs of the above type (it has to be a STARK-of-STARKs rather than a direct proof of multiple claims, because each user’s x needs to be kept private from the aggregator).

The infrastructure to implement a hard fork like this could in principle start to be built tomorrow, making the Ethereum ecosystem maximally ready in case a quantum emergency does actually come to pass.

Comments

All Comments

Recommended for you

  • ETH Falls Below $2300

    Market data shows that ETH has fallen below $2300, currently priced at $2280.99, with a 24-hour increase of 2.89%. The market is experiencing significant fluctuations, so please ensure proper risk management.

  • BTC Falls Below $77,000

    Market data shows that BTC has fallen below $77,000, currently priced at $76,900.26, with a 24-hour decline of 1.54%. The market is experiencing significant volatility, so please ensure proper risk management.

  • National Development and Reform Commission: Investment Ban on Foreign Acquisition of Manus Project

    On April 27, the Office of the Foreign Investment Security Review Mechanism (National Development and Reform Commission) made a legal and regulatory decision to prohibit foreign investment in the acquisition of the Manus project, requiring the parties involved to withdraw from the acquisition transaction. (National Development and Reform Commission)

  • BTC Falls Below $78,000

    Market data shows that BTC has fallen below $78,000, currently priced at $77,984.99, with a 24-hour decline of 0.1%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Iran Official: Hormuz Passage Fees Must Be Settled in Iranian Rials

    On April 27, Ibrahim Azizi, chairman of the National Security and Foreign Policy Committee of the Iranian Islamic Parliament, stated in an interview aired on April 26 that passage fees for the Strait of Hormuz must be settled in the Iranian national currency, the rial, and that vessels and goods related to Israel are not allowed to pass under any circumstances. (CCTV International News)

  • ETH Surpasses $2400

    Market data shows that ETH has surpassed $2400, currently priced at $2400.99, with a 24-hour increase of 3.69%. The market is experiencing significant volatility, so please ensure proper risk management.

  • US Media: Iran Proposes Agreement to Reopen Strait but Delays Nuclear Talks

    On April 27, AXIOS reported, citing a U.S. official and two informed sources, that Iran has proposed a new initiative to the United States, suggesting prioritizing an agreement on reopening the Strait of Hormuz and lifting maritime blockades, while postponing nuclear negotiations to a later stage. This new proposal aims to break the current deadlock in negotiations and circumvent internal disagreements within the Iranian leadership regarding the extent of nuclear concessions they are willing to make to reach an agreement with the Trump administration. According to three U.S. officials, President Trump is expected to hold a war room meeting with his senior national security and foreign policy team on Iran issues on Monday. One official indicated that the meeting is anticipated to discuss the current stalemate in negotiations with Iran and potential next steps regarding military action.

  • BTC Surpasses $79,000

    Market data shows that BTC has surpassed $79,000, currently priced at $79,003.66, with a 24-hour increase of 1.84%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Iranian Official Says Second Round of Talks with US Possible in Coming Days

    On April 26, a day earlier in local time, an Iranian diplomatic official stated that Iran and the US delegation might hold a second round of negotiations in the coming days. It is understood that Iran has conveyed a message to the US, requesting President Trump to reduce threatening rhetoric. The official also indicated that if the US stance becomes more conciliatory, hardliners within Iran would be more likely to support participation in the negotiations. (CCTV News)

  • Trump: Uncertain if He Was Target of Shooter's Attack

    On April 27, President Trump was interviewed by CBS and was asked whether he was the target of the attacker at the White House Correspondents' Dinner. He responded, 'I don't know. It sounds like he is an extreme person. From what he has written, he has been through a lot. His brother has complaints about him, and his sister is also dissatisfied with him. His family is very concerned about him. He is likely a person with very poor mental health.' (Dongxin News Agency)