Base58Check
Base58Check Encoding
Bitcoin addresses are encoded using Base58Check:
data = version || payloadchecksum = SHA256(SHA256(data))[:4]address = Base58Encode(data || checksum)
Base58 alphabet:
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
Leading zero bytes in data || checksum are encoded as leading 1 characters.
Functions
func Base58CheckEncode(version byte, payload []byte) string
func Base58CheckDecode(addr string) (version byte, payload []byte, ok bool)
Notes
Base58CheckDecodereturnsok=falsefor invalid characters or checksum.- The decoded payload excludes the version byte and 4-byte checksum.
- If the decoded byte slice is shorter than 5 bytes (version + checksum), return
ok=false.
Run tests to see results
No issues detected