TRON uses an account model. The address is the unique identifier of an account, and a private key signature is required to operate an account. An account has many attributes, including TRX & TRC10 token balances, bandwidth, energy, Etc. An account can send transactions to increase or reduce its TRX or TRC10 token balances, deploy smart contracts, and trigger the smart contracts released by itself or others. All TRON accounts can apply to be Super Representatives or vote for the elected Super Representatives. Accounts are the basis of all activities on TRON.

Account Type

TRON has two account types::

  • General account - that is to say externally-owned account,controlled by anyone with the private key
  • Contract account - a smart contract deployed on the TRON network and controlled by code. No one owns the private key of the contract accounts.

Both account types have the ability to::

  • Receive, hold, and send TRX or tokens
  • Interact with deployed smart contracts

Account & Key Pair

An account is made up of a cryptographic pair of keys: public key and private key. The public key can be mapped to an address, while the private key is used to sign transactions. This key pair help prove that a transaction was actually signed by the sender and prevent forgeries.

This prevents malicious actors from broadcasting fake transactions because you can always verify the sender of a transaction.

For example, when Alice wants to send TRX from her account to Bob's, she needs to create a transaction and send it to the TRON network for verification. With the key pair, Alice can prove that she originally initiated the transaction request. Without the encryption mechanism, malicious actor Eve might be able to publicly broadcast a similar request, "send 5 TRX from Alice's account to Eve's account", while no one can validate whether or not the transaction is requested by Alice herself.

External Account Creation

A variety of libraries and tools are available to create an account, they will generate a random private key composed of 64 hex characters. The public key is generated from the private key using the Elliptic Curve Digital Signature Algorithm (ECDSA). The account address can then be calculated based on the public key.

Account Address Format

There are two formats for TRON account addresses: Hex and Base58.

  • Hex
    The public key P as the input, and use SHA3 to get the result H. Get the last 20 bytes of H, and add a byte of 0x41 as a prefix. That is the Hex format address.

    418840E6C55B9ADA326D211D818C34A994AECED808
    
  • Base58
    A Base58 address can be obtained from the basecheck calculation of a Hex address. All Base58 addresses begin with T. For example:

    TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
    

    Example of Hex and Base58 format conversion using tronweb:

    tronWeb.address.toHex("TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL")
    > "418840E6C55B9ADA326D211D818C34A994AECED808"
    
    tronWeb.address.fromHex("418840E6C55B9ADA326D211D818C34A994AECED808")
    > "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"
    

Ways to Create Accounts

Users can create an account by the following ways. That is to generate a private key and the corresponding address.

  • Create an account offline using the command line wallet wallet-cli

    wallet> GenerateAddress
    {
        "address": "TU6JdEDQGPus64LTMksvnxF2cv4FQrXPCa",
        "privateKey": "b1ba1db577a36421924a87026cda27523851c6e88123d0a0a1def9a974376176"
    }
    
  • Create an account offline using the SDK, take TronWeb as an example:

    tronWeb.createAccount()
    > address:
    {
        base58: "TDpBe64DqirkKWj6HWuR1pWgmnhw2wDacE"
        hex: "412A2B9F7641D0750C1E822D0E49EF765C8106524B"
        privateKey: "427139B43028A492E2705BCC9C64172392B8DB59F3BA1AEDAE41C88924960091"
        publicKey:"0404B604296010A55D40000B798EE8454ECCC1F8900E70B1ADF47C9887625D8BAE3866351A6FA0B5370623268410D33D345F63344121455849C9C28F9389ED9731"
    }
    
  • Create a private key and an address using the wallet application

Account Activation

Newly created accounts do not exist on the chain, and need to be activated before they can be found via API queries or on blockchain explorer. Accounts can be activated by the following two ways:

  • Send any amount of TRX or TRC-10 tokens from an existing account to the new account;
  • Call Java-tron's wallet/createaccount api to create a transaction from an existing account, then sign the transaction, and broadcast it to the TRON network.

An account creation fee of 1 TRX is charged to activate a new account. Besides that, If the sender of the above two transactions has enough Bandwidth obtained by staking TRX, then creating an account will only consume bandwidth , otherwise, 0.1 TRX will be burned to pay for the bandwidth.

Alternatively, transferring TRX or TRC-10 tokens to an inactive account address in smart contract can also complete the activation of the account. In addition to the bandwidth and energy consumed by normal contract calls, this way will only consume an additional 25,000 energy, and will not consume the 1 TRX account creation fee and the 0.1 TRX bandwidth fee.

Contract Account

When the smart contract is deployed to the TRON network, the corresponding contract account address is returned, which is calculated from the ID of the deployed contract transaction and the sender's account address. The format of contract account address is the same as that of external accounts : hex or Base58. For example,

Hex: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
Base58: 41A614F803B6FD780986A42C78EC9C7F77E6DED13C