You can generate an offline keypair, which includes an address and a private key, that will not be recorded by TRON. The user address generation algorithm is as follows:
- Generate a key pair and extract the public key (a 64-byte byte array representing its x,y coordinates).
- Hash the public key using sha3-256 function and extract the last 20 bytes of the result.
- Add 41 to the beginning of the byte array. Length of the initial address should be 21 bytes.
- Hash the address twice using sha256 function and take the first 4 bytes as verification code.
- Add the verification code to the end of the initial address and get an address in base58check format through base58 encoding.
- An encoded Mainnet address begins with T and is 34 bytes in length.
Please note: the sha3 protocol adopted is KECCAK-256.
View the Java code demo for user address generation.
To make this key pair an account in the TRON network, you need to call one of the following three APIs with an account already existing in the TRON network:
- Directly call the Create Account API
- Transfer TRX to the new address
- Transfer any kind of token to the new address
After the transaction is confirmed by the network, you can query the information of the account that matches the address in the TRON network. Creating an account burns 0.1 TRX from the creator, or consumes the bandwidth acquired by freezing.