Transactions

Transactions on the CosVM blockchain refer to actions initiated by an account that results in a change of the blockchain's state. These transactions are fundamental to interacting with and updating the blockchain's ledger. They involve the transfer of assets, execution of smart contracts, governance participation, and more. Understanding the lifecycle of a transaction is crucial to comprehend how data is added, validated, and committed to the CosVM blockchain.

Transaction Lifecycle in CosVM

1. Transaction Initiation

Transactions are initiated through various interfaces:

  • Command-Line Interface (CLI): Users can create transactions via CLI commands, specifying transaction types, arguments, and necessary configurations like gas prices.

  • gRPC or REST Interfaces: Transactions can also be created using these interfaces, enabling interaction via different entry points provided by application developers.

  • Web Wallets or Interfaces: Many users interact with transactions through web-based interfaces or wallets, where they create and sign transactions for execution on the network.

2. Gas and Fees

  • Gas Calculation: Gas represents computational resources consumed by transactions. The computation required for processing transactions determines the gas required, and fees are charged accordingly.

  • Fee Management: Users specify the gas limit, gas adjustment, gas prices, and total fees to be paid for transaction execution.

For further detail about the gas and fees follow this link.

3. Transaction Validation

  • Stateless and Stateful Checks: Transactions undergo stateless checks that do not access the state but ensure basic transaction validity. Stateful checks validate transactions based on the current committed state, ensuring sender authorization, sufficient funds, and other specific requirements. Transaction Signing: Transactions must be signed using the sender's private key, validating the transaction's authenticity.

4. Addition to Mempool

  • Mempool Validation: Upon receiving a transaction, full-nodes check for validity using the CheckTx ABCI message. Valid transactions are added to the node's Mempool, awaiting inclusion in a block.

5. Consensus and Block Inclusion

  • Block Proposal: Validator nodes propose blocks containing transactions from their mempools. Transactions need to be in the proposer's mempool to be included.

  • Consensus and Execution: Transactions in proposed blocks are executed by validator nodes during consensus, confirming their validity using ABCI requests.

  • State Transition: Execution of valid transactions results in state changes, committed to the blockchain through FinalizeBlock, confirming the transactions' execution.

6. Commitment to the Blockchain

  • Commit Process: Validator nodes commit the block after consensus by signing and confirming it. Once committed, state changes become permanent, and the transactions are appended to the blockchain.

Transaction Types:

CosmVM supports multiple transaction types catering to diverse needs:

Cosmos Transactions: These are native to the Cosmos SDK and allow for rich interactions with modules within the blockchain.

Ethereum Transactions: CosmVM uniquely integrates the Ethereum Virtual Machine (EVM), enabling users to execute Ethereum-style transactions and interact with existing dApps.

This is possible because CosVM uses the Cosmos-SDK and implements the Ethereum Virtual Machine as a module. In this way, CosVM provides the features and functionalities of Ethereum and Cosmos chains combined

Last updated