How to generate a new Ethereum address
They have different account systems on Bitcoin and Ethereum
Bitcoin and Ethereum are different design ideas for account systems. So their transaction systems are not the same.
Today, I will ignore Bitcoin and more explain about Ethereum.
- Bitcoin uses
Unspent Transaction Output
. - Ethereum uses the normal account system.
This article is very subjective. If you do not feel comfortable viewing it, please close it as soon as possible.
If you think my article can help you, you can subscribe to this site by using RSS.
What is the wallet’s address on the blockchain?
If you ask me what is the blockchain, I will say the blockchain looks like a simple account book. It records one line of transfer records. Every record least includes three elements:
- From where
- To where
- How much
In the blockchain world, the wallet address is an identity on transfer records.
If you have one wallet address, you could get a ticket to visit the blockchain world.
How to generate a wallet address on blockchain in English?
- Unlike the current account system of Web2, a blockchain wallet address is not registered. It is obtained through a series of complex encryption algorithms using a private key.
- A series of complex encryption algorithms used to generate the wallet address is public and fixed. This means that anyone can implement the method and generate the wallet address using any programming on any device at any time and no internet connection is required.
- Each unique private key corresponds to a unique wallet address.
- The private key is the only credential to operate the wallet.
- If you lost the private key, it can’t retrievable.
How to generate an Ethereum wallet address in code?
Ethereum has two account types:
- Externally owned – controlled by anyone with the private keys
- Contract – a smart contract deployed to the network, controlled by code.
Both account types can:
- Receive, hold and send ETH and tokens
- Interact with deployed smart contracts
The address format for both accounts is a 42-character hexadecimal string starting with 0x.
etc.
1 | 0x5e97870f263700f46aa00d967821199b9bc5a120 |
Ethereum wallet address generation principle
Private Key -> Public Key -> Address.
Therefore, address generation requires three steps:
Private Key -> Public Key -> Address.
Therefore, address generation requires three steps:
- Generate a random private key size of 64 hexadecimal characters. (256 bits / 32 bytes)
- Generate a public key from the private key via the Elliptic Curve Digital Signature Algorithm. (128 hexadecimal / 512 bits / 64 bytes)
- Get a 64-character string with the public key via the Keccak-256 hash function, and then take the last 40 characters as the address. (40 hexadecimal / 160 bits / 20bytes )
Command line generation method
First, install sha3sum
for keccak-256sum
.
https://github.com/maandree/sha3sum
1 | // on macOS |
1 | # Generate the private and public keys |
The code generation method on Go
1 | package main |
Now we have two easy ways to generate the Ethereum wallet address offline and have the private key.
Referrals
Photo by Georgi Srebrev on Unsplash
Generate Ethereum Private key, Public key, and Address using Bash and OpenSSL
How to generate a new Ethereum address
https://iiiyu.com/2022/08/02/How-to-generate-a-new-Ethereum-address/