Sicurezza Bitcoin: quanto è difficile craccare un seed BIP39 a 12 parole Bitcoin security: how hard is it to crack a 12-word BIP39 seed
Quanto è difficile hackerare Bitcoin? Worst case scenario: un milione di GPU, energia a 4 centesimi al kWh, hardware al limite teorico. Servono dieci milioni di anni per craccare un seed BIP39, anche con i computer quantistici. How hard is it to hack Bitcoin? Worst case scenario: one million GPUs, electricity at 4 cents per kWh, hardware at the theoretical limit. Ten million years to crack a BIP39 seed, even with quantum computers.
Dieci milioni di anni.
Questo è il tempo atteso prima che un attaccante con risorse da superpotenza inciampi nel primo wallet Bitcoin già usato. Non è una stima cauta, è un ragionamento per ordini di grandezza, nel worst case scenario che analizza la resistenza dei wallet Bitcoin ad attacchi brute force sulla seed phrase a 12 parole.
Perché conviene attaccare il seed, non la chiave privata
Il riflesso, davanti a un wallet Bitcoin, è pensare alle chiavi private a 256 bit come al bersaglio dell’attacco. Da un punto di vista puramente matematico è invece la scelta peggiore: un cacciatore di collisioni razionale itera sulle combinazioni di 12 parole e ignora completamente lo spazio delle chiavi grezze. Il motivo si riduce a un concetto solo, la densità dei bersagli.
Lo spazio delle chiavi private a 256 bit contiene combinazioni. Per un confronto, basti pensare che gli atomi nell’universo osservabile sono nell’ordine dei
Lo spazio dei seed BIP39 a 12 parole, al netto del checksum, contiene invece combinazioni. Lo spazio a 128 bit è esattamente volte più piccolo di quello a 256 bit. Trentanove ordini di grandezza di vantaggio probabilistico per chi attacca il seed invece della chiave, gratis.
Vero è che calcolare un indirizzo pubblico a partire da una chiave privata costa pochissimo, mentre iterare sui seed costa caro: lo standard BIP39 impone 2048 round di PBKDF2 su HMAC-SHA512 prima ancora di toccare la curva ellittica, e quei round sono lì apposta per rallentare l’attacco. Anche assumendo però che l’hardware riesca a testare chiavi private centomila volte più velocemente dei seed, il conto è cinque ordini di grandezza contro trentanove. Questa obiezione avrebbe senso solo nello scenario in cui ogni wallet avesse indirizzi usati. Non è il caso.
Quanti wallet al secondo riesce a sfornare l’hardware
Per pesare correttamente l’attacco serve sapere quanto è veloce, in pratica, generare un wallet completo. Per produrre un singolo wallet e il suo primo indirizzo il processore deve macinare in sequenza:
- BIP39 (seed): 2048 iterazioni di HMAC-SHA512.
- BIP32/BIP44 (derivation path): 4 o 5 derivazioni gerarchiche, ciascuna con moltiplicazioni scalari e addizioni di punti sulla curva ellittica
secp256k1, più ulteriori passaggi di HMAC-SHA512. - Indirizzo: un giro di SHA-256 seguito da RIPEMD-160.
Lavorando in parallelo estremo, una GPU enterprise (NVIDIA H100, H200, Blackwell B100/B200) con codice CUDA scritto a regola d’arte ha un limite superiore plausibile nel migliore dei casi attorno a wallet al secondo. Numero generoso, e proprio per quello va tenuto come riferimento del worst case.
Facciamo due conti
Come dati di partenza abbiamo:
- Spazio di ricerca: Seed.
- Secondi in un anno .
Ragionando per ordini di grandezza, mettiamoci nella posizione più sfavorevole in assoluto:
- Gpu usate: 1 milione, ognuna con vita infinita, spinte al limite teorico di wallet al secondo: .
- Dieci wallet a testa moltiplicati per dieci miliardi di persone: wallet usati
Questo significa che l’attaccante è in grado di generare
Considerando i bersagli come uniformemente distribuiti nello spazio dei seed, il numero atteso di tentativi prima di trovarne uno (valore atteso della distribuzione geometrica) è .
Da cui si ottiene che il tempo atteso per il primo hit è
Dieci milioni di anni per trovare un singolo wallet già usato, assumendo il miglior hardware ipotizzabile, un parco GPU che nessuna entità al mondo possiede oggi, e una flotta interamente dedicata a questo task per tutta la sua vita utile.
Analizzando i risultati, Una H100 SXM ha un TDP di 700 W. Un milione di queste schede consuma, di solo silicio:
Aggiungendo raffreddamento, alimentazione e infrastruttura, possiamo stimare un consumo di 1 GW. Wnergia annua: . Più o meno metà del consumo elettrico annuo dell’Islanda intera, solo per la farm.
Tariffa industriale bassa, sempre scegliendo il caso favorevole all’attaccante, mettiamo 4cent. Costo elettrico annuo: dollari.
Circa 350 milioni di dollari l’anno di bolletta. Ogni anno, per tutto il tempo dell’attacco. L’energia totale spesa, in joule, si piazza intorno ai , all’incirca 500 volte il consumo energetico totale dell’umanità in un anno. Tutto questo per un wallet, che potrebbe anche essere usato ma vuoto.
E i computer quantistici?
Ogni volta che si parla di sicurezza crittografica salta fuori il quantum panic, quindi conviene chiudere anche quel fronte. L’algoritmo di Grover offre uno speedup quadratico sulla ricerca non strutturata, e questo significa che sullo spazio dei seed BIP39 a 128 bit la sicurezza effettiva crolla a
Sulla carta è un crollo violento. In pratica conta meno di quanto si pensi. Anche assumendo un computer quantistico ipotetico che sostenga operazioni utili al secondo (ordini di grandezza sopra qualsiasi hardware reale), Grover richiederebbe ancora circa 570 anni di esecuzione continua per un singolo seed. E quel è una stima fantascientifica, l’hardware attuale è lontanissimo dal sostenere coerenza, fidelity e correzione d’errore necessarie a far girare Grover su problemi di questa scala, e sarà così per svariati anni a venire.
Shor è un discorso a parte, e attacca le chiavi pubbliche esposte sulla blockchain, non i seed. Va affrontato separatamente, ma sui wallet che non hanno mai speso non si applica. Per ora, e per parecchio tempo, il quantum non sposta il muro.
La seed phrase non è a rischio
Worst case totale a favore dell’attaccante, hardware al limite teorico, energia a tariffa industriale minima e popolazione di wallet sovrastimata: il tempo atteso resta dieci milioni di anni, e il costo viaggia nei quadrilioni di dollari. Le ottimizzazioni realistiche che si possono immaginare spostano la soglia di uno o due ordini di grandezza al massimo, e non basta.
L’unica superficie d’attacco che resta sul tavolo è quella umana. Foto al foglio di backup, screenshot del seed, password manager bucati, phishing, supply chain compromessa, social engineering. È lì che un attaccante razionale investe tempo e capitale, perché il lato matematico è chiuso e quello umano notoriamente no.
Ten million years.
That’s the expected time before an attacker with superpower-grade resources stumbles upon the first already-used Bitcoin wallet. This isn’t a conservative estimate; it’s a worst-case, order-of-magnitude projection that examines the resistance of Bitcoin wallets to brute force attacks against the 12-word seed phrase.
Why attacking the seed is better than attacking the private key
The immediate instinct when looking at a Bitcoin wallet is to target the 256-bit private keys of the attack. From a purely mathematical standpoint that’s instead the worst possible choice: a rational collision hunter iterates over the 12-word combinations and completely ignores the raw key space. The reason boils down to a single concept, target density.
The 256-bit private key space contains combinations. For comparison, the atoms in the observable universe are on the order of .
The BIP39 12-word seed space, excluding the checksum, instead contains combinations. The 128-bit space is exactly times smaller than the 256-bit one. That’s a free, 39-order-of-magnitude probabilistic advantage for anyone attacking the seed instead of the key.
True, computing a public address starting from a private key is dirt cheap, while iterating over seeds is expensive: the BIP39 standard mandates 2048 rounds of PBKDF2 over HMAC-SHA512 before you even touch the elliptic curve, and those rounds are there precisely to slow down the attack. Even assuming that hardware can test private keys a hundred thousand times faster than seeds, the tradeoff is five orders of magnitude in computational cost versus thirty-nine in target density. This objection would make sense only in a scenario where every wallet had used addresses. It doesn’t.
How many wallets per second can hardware actually produce
To weigh the attack correctly you need to know how fast, in practice, a complete wallet can be generated. To produce a single wallet and its first address the processor has to grind through, in sequence:
- BIP39 (seed): 2048 iterations of HMAC-SHA512.
- BIP32/BIP44 (derivation path): 4 or 5 hierarchical derivations, each with scalar multiplications and point additions on the
secp256k1elliptic curve, plus further HMAC-SHA512 passes. - Address: one round of SHA-256 followed by RIPEMD-160.
Working in extreme parallel, an enterprise GPU (NVIDIA H100, H200, Blackwell B100/B200) with CUDA code written by the book has a plausible upper bound, in the best case, around wallets per second. This is a generous estimate, making it the perfect worst-case benchmark.
Let’s do the math
As starting data we have:
- Search space: seeds.
- Seconds in a year .
Reasoning by orders of magnitude, let’s put ourselves in the most unfavorable position possible:
- GPUs in use: one million, each with infinite lifetime, pushed to the theoretical limit of wallets per second:
- Ten wallets per person across a population of ten billion: used wallets.
This means the attacker can generate
Considering the targets as uniformly distributed in the seed space, the expected number of attempts before finding one (expected value of the geometric distribution) is .
From which we get that the expected time to the first hit is
Ten million years to find a single already-used wallet, assuming the best hardware imaginable, a GPU fleet that no entity in the world owns today, and an operation entirely dedicated to this task for its whole useful life.
Looking at what these numbers mean in practice, an H100 SXM has a TDP of 700 W. One million of those cards consume, in silicon alone:
Adding cooling, power delivery and infrastructure, the realistic facility load is around 1 GW. Annual energy: . Roughly half the annual electricity consumption of Iceland in its entirety, only for the farm.
Assuming a rock-bottom industrial electricity rate of to give the attacker every possible advantage: annual electricity cost: dollars.
Around 350 million dollars a year of electricity bills. Every year, for the entire duration of the attack. The total energy spent, in joules, comes in around , roughly 500 times the total energy consumption of humanity in one year. All of this for one wallet, which might even turn out to be used but empty.
What about quantum computers?
Whenever cryptographic security is discussed, quantum panic inevitably follows. Let’s shut that down, too. Grover’s algorithm offers a quadratic speedup on unstructured search, which means that on the 128-bit BIP39 seed space the effective security collapses to
On paper, this looks like a catastrophic collapse. In practice, it’s practically irrelevant. Even assuming a hypothetical quantum computer sustaining useful operations per second (orders of magnitude above any real hardware), Grover would still take around 570 years of continuous execution for a single seed. And that is a science-fiction estimate: current hardware is nowhere near sustaining the coherence, fidelity and error correction needed to run Grover on problems at this scale, and it will stay that way for several years to come.
Shor is a separate story, and attacks public keys exposed on the blockchain, not seeds. It deserves its own treatment, but on wallets that have never spent it doesn’t apply. For now, and for quite a long time, quantum doesn’t move the wall.
The seed phrase isn’t at risk
Total worst case in the attacker’s favor, hardware at the theoretical ceiling, electricity at the minimum industrial tariff, an inflated wallet population: the expected time stays at ten million years, and the cost run into the quadrillions of dollars. The realistic optimizations one can imagine shift the threshold by one or two orders of magnitude at most, and it’s not enough.
The only attack surface that’s left on the table is the human one. Photos of the backup sheet, screenshots of the seed, compromised password managers, phishing, supply chain attacks, social engineering. That’s where a rational attacker invests time and capital, because the math is bulletproof, and human nature famously isn’t.
Note: this article was automatically translated from Italian by AI.