Skip to main content

How Blockchain Works: Step-by-Step Explanation

Understanding how blockchain works requires following a transaction from inception to final confirmation. While the underlying technology involves sophisticated cryptography and distributed systems engineering, the core process is elegant in its simplicity: transactions are created, broadcast, verified, grouped into blocks, and permanently recorded on a shared ledger.

This guide walks through each step of the blockchain process using Bitcoin as the primary example, while noting where other blockchains like Ethereum differ. By the end, you will understand exactly what happens from the moment you click "Send" to the moment your transaction becomes an irreversible part of the blockchain.

Step 1: Transaction Creation

Every blockchain interaction begins with creating a transaction. When you decide to send cryptocurrency, your wallet software constructs a transaction message containing several pieces of information.

Transaction Inputs and Outputs

Bitcoin uses an Unspent Transaction Output (UTXO) model. Think of UTXOs as digital bills in your wallet. If you have received 0.5 BTC and 0.3 BTC in two separate transactions, you have two UTXOs totaling 0.8 BTC. When you want to send 0.6 BTC, your wallet:

  1. Selects UTXOs that together cover the amount (0.5 + 0.3 = 0.8 BTC).
  2. Creates a transaction with the recipient's address as one output (0.6 BTC).
  3. Creates a change output back to your own address (0.2 BTC minus the transaction fee).
  4. The selected UTXOs become "spent" and the new outputs become new UTXOs.

Ethereum uses a different account-based model, more similar to a traditional bank account. Each address has a balance, and transactions simply debit the sender and credit the receiver.

Digital Signing

Before a transaction can be broadcast, it must be signed with the sender's private key. This is where the security of your seed phrase becomes critical — your private key is derived from your seed phrase, and anyone who possesses it can sign transactions on your behalf.

The signing process works as follows:

  1. The transaction data is hashed using SHA-256 (Bitcoin) or Keccak-256 (Ethereum).
  2. The hash is signed using the sender's private key via the ECDSA algorithm.
  3. The resulting digital signature is appended to the transaction.
  4. Anyone can verify the signature using the sender's public key, confirming that the transaction was authorized by the key holder without ever needing to see the private key itself.

This is a fundamental principle: signing proves ownership. Your private key never leaves your device during this process. Only the signature — which cannot be used to reverse-engineer the private key — is shared with the network.

Step 2: Transaction Broadcasting

Once signed, the transaction is broadcast to the blockchain network. Your wallet connects to one or more nodes (computers running the blockchain software) and sends the transaction data.

Peer-to-Peer Propagation

Blockchain networks operate on a peer-to-peer (P2P) topology. There is no central server. When a node receives your transaction, it performs initial validation checks and, if valid, relays it to its connected peers. Those peers validate and relay further. Within seconds, your transaction propagates across the entire network — typically reaching the majority of nodes within 2 to 15 seconds.

The Mempool

After propagation, your transaction enters the mempool (memory pool) — a waiting area of unconfirmed transactions maintained by each node. The mempool is not a single shared pool; each node maintains its own version, which may differ slightly due to network latency and individual node policies.

Transactions in the mempool are ranked primarily by fee rate (satoshis per byte in Bitcoin, or gas price in Ethereum). Miners and validators select the highest-fee transactions first, as this maximizes their revenue. During periods of high network demand, the mempool can grow significantly, and low-fee transactions may wait hours or even days for confirmation.

Transaction Fees

Transaction fees serve two purposes:

  1. Incentivize miners/validators to include your transaction in a block.
  2. Prevent spam by making it costly to flood the network with meaningless transactions.

In Bitcoin, fees are calculated based on the transaction's size in bytes (not the amount being sent). A transaction sending 10 BTC may cost the same fee as one sending 0.001 BTC if they are the same byte size.

In Ethereum, fees follow the EIP-1559 model with a base fee (burned) and a priority tip (paid to the validator). The base fee adjusts dynamically based on network congestion.

Step 3: Transaction Validation

Before a transaction can be included in a block, nodes independently validate it against the protocol's rules. This validation is critical to maintaining the integrity of the blockchain.

Validation Checks

Each node performs multiple checks on every transaction it receives:

  • Syntactic validity: Is the transaction properly formatted according to the protocol specification?
  • Signature verification: Does the digital signature match the sender's public key? This confirms the transaction was authorized by the private key holder.
  • Double-spend check: Are the referenced UTXOs (Bitcoin) still unspent, or does the account (Ethereum) have sufficient balance?
  • Script validation: Do the locking and unlocking scripts execute correctly? (Bitcoin uses a scripting language called Script to define spending conditions.)
  • Fee adequacy: Does the transaction include a sufficient fee to meet the node's minimum relay threshold?
  • Size limits: Does the transaction fall within the protocol's size constraints?

If a transaction fails any of these checks, it is rejected and not relayed to other nodes. This decentralized validation is what makes blockchain resistant to fraudulent transactions — every node independently verifies every transaction against the same set of rules.

Step 4: Block Construction

Miners (in proof-of-work systems) or validators (in proof-of-stake systems) collect validated transactions from the mempool and assemble them into a candidate block.

Block Structure

A typical block contains:

Block Header:

  • Version: The protocol version.
  • Previous block hash: The SHA-256 hash of the preceding block's header. This is what creates the "chain" in blockchain.
  • Merkle root: A single hash summarizing all transactions in the block.
  • Timestamp: The approximate time the block was created.
  • Difficulty target (PoW): The threshold that the block hash must be below for the block to be valid.
  • Nonce (PoW): A counter that miners increment while searching for a valid hash.

Block Body:

  • Transaction count: The number of transactions included.
  • Transaction list: The actual transaction data.
  • Coinbase transaction: A special first transaction that creates new coins as the block reward and collects all transaction fees. This is the only transaction in a block that has no inputs — it creates new currency from nothing, according to the protocol's issuance schedule.

Transaction Selection

Miners typically select transactions to maximize revenue, prioritizing those with the highest fee rates. However, they must also respect the block size limit (4 MB block weight in Bitcoin) or block gas limit (approximately 30 million gas in Ethereum). This creates a natural market for block space — during high demand, users compete by offering higher fees.

Some miners may have additional policies, such as including certain types of transactions regardless of fees or excluding transactions that interact with sanctioned addresses.

Merkle Tree Construction

The Merkle tree is built by repeatedly hashing pairs of transaction hashes:

  1. Each transaction is hashed individually.
  2. Adjacent hashes are paired and hashed together.
  3. This process repeats up the tree until a single hash remains: the Merkle root.

The Merkle root provides a compact summary of all transactions. If any transaction is altered, the Merkle root changes, immediately revealing the tampering. This structure also enables Simplified Payment Verification (SPV), where lightweight clients can verify transaction inclusion without downloading full blocks.

Step 5: Consensus and Block Production

The candidate block must go through the network's consensus mechanism to be accepted by the network. This is where different blockchains diverge significantly.

Proof of Work (Bitcoin)

In proof-of-work, miners compete to find a nonce value that, when combined with the block header data and hashed, produces a hash below the network's difficulty target. This is essentially a brute-force search:

  1. The miner constructs the block header with all required fields.
  2. The miner hashes the header using SHA-256 (applied twice in Bitcoin).
  3. If the resulting hash is below the difficulty target, the block is valid.
  4. If not, the miner increments the nonce and tries again.
  5. This process repeats billions of times per second across all miners.

The difficulty target adjusts every 2,016 blocks (approximately two weeks) to maintain an average block time of 10 minutes, regardless of how much total mining power is on the network.

When a miner finds a valid hash, they have solved the "puzzle" and can broadcast their block to the network. The first miner to find a valid solution wins the block reward (currently 3.125 BTC after the April 2024 halving) plus all transaction fees in the block.

Proof of Stake (Ethereum)

Ethereum uses proof of stake, where validators are randomly selected to propose blocks based on the amount of ETH they have staked (locked as collateral). The process is fundamentally different:

  1. A validator is pseudo-randomly selected to propose a block for each 12-second slot.
  2. The proposer creates a block and broadcasts it.
  3. A committee of validators attests (votes) that the block is valid.
  4. Once sufficient attestations are gathered, the block is considered justified and eventually finalized.

Proof of stake eliminates the energy-intensive hash computation of proof of work while still maintaining security through economic incentives — validators risk losing their staked ETH (slashing) if they act maliciously.

For a deeper comparison, see our guide on Consensus Mechanisms.

Step 6: Block Propagation

Once a valid block is produced, it must be distributed across the network.

Network Propagation

The successful miner or validator broadcasts the new block to its peers, which validate the block and relay it further. Block propagation typically takes 1 to 10 seconds to reach the majority of the network, depending on the block size and network conditions.

Compact Block Relay (BIP 152)

Bitcoin uses Compact Block Relay to speed up propagation. Since most nodes already have the transactions in their mempools, the new block only needs to transmit a compact summary (short transaction IDs) rather than full transaction data. Nodes can reconstruct the full block from their mempool, reducing bandwidth requirements by approximately 90%.

Orphan Blocks

Occasionally, two miners find valid blocks at nearly the same time, creating a temporary fork. The network resolves this naturally: whichever chain receives the next block first becomes the longest chain, and the other block becomes an orphan (or stale block). Transactions in the orphan block are returned to the mempool and typically included in the next block on the winning chain.

Step 7: Block Validation and Chain Extension

When a node receives a new block, it independently validates the entire block before accepting it.

Full Validation

Nodes verify:

  • Block header validity: Correct format, valid previous block hash, proof of work meets the difficulty target (or valid validator signature in PoS).
  • Transaction validity: Every transaction in the block passes the same validation checks described in Step 3.
  • Merkle root consistency: The computed Merkle root matches the one in the block header.
  • Block size/weight: The block does not exceed protocol limits.
  • Coinbase validity: The block reward and fee collection are correct according to the current protocol rules.
  • Timestamp range: The block timestamp falls within acceptable bounds.

If all checks pass, the node adds the block to its local copy of the blockchain and updates its UTXO set (or state trie in Ethereum). The node then relays the block to its peers.

Step 8: Transaction Confirmation

Once your transaction is included in a valid block, it has received its first confirmation. Each subsequent block added on top of your transaction's block adds another confirmation.

Why Multiple Confirmations Matter

A single confirmation means your transaction is in the blockchain, but the block could theoretically be orphaned if a competing chain overtakes it. Each additional confirmation makes reorganization exponentially less likely:

ConfirmationsBitcoin Wait TimeSecurity Level
0 (unconfirmed)Vulnerable to double-spend
1~10 minutesSuitable for small amounts
3~30 minutesReasonable security
6~60 minutesStandard for significant amounts
12+~2 hoursVery high security

The commonly cited standard of 6 confirmations for Bitcoin means the probability of a successful chain reorganization (and thus a double-spend) is astronomically low — it would require an attacker to control more than 50% of the network's hash power and sustain it for over an hour.

Ethereum provides faster finality. Under normal conditions, a transaction reaches finality (cannot be reversed without burning at least one-third of all staked ETH) within approximately 12 to 15 minutes.

Finality Types

  • Probabilistic finality (Bitcoin): Transactions become increasingly difficult to reverse with each confirmation, but there is no absolute point of irreversibility. Six confirmations is the widely accepted practical threshold.
  • Economic finality (Ethereum PoS): After finalization, reversing a transaction would require burning billions of dollars worth of staked ETH — economically irrational for any attacker.
  • Absolute finality (some BFT-based chains): Transactions are irreversible immediately upon block confirmation. Chains like Tendermint-based networks provide this property.

The Complete Picture: A Transaction's Journey

To summarize the entire lifecycle:

  1. You initiate a transfer from your wallet.
  2. Your wallet constructs the transaction, selecting inputs and outputs (UTXO) or specifying the transfer amount (account model).
  3. Your private key signs the transaction, proving you authorized it.
  4. The signed transaction is broadcast to the P2P network.
  5. Nodes validate the transaction and add it to their mempool.
  6. A miner/validator selects your transaction from the mempool and includes it in a candidate block.
  7. The block is produced through proof of work or proof of stake.
  8. The new block propagates across the network.
  9. Nodes validate and accept the block, extending the chain.
  10. Your transaction gains confirmations as new blocks are built on top of it.

This entire process — from creation to first confirmation — takes approximately 10 minutes for Bitcoin and 12 seconds for Ethereum, though your transaction may spend additional time in the mempool waiting to be selected.

SafeSeed Tool

Your transaction's security begins with your keys. Use the SafeSeed Seed Phrase Generator to create a cryptographically secure BIP-39 seed phrase. Every step in the blockchain process — from signing transactions to proving ownership — depends on the security of your private keys, which are derived from your seed phrase.

Advanced Concepts

Transaction Malleability

In early Bitcoin versions, it was possible to modify a transaction's ID (txid) without invalidating it — a property called transaction malleability. This was largely resolved by the Segregated Witness (SegWit) upgrade in 2017, which separates signature data from transaction data, ensuring that the txid cannot be altered after signing.

Replace-By-Fee (RBF)

Bitcoin supports Replace-By-Fee, allowing a sender to resubmit a transaction with a higher fee to speed up confirmation. The new transaction replaces the original in the mempool. This is useful when the network is congested and your original fee was too low. Wallets that support RBF flag transactions as replaceable, and the higher-fee version takes priority.

Transaction Batching

Exchanges and large senders often batch multiple payments into a single transaction with multiple outputs. This is more space-efficient than sending individual transactions, reducing overall fees and block space usage.

FAQ

How long does a blockchain transaction take?

Transaction time varies by blockchain. Bitcoin averages one block every 10 minutes, but your transaction may wait in the mempool before being included. Ethereum produces blocks every 12 seconds. Layer 2 solutions like the Lightning Network can settle payments in milliseconds. The total time from submission to first confirmation depends on network congestion and the fee you pay.

What happens if I send to the wrong address?

Blockchain transactions are irreversible. If you send cryptocurrency to the wrong address, there is no central authority that can reverse the transaction. If the address belongs to someone, you would need to contact them directly and hope they return the funds. If the address is invalid or belongs to no one, the funds are effectively lost forever. Always double-check addresses before sending.

Can a blockchain transaction fail?

In Bitcoin, a properly constructed and signed transaction will eventually be confirmed (though it may take a long time with a very low fee). In Ethereum, transactions can fail (revert) if the smart contract execution encounters an error or runs out of gas. In both cases, the transaction fee is still consumed. Some wallets provide transaction simulation to predict whether a transaction will succeed before you submit it.

What is a transaction hash (txid)?

A transaction hash (txid or transaction ID) is a unique identifier assigned to every transaction. It is generated by hashing the transaction data. You can use the txid to track your transaction on a block explorer (like mempool.space for Bitcoin or etherscan.io for Ethereum). The txid is assigned as soon as the transaction is created and does not change once confirmed.

Why do transaction fees fluctuate?

Transaction fees are determined by supply and demand for block space. When many users are transacting simultaneously, they compete for limited block space by offering higher fees. During quiet periods, fees drop. Bitcoin block space is fixed (4 MB weight per block every 10 minutes), so fees can spike dramatically during high demand. Ethereum's EIP-1559 provides a more predictable base fee that adjusts algorithmically based on network utilization.

What is the difference between confirmed and unconfirmed transactions?

An unconfirmed transaction exists in the mempool but has not yet been included in a block. It is pending and could theoretically be replaced or dropped. A confirmed transaction has been included in a block and added to the blockchain. With each additional block built on top, the confirmation count increases and the transaction becomes increasingly difficult to reverse.

Can miners choose not to include my transaction?

Yes. Miners and validators can choose which transactions to include in their blocks. They are not obligated to include any specific transaction. However, economic incentives strongly motivate them to include as many fee-paying transactions as possible. In practice, any valid transaction with an adequate fee will eventually be included by some miner, even if a few choose to ignore it.