Skip to content

Aion Transaction Specifications

AionJayT edited this page Sep 11, 2020 · 1 revision

Introduction

Aion transaction define the format of the transaction specific git for the aion network. A transaction data doesn't fit the format will be rejected by the network(kernel).

AionTransaction src

A qualified Aion transaction must be satisfied these data field: 0.Nonce: The transaction index of the transaction sender. The nonce will start from 0 and will increase after the transaction has been processed in the aion network. The aion network will process transactions by the nonce in ascending order and in sequential.

  1. Destination (To): The destination of the transaction, it is an valid aion account address or an contract address.
  2. Value: The amount of AION the sender want to transfer to the destination address(or contract) in unit of nAmp. For example, if you want to transfer 1 AION to a recipient, you should assign 1000000000000000000(10^18) in this field. Once the transaction proceed successful, the sender's account balance will be removed the amount of the AION (also the energy charging, see below).
  3. Data: The additional data of the transaction, it can be a contract call and the arguments of the call or a comment of the transaction.
  4. Timestamp: the timestamp represent when does the transaction happen on the network(roughly). The timestamp is unit of micro-second. For example, if current time is 1599852392, you should assign 1599852392000000 into this field.
  5. Nrg (Gas): The energy is the maximum amount of energy consume allowed for this transaction. The are several constrains for setting up the limitation. The minimum of the energy for each transaction is 21K + the energy charge for storing the transaction data. For example, if you are just sending balance to the other accounts(with empty data), the energy charge will be 21K. The maximum amount of energy consume allowed for the transaction will be 5M if the transaction is a contract deployment, otherwise will be 2M. Any transaction assigned energy limit below the minimum or above the maximum will be rejected(not process) by the aion kernel.
  6. Nrgprice (Gas): The energy unit price of the sender would like to pay. The energy unit price between 10000000000(10^10) to 9000000000000000000(9 x 10^18) will be accepted by the aion network. The transaction with higher energy price has higher priority to be process on the network, especially when the network is congestion. If the transaction has been processed on the network, whatever success or fail. The sender of the transaction will be charged an amount equal to energy consumption of the transaction multiply the energy price. To know more details, you can see TxNrgRulesrc
  7. Type: The transaction type indicated how does the transaction be processed by the blockchain virtual machine. Currently the default type of the transaction is 1, type 2 is only using for deploying the AVM contract. Otherwise, the transaction will be rejected(not process) by the aion kernel. 8.Signature: The signature of the transaction,it will include the sender information and can use to verify the correctness and uniqueness of the transaction.
  8. Extension(optional): Currently you will need to assign '1' if you want to enable the beacon hash transaction.
  9. Beacon Hash(optional): The beacon hash can guaranteed the transaction will only be proceeded by the main chain and is invalid on the side chain, so it prevents the transaction been proceeded twice in the different chain of the network. To know more details, see BeaconHashValidatorsrc

Raw transaction data (Encoded aion transaction)

The tooling usually send the transaction by calling eth_sendRawTransaction. So the data of raw transaction is the aion transaction encoded by the aion rlpsrc and must be encoded in order(see the index of each field above). For more details, please see TxUtilsrc

Clone this wiki locally