Lifecycle of Transactions

Learn the lifecycle of transactions in Bitcoin in this lesson.

Storing the transactions in the blockchain

Since an adversary who maintains enough computational power may try to modify the history of previous transactions, Bitcoin’s transaction verification process by itself cannot ensure the security of transactions. In order to prevent any adversary from modifying the history of transactions that have been executed, Bitcoin secures the transaction through the blockchain, which is based on the computationally expensive Proof-of-Work mechanism.

Once a transaction is included in a block, it’s hard to modify, and if any adversary intends to modify a transaction in the system, not only does he have to redo all the computational effort to recompute the block in which the transaction was included, but he also has to recompute all the subsequent blocks to the head of the blockchain. Thus, the older a transaction is, the deeper it is buried under subsequent blocks in the blockchain, and hence the harder it becomes to revert the transaction. Actually, Bitcoin recommends waiting until a transaction is confirmed by six consecutive blocks before the transaction is considered safe.

Transaction lifecycle in Bitcoin

In Bitcoin, a transaction life cycle consists of the following steps (Imran Bashir (2017)Imran Bashir. Mastering Blockchain. Packt Publishing, Limited, 2017. and Nakamoto (2008)Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system. https://bitcoin. org/bitcoin.pdf, Dec 2008. Accessed: 2015-07-01.):

  1. A user sends a transaction by signing the transaction using their private key, addressing the public key, or the address of the recipient.
  2. The transaction is broadcast to the network using a flooding algorithm.
  3. Mining nodes validate the transaction independently, adding them to the unconfirmed transactions’ memory pool (Mempool), which is basically the nodes’ database for pending transactions, in order to include this transaction in their candidate block which is next to be mined.
  4. When a miner solved the Proof-of-Work problem, they broadcast the newly mined block to the network.
  5. The nodes verify the block and propagate it further.
  6. Finally, the block is added to the blockchain and the transaction is considered to be confirmed.
  7. With each successive block, the transaction is reconfirmed.
  8. When a transaction is confirmed by six consecutive blocks, it is considered safe.

It’s important to note that a recipient immediately possesses a UXTO as soon as his node validates the transaction. Such transactions are called zero-confirmation transactions, which are insecure, as shown in this section.

Get hands-on with 1200+ tech skills courses.