145

Recently this article came to my attention that is way more in depth and technical than my more accessible version below. It also walks you through how to generate one on your own. I highly recommend it: https://kobl.one/blog/create-full-ethereum-keypair-and-address/ From the Yellow Paper There are three main steps to get from private -> address: Create ...


8

Ethereum addresses are hashes of a public key. So to generate one you have to generate a private key first (see: What is the approach to calculate an Ethereum address from a 256 bit private key?) The private key is random but the public key and thus its hash used as the address is not random. To check an address, and thus know the format, refer to How can I ...


4

Private Key Space: Here are some code examples, based on the elliptic curve secp256k1 used by ethereum, as others have noted in order for the 256-bit key to be valid, it must be smaller than the curve's parameter n which is also a 256-bit value which can be written in hexadecimal format as: 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 ...


1

If anyone is looking for a JS solution: const Web3 = require('web3') const web3 = new Web3() const elliptic = require('elliptic') const ec = new elliptic.ec('secp256k1') function pubKeyToAddress(compressedPubkey) { let keyPair = ec.keyFromPublic(compressedPubkey, 'hex') // remove '04' then add prefix '0x' let pubkey = '0x' + keyPair.getPublic(false, '...


Only top voted, non community-wiki answers of a minimum length are eligible