Tron Base58Check address codec.
Tron mainnet addresses are a 0x41-prefixed 21-byte payload encoded as
Base58Check: Base58(payload <> first4(sha256(sha256(payload)))), which always
renders with a leading T. This module validates such addresses and converts
between the Base58 form and the 0x41-prefixed hex form the chain uses
internally, so the Relay client can reject malformed Tron addresses before any
network call.
This is not the EVM 0x-20-byte form; a Tron address carries the extra 0x41
network prefix and a checksum.
Summary
Functions
Convert a 0x41-prefixed hex address (with or without the 0x) to its
Base58Check Tron form.
Convert a Base58Check Tron address to its 0x41-prefixed hex form (42 hex
chars). Returns {:error, :invalid_address} for malformed input.
True when address is a well-formed Tron mainnet Base58Check address.
Types
@type t() :: String.t()
Functions
Convert a 0x41-prefixed hex address (with or without the 0x) to its
Base58Check Tron form.
Convert a Base58Check Tron address to its 0x41-prefixed hex form (42 hex
chars). Returns {:error, :invalid_address} for malformed input.
True when address is a well-formed Tron mainnet Base58Check address.