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.
Base58 A Base58 address can be obtained from the basecheck calculation of a Hex address. All Base58 addresses begin with T. For example:
Example of Hex and Base58 format conversion using tronweb:
### 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](🔗)
Create an account offline using the SDK, take TronWeb as an example:
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,