This page uses machine translation from English, which may contain errors or unclear language. For the most accurate information, please see the original English version. Some content may be in the original English due to frequent updates. Help us improve this page's translation by joining our effort on Crowdin. (Crowdin translation page, Contributing guide)
Basic
TxTypeLegacyTransaction
TxTypeLegacyTransaction represents a type of transactions existed previously in Kaia. Since this transaction type exists to support compatibility, it only works with EOAs associated with AccountKeyLegacy. EOAs associated with other account key types should use other transaction types such as TxTypeValueTransfer, TxTypeSmartContractExecution, and so on. This type of transaction can create an account, transfer tokens, deploy a smart contract, execute a smart contract, or perform a mix of aforementioned. This transaction type will initiate the following changes.
- The sender's balance decreases by the amount of the transaction fee.
- The sender's nonce increases by one.
- If
to
does not exist on Kaia, an EOA associated with AccountKeyLegacy is created. value
KAIA is transferred from the sender to the recipient.- If
to
is nil, it is regarded as a smart contract deployment transaction. The smart contract code must be passed asinput
. - If
to
is a smart contract, the smart contract function specified ininput
is executed.
Attributes
Attribute | Type | Description |
---|---|---|
value | *big.Int (Go) | The amount of KAIA in kei to be transferred. |
to | *common.Address (Go) | The account address that will receive the transferred value. |
input | []byte (Go) | Data attached to the transaction, used for transaction execution. |
v, r, s | *big.Int (Go) | The cryptographic signature generated by the sender to let the receiver obtain the sender's address. |
nonce | uint64 (Go) | A value used to uniquely identify a sender’s transaction. If two transactions with the same nonce are generated by a sender, only one is executed. |
gas | uint64 (Go) | The maximum amount of transaction fee the transaction is allowed to use. |
gasPrice | *big.Int (Go) | A multiplier to get how much the sender will pay in tokens. The amount of tokens the sender will pay is calculated via gas * gasPrice . For example, the sender will pay 10 KAIA for a transaction fee if gas is 10 and gasPrice is 10^18. See Unit of KAIA. |