Can you find my Bitcoins?
On a few occasions, I have been asked to find someone’s Bitcoins, and where I had to explain that there are not actually stored anywhere, and that the ownership of the coins is just defined by ledger entries on the Bitcoin blockchain. At the core of the ownership (and transfer) of the coins is the ownership of a private key which can reassign the ownership of the coins.
Another question I was once asked, is “What if someone generates the same address as me? What should I do”?
So let’s look at these special keys, and try and understand their format and usage.
Bitcoins use Elliptic Curve cryptography with 32 byte private keys (which is a random number) and 64 byte public keys, and use the secp256k1 curve. A private key is a 32-byte number chosen at random, and you know that 32 bytes make for a very large number. In the following we create a random number on an elliptic curve and then generate the public key [here]:
-BEGIN EC PARAMETERS — — —
BgUrgQQACg==
— — -END EC PARAMETERS — — —
— — -BEGIN EC PRIVATE KEY — — — MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAK oUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJ l1M4HncqEopYIKkkovoFFi62Yph6nw==
— — -END EC PRIVATE KEY — — — Private-Key: (256 bit) priv: 00:85:75:39:af:fe:80:30:2d:cb:1d:21:db:6e:46…