Part 1 of this series defined what quantum computer systems actually are. Not simply sooner variations of normal computer systems, however a essentially totally different type of machine that exploits the bizarre guidelines of physics that solely apply on the scale of atoms and particles.
But realizing how a quantum computer works doesn’t inform you the way it can be used to steal bitcoin by a dangerous actor. That requires understanding what it’s actually attacking, how bitcoin’s safety is constructed, and precisely the place the weak point sits.
This piece begins with bitcoin’s encryption and works via to the nine-minute window it takes to break it, as recognized by Google’s recent quantum computing paper.
The one-way map
Bitcoin makes use of a system referred to as elliptic curve cryptography to show who owns what. Every pockets has two keys. A non-public key, which is a secret quantity, 256 digits lengthy in binary, roughly so long as this sentence. A public key’s derived from the non-public key by performing a mathematical operation on the particular curve referred to as “secp256k1.”
Think of it as a one-way map. Start at a recognized location on the curve that everybody agrees on, referred to as the generator level G (as proven in the chart beneath). Take a non-public variety of steps in a sample outlined by the curve’s math. The variety of steps is your non-public key. Where you find yourself on the curve is your public key (level Okay in the chart). Anyone can confirm that you simply ended up at that particular location. Nobody can determine what number of steps you took to get there.
Technically, that is written as Okay = ok × G, the place ok is your non-public key and Okay is your public key. The “multiplication” just isn’t common multiplication however a geometric operation the place you repeatedly add a level to itself alongside the curve. The outcome lands on a seemingly random spot that solely your particular quantity ok would produce.

The essential property is that going ahead is simple and going backward is, for classical computer systems, successfully not possible. If you already know ok and G, calculating Okay takes milliseconds. If you already know Okay and G and wish to determine ok, you’re fixing what mathematicians name the elliptic curve discrete logarithm downside.
It is estimated that the best-known classical algorithms for a 256-bit curve would take longer than the age of the universe.
This one-way trapdoor is your complete safety mannequin. Your non-public key proves you personal your cash. Your public key’s secure to share as a result of no classical computer can reverse the mathematics. When you ship bitcoin, your pockets makes use of the non-public key to create a digital signature, a mathematical proof that you already know the key quantity with out revealing it.
Shor’s algorithm opens the door each methods
In 1994, a mathematician named Peter Shor discovered a quantum algorithm that breaks the trapdoor.
Shor’s algorithm solves the discrete logarithm downside effectively. The similar math that might take a classical computer longer than the universe has existed, Shor’s algorithm handles in what mathematicians name polynomial time, which means the problem grows slowly as numbers get larger somewhat than explosively.
The instinct for the way it works comes again to the three quantum properties from Part 1 of this sequence.
The algorithm wants to discover your non-public key ok, given your public key Okay and the generator level G. It converts this into a downside of discovering the interval of a operate. Think of a operate that takes a quantity as enter and returns a level on the elliptic curve.
As you feed it sequential numbers, 1, 2, 3, 4, the outputs ultimately repeat in a cycle. The size of that cycle is known as the interval, and as soon as you understand how typically the operate repeats, the mathematics of the discrete logarithm downside unravels in a single step. The non-public key falls out nearly instantly.
Finding this era of a operate is precisely what quantum computer systems are constructed for. The algorithm places its enter register into a superposition (or, in quantum mechanics, a particle exists in a number of areas concurrently), representing all attainable values concurrently. It applies the operate to all of them without delay.
Then it applies a quantum operation referred to as the Fourier rework, which causes the variety of incorrect solutions to cancel out whereas the right solutions are bolstered.
When you measure the outcome, the interval seems. From this era, peculiar math recovers ok. That is your non-public key, and due to this fact your cash.

The assault makes use of all three quantum methods from the primary piece. Superposition evaluates the operate on each attainable enter without delay. Entanglement hyperlinks the enter and output so the outcomes keep correlated. ‘Interference’ filters the noise till solely the reply stays.
Why bitcoin nonetheless works right this moment
Shor’s algorithm has been recognized for greater than 30 years. The motive bitcoin nonetheless exists is that operating it requires a quantum computer with a giant sufficient variety of steady qubits to keep coherence via your complete calculation.
Building that machine has been past attain, however the query has all the time been how giant is “large enough.”
Previous estimates stated tens of millions of bodily qubits. Google’s paper, in early April by its Quantum AI division with contributions from Ethereum Foundation researcher Justin Drake and Stanford cryptographer Dan Boneh, lowered that to fewer than 500,000.
Or a roughly 20-fold discount from prior estimates.
The workforce designed two quantum circuits that implement Shor’s algorithm in opposition to bitcoin’s particular elliptic curve. One makes use of roughly 1,200 logical qubits and 90 million Toffoli gates. The different makes use of roughly 1,450 logical qubits and 70 million Toffoli gates.
A Toffoli gate is a sort of gate that acts on three qubits: two management qubits, which have an effect on the state of a third, goal qubit. Imagine this as three mild switches (qubits) and a particular lightbulb (the goal) that solely activates if two particular switches are flipped on on the similar time.
Because qubits lose their quantum state always, as Part 1 defined, you want lots of of redundant qubits checking one another’s work to keep a single dependable logical qubit. Most of a quantum computer exists simply to catch the machine’s personal errors earlier than they break the calculation. The roughly 400-to-1 ratio between bodily and logical qubits displays how a lot of the machine exists as self-babysitting infrastructure.
The nine-minute window
Google’s paper didn’t simply cut back qubit counts. It launched a sensible assault situation that adjustments how to take into consideration the risk.
The components of Shor’s algorithm that rely solely on the elliptic curve’s mounted parameters, that are publicly recognized and equivalent for each bitcoin pockets, can be precomputed. The quantum computer sits in a primed state, already midway via the calculation, ready.
The second a goal public key seems, whether or not broadcast in a transaction to the community’s mempool or already uncovered on the blockchain from a earlier transaction, the machine solely wants to end the second half.
Google estimates that the second half takes about 9 minutes.
Bitcoin’s common block affirmation time is 10 minutes. That means if a person broadcasts a transaction and their public key’s seen in the mempool, a quantum attacker has roughly 9 minutes to derive a non-public key and submit a competing transaction that redirects funds.
The math offers the attacker a roughly 41% likelihood of ending earlier than your authentic transaction confirms.
That is the mempool assault. It is alarming however it requires a quantum computer that doesn’t exist but.
The larger concern, nevertheless, is the 6.9 million bitcoin (roughly one-third of complete provide) sitting in wallets the place the general public key has already been completely uncovered on the blockchain. Those cash are susceptible to an “at-rest” assault that requires no race in opposition to the clock. The attacker can take so long as wanted.

A quantum computer operating Shor’s algorithm can flip a bitcoin public key into the non-public key that controls the cash. For cash transacted since Taproot (a privateness improve on Bitcoin that went stay in November 2021), the general public key’s already seen. For cash in older addresses, the general public key’s hidden till you spend, at which level you’ve got roughly 9 minutes earlier than the attacker catches up.
What this implies in apply, which 6.9 million bitcoin are already uncovered, what Taproot modified, and how briskly the {hardware} is closing the hole, is the topic of the following and closing piece in this sequence.



