This is the golang library of the address used in IoTeX blockchain and relatant products and services.
Address Generation Algorithm
A human readable address looks like io1nyjs526mnqcsx4twa7nptkg08eclsw5c2dywp4. It takes the following steps to be constructed:
Generating a random private key and the corresponding public key using secp256k1's elliptic curve;
Apply keccak256 hash function to the public key (hash := keccak256(pk[1:]), exluding the first byte (which indicates whether the public key is uncompressed or not);
Take the last 20 bytes as the payload (payload := hash[12:]), which is the byte representation of the address;
Apply bech32 encoding on the payload and adding io prefix.
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader.
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader.
Click to show internal directories.
Click to hide internal directories.
go.dev uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic. Learn more.