https://github.com/iotexproject/iotex-address
The address library extracted from iotex-core.
https://github.com/iotexproject/iotex-address
Last synced: about 1 year ago
JSON representation
The address library extracted from iotex-core.
- Host: GitHub
- URL: https://github.com/iotexproject/iotex-address
- Owner: iotexproject
- License: apache-2.0
- Created: 2019-03-19T05:05:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T21:46:42.000Z (over 1 year ago)
- Last Synced: 2025-05-08T22:07:00.131Z (about 1 year ago)
- Language: Go
- Homepage: https://iotex.io
- Size: 44.9 KB
- Stars: 1
- Watchers: 15
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iotex-address
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:
1. Generating a random private key and the corresponding public key using secp256k1's elliptic curve;
2. 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);
3. Take the last 20 bytes as the payload (payload := hash[12:]), which is the byte representation of the address;
4. Apply [bech32](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) encoding on the payload and adding io prefix.