Get a wallet, the mathematical way:
- Install Geth (for verification)
- Install keccak256, depends on your system. Check this. If you are having a hard time you can use this online generator.
Some amazing mathematics underlies a lot of the special abilities that are now possible to do with the world of Web3. Although you don’t need to understand it to be able to use it, the reason I am including this here is that it’s imperative to intuit how it all works without central servers managing the addresses. And because learning is awesome!
For ethereum, you are using the features of beautiful graph:
to generate a public/private key pair. A keypair allows you to share secret messages with people online and also to prove that you intended to sign digital files. This lies at the heart of decentralized tech and we want to be sure that you don’t miss out on understanding it. Ethereum’s addresses are derived by taking a hash of the public key. A hash is a function that creates a unique fixed length string from various inputs.
If you’re looking for step by step code you can cut/paste into your terminal, check this out:
# Generate the private and public keys openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > Key # Extract the public key and remove the EC prefix 0x04 cat Key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub # Extract the private key and remove the leading zero byte cat Key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv # Generate the hash and take the address part cat pub | keccak-256sum -x -l | tr -d ' -' | tail -c 41 > address # (Optional) import the private key to geth geth account import priv
If you’d like to nerd out a little more on how you can create a one way function from the elliptic curve above, read this amazing break down. It is also where I shared the step by step RSA example.