Member-only story
The Basics of Ethereum Keys, IDs and Signatures
Node.js is a great advancement in creating back-end code. So, let’s use it to understand how Ethereum uses its keys and signs for messages. Overall, we use public-key encryption and which uses the elliptic curve that Satoshi Nakamoto selected for Bitcoin: secp256k1. With this, we have a random private key of 32 bytes (256 bits). If we run our local blockchain with Ganache, it will show us a number of account addresses:
This is a public identifier for each user. Underneath this is a private key, and which should not be exposed to anyone:
This private key is used to sign for transactions and has an associated public key. The conversion of the private address to a public address is to perform an ECDSA signature, and then take a hash of this with Keccak-256. The address is the first 40 bytes of this signature:
