Foundations · Blockchain
Transactions
A blockchain transaction is a signed instruction, such as a transfer of value, that is broadcast to the network, checked by nodes and recorded in the ledger once it is in a block, and increasingly hard to reverse.
Why it matters
A transaction is the only way anything changes on a blockchain. Sending coins, swapping tokens, voting in a protocol and deploying a program are all transactions. Knowing what one contains, and the stages it passes through, explains why transfers are irreversible, why they sometimes wait, and why signing one deserves care.
How it works
- Create and signThe wallet signs with the private key.
- BroadcastSent to nodes on the network.
- Wait in the mempoolA queue of unconfirmed transactions.
- Included in a blockA miner or validator adds it.
- ConfirmationsEach new block makes reversal harder.
A transaction is a message that says, in effect, “the owner of this address authorises this change”. It travels through four stages.
- Create and sign. A wallet builds the message and signs it with the sender’s private key. The signature proves the owner approved these exact details, without revealing the key. See signing transactions.
- Broadcast. The wallet sends the signed message to a node, which passes it to others. Within seconds most of the network has seen it. Valid transactions wait in a holding area usually called the mempool.
- Inclusion. A miner or validator selects waiting transactions, usually favouring higher fees, and places them in a block.
- Confirmation. Each further block built on top makes the transaction harder to reverse, until it is treated as final.
In plain words
Sending a transaction is like posting a signed cheque into a glass box in a public square. Everyone can see it and check the signature. A clerk empties the box at intervals and enters the cheques in a ledger that is never erased. Once yours is entered, it cannot be taken back.
What a transaction contains
Every node checks a transaction independently before accepting it:
- the signature is valid for the sending address;
- the sender has enough balance for the amount and the fee;
- the sequence number is the next one expected;
- the transaction follows the network’s format and limits.
A transaction that fails any check is dropped and never enters a block.
Each transaction has an identifier, the transaction hash or transaction ID, which is the hash of its contents. Anyone can look it up in a public tool called a block explorer to see its status.
Pending, included, final
| Aspect | What it means | Can it still change? |
|---|---|---|
| Pending | Broadcast and waiting. Not yet part of the ledger. | Yes. It may wait, be replaced or be dropped. |
| Included | Recorded in a block. | Rarely. A recent block can be reorganised. |
| Final | Buried deep enough, or explicitly finalised. | Practically no. |
A pending transaction is a request, not a fact. If its fee is too low for current demand, it may wait a long time or eventually be dropped. Fees are explained in gas and network fees, and the waiting area in mempool and confirmations.
Inclusion in a block is the moment the transaction becomes part of the ledger. How long until it counts as irreversible depends on the chain, and is the subject of finality and throughput.
Going deeper
ACCOUNT MODEL
Each address has a running balance.
- A transfer lowers one balance and raises another
- A counter orders each account's transactions
- Used by Ethereum and similar chains
UTXO MODEL
The ledger tracks unspent pieces of coin.
- A transfer consumes pieces and creates new ones
- Change is returned as a new piece
- Used by Bitcoin
Two bookkeeping models. Ethereum-style chains keep a balance per account. Bitcoin tracks individual unspent outputs, explained in the UTXO model. The difference affects fees, privacy and how wallets work, but the stages above are the same.
Transactions that call programs. On smart-contract chains, a transaction can carry instructions for a contract. The visible “amount” may be zero while the instructions move tokens or grant permissions. What a transaction does is determined by its data, not by its headline amount.
Failed is not the same as free. On Ethereum-style chains, a transaction can be included in a block and still fail, for example if a contract’s conditions are not met. Its effects are undone, and the fee for the work performed is still charged.
No reversal. There is no chargeback. A transfer to a wrong or mistyped address, or to a fraudster, is as valid to the network as any other. Practical precautions are covered in addresses and sending safely.
An account-model transferHypothetical illustration
Hypothetical numbers. Leo’s address holds 10.000 units of a coin, and his next sequence number is 7. He sends 3 units to Mia with a fee of 0.002.
- The wallet builds: from Leo, to Mia, amount 3, fee 0.002, sequence 7. It signs the message.
- Nodes check the signature, check that 10.000 is at least 3.002, and check that 7 is the expected number.
- The transaction is included in a block.
- Leo’s balance: 10.000 minus 3 minus 0.002 = 6.998. His next sequence number is 8.
- Mia’s balance rises by 3.
If someone copies the signed message and broadcasts it again, nodes reject it: sequence 7 has been used. If Leo had typed one wrong character in Mia’s address, the 3 units would have gone to whatever address he typed.
What it does NOT mean
- “Sent” does not mean received. A broadcast transaction is pending until it is in a block.
- One confirmation is not finality. Recent blocks can occasionally be replaced.
- A valid transaction is not a correct one. The network checks signatures and balances, not intentions.
- A transaction hash is not proof of payment to a person. It shows a transfer to an address.
- An address is not an identity, and it is not private. Its full history is public.
Common misunderstandings
- Expecting someone to cancel or refund a transfer. No party has that power on a public chain.
- Reading only the amount. A contract call with a zero amount can still move assets.
- Assuming a pending transaction will go through. A low fee can leave it waiting indefinitely.
- Sending on the wrong network. The same address format can exist on several chains that do not share balances.
Risks and limits
- Errors in the address, network or amount are usually permanent.
- Signing a malicious transaction authorises whatever it contains.
- Fees and waiting times change with demand.
- Recent transactions carry a small risk of being reorganised out of the chain.
- Transaction history is permanently public.
Key takeaway
A transaction is a signed instruction that the network checks, includes in a block and then treats as increasingly irreversible. The network verifies that it is authorised and valid, never that it is what the sender meant.
Sources and further reading
- Mastering Bitcoin, Andreas M. Antonopoulos. Chapters on transactions and on how they are propagated and confirmed
- Mastering Ethereum, Andreas M. Antonopoulos and Gavin Wood. Chapter on transactions, including nonces and gas
- Transactions (opens in a new tab), ethereum.org. Transactions are signed instructions from accounts; covers the nonce, signature and gas fields