A blockchain transaction is the process of transferring value or executing operations on a blockchain network where each transaction is cryptographically recorded on a distributed ledger. Transactions can represent financial transfers, smart contract executions, or other state changes.
How do transactions work?
Blockchain transactions operate through a series of cryptographic processes and network-wide verification steps. Here is an explanation of how transactions work, using Bitcoin as an example.
Initiating the transaction: Alice creates a transaction to send 1 Bitcoin to Bob, specifying the amount, Bob's public address, and a transaction fee.
Signing the transaction: Alice's wallet signs the transaction with her private key, generating a digital signature that proves ownership without revealing the key.
Broadcasting the transaction: The signed transaction is sent to multiple network nodes, which verify that Alice has funds to spend and that the signature is valid. Valid transactions enter the mempool.
Transaction validation: Miners select transactions from the mempool and compete to solve a cryptographic puzzle. A successful miner proposes a new block containing these transactions. Other nodes verify that the block follows network rules before accepting it.
Confirmation: The new block is added to the blockchain, giving the transaction its first confirmation. Subsequent blocks built on top (typically 3-6 in Bitcoin) make the transaction increasingly secure.
Completion: Given that it takes about ten minutes to receive a confirmation, the transaction will reach completion in 30 - 60 minutes and become part of the immutable ledger (3-6 blocks x 10min per confirmation). Bob gains access to the 1 BTC, and the network ledger reflects the new ownership state.
What do transactions consist of?
Different blockchain platforms implement transactions with varying structures and components based on their design philosophy and technical architecture.
Solana
Transactions on the Solana network consist of one or more instructions, each specifying an operation to be executed. These instructions are interpreted by on-chain programs, with each program defining a unique set of executable instructions.
For example, Solana accounts that are referred to as "wallets" are controlled by the System Program. Since only the program owner can modify an account’s state, transferring SOL—such as sending 5 SOL to another account—necessitates invoking the System Program through a transaction.
The sender must sign the transaction (is_signer), authorizing the deduction from their balance. Both sender and recipient accounts must also be designated as writable (is_writable), ensuring correct updates to their respective balances. Once submitted, the System Program executes the transfer instruction, deducting 5 SOL from the sender and crediting it to the recipient.
Signatures: An array of cryptographic signatures that authorize the transaction.
Message: A structured set of instructions executed as a single atomic unit (all instructions process successfully, or the entire transaction fails).
Message header: Defines the number of signing accounts and read-only accounts.
Account addresses: A list of accounts referenced by the transaction’s instructions.
Recent blockhash: Serves as a transaction timestamp to ensure timely processing.
Instructions: A sequence of operations specifying program interactions.
Ethereum
On Ethereum, a transaction contains several fields that define its purpose and execution parameters. These fields are interpreted by the Ethereum Virtual Machine (EVM) to execute the desired operations.
Sender’s address: The externally owned account (EOA) initiating the transaction, which must sign it.
Receiver’s address: The address that will receive the initiated transaction. This could be another EOA or a smart contract.
Signature: A cryptographic identifier created using the sender’s private key, verifying transaction authenticity.
Nonce: A sequential counter representing the number of transactions sent from the sender’s account.
Value: The amount of ETH transferred, measured in WEI (1 WEI = 1e-18 ETH).
Input data: An optional field used to store additional data, typically for contract interactions.
Gas limit: The maximum computational effort the transaction is allowed to consume, as defined by the EVM.
Max priority fee per gas: The maximum tip a sender is willing to pay a validator.
Max fee per gas: The total maximum fee per gas unit, encompassing both the base fee and the priority fee.
Types of transactions
Peer-to-peer (P2P) transactions: Direct asset transfers between users, such as sending ETH on Ethereum or BTC on Bitcoin.
Smart contract transactions: Execute predefined logic within smart contracts, like token swaps on Uniswap or NFT minting on OpenSea.
Contract Deployment Transactions: Deploy new smart contracts, such as creating an ERC-20 token on Ethereum.
How to verify transactions
Blockchain explorers allow users to track and verify transactions by providing real-time, blockchain data. These tools display transaction status, sender and recipient addresses, fees, block confirmations, and more.
Searches can be completed by using a transaction hash, wallet address, block number, or token name.