the math break · live demo
One repeated number gives away the key.
This is the bug that exposed Sony’s PlayStation 3 signing key in 2010 and drained Android Bitcoin wallets in 2013. The math is real secp256k1, the curve Bitcoin and Ethereum use, running entirely in your browser. Nothing is sent anywhere.
-
Create a wallet
Generate a random private key and its public key.
-
Sign two transactions
Every ECDSA signature needs a fresh one-time secret, the nonce k. Our buggy wallet reuses it.
-
Recover the private key
Using only the two public signatures and messages:
k = (z₁ − z₂) / (s₁ − s₂) mod n d = (s₁·k − z₁) / r mod n
-
Forge a transaction
Sign something the owner never approved, then check it against their public key.
the lesson
What this teaches
Nothing about ECDSA was broken. The implementation was. Try it again with the buggy-wallet box unticked: with a fresh nonce for each signature, recovery is impossible. Failures like this can’t be seen from a dashboard. You find them by tracing where every key and every random number in a system comes from, which is the first thing a Math Break audit does.