Documentation
Chevron icon
Neo Blockchain Concepts
Chevron icon

Neo Blockchain Transactions

Apr 28, 2024 1:13:57 AM

Transactions on the Neo Blockchain

Transactions are instructions sent to the blockchain capable of altering its state. These transactions are validated, verified, and then added to the blockchain. Anyone can send these transactions, and if they follow the rules of the blockchain, they will be accepted and propagated to other network participants. Transactions contain scripts, which are the instructions that must be executed. To be considered valid, transactions must be structurally correct and must include a valid account for the payment of fees. Authenticity verification is done through digital signatures.

Transaction Structure

  • Version
    • Transaction version (currently 0).
  • Nonce
    • Random number to ensure uniqueness.
  • System Fees
    • Fees paid to use the network CPU and storage.
  • Network Fees
    • Long integer for validator packaging fee.
  • Valid Until Block
    • Block height after which the transaction can no longer be accepted.
  • Signers
    • List of accounts that signed the transaction and their respective scopes.
  • Attributes
    • Attributes that can be used to customize the transaction.
  • Script
    • Execution instructions, such as calling one or more smart contracts.
  • Witnesses
    • The signatures of the accounts that signed the transaction.

Transaction Fees

Fees are an important part of public and decentralized networks, as they prevent malicious actors from spamming the network.

Neo GAS Fees

On the Neo platform, transaction fees are paid using the GAS token. These GAS fees serve as essential components to balance transaction costs and inflation, thereby maintaining the economic stability of the network. Additionally, some of these fees are burned, effectively reducing the overall supply, while others are distributed among network participants, incentivizing them to contribute to the network’s well-being. Fees are divided into two categories: system fees and network fees.

System Fees

System fees cover the computational costs incurred during the execution of transactions. They relate to the CPU and storage resources consumed. These fees are calculated based on the complexity of the transaction, with various factors like CPU usage and storage requirements factored into the final amount. System fees are burned, reducing the overall supply of GAS.

Network Fees

Network fees relate to the ordering and prioritization of transactions within a block. In times of heavy network load, network fees can be dynamically adjusted to manage the transaction queue effectively. By doing so, the Neo blockchain ensures that transactions are handled in a timely manner, even during periods of high network activity. Network fees are distributed to consensus nodes, incentivizing them to maintain the network.

Signers and Witnesses

Signers and Witnesses are used to validate and verify transactions. The signers represent the accounts that signed the transaction, while the witnesses contain instructions to validate the transaction. At least one signer is needed, but multiple signers can be used to create multi-signature transactions. Neo supports different types of signature scopes, allowing for flexible transaction management and control.

Transactions Scripts

This is the core part of a transaction and contains instructions that must be executed. These instructions are not passed directly to any smart-contract but executed by the blockchain itself, executing each step in the script. The steps can include calling one or more smart-contracts.

Transaction scripts are created off-chain and then sent to the blockchain for execution.

Transactions can be created using off-chain SDKs made by the Neo community. These SDKs allow developers to create transactions using familiar programming languages like C#, Python, Java, and Go.

Check the Neo Blockchain Developer Guides to learn more about creating transactions.