How Bitcoin Works?


Bitcoins are a form of cryptocurrency that is used worldwide for decentralized transactions. But how does a bitcoin transaction work?

As we had discussed in earlier chapters, bitcoins have addressing present in them. These addresses are used for transactions, along with keys and the help of some professionals who solve bitcoin riddles. These professionals are known as Bitcoin Miners.

Let us dwell more into the seemingly difficult but actually fairly easy mode of bitcoin transactions.

Bitcoin Transaction Lifecycle

Let's examine the life cycle of a Bitcoin transaction. The process unfolds as follows −

  • A user/sender initiates a transaction using wallet software or another interface.
  • The wallet software digitally signs the transaction with the sender's private key.
  • The transaction is disseminated across the Bitcoin network via a flooding algorithm.
  • Mining nodes (miners) monitoring for transactions validate and add the transaction to the upcoming block to be mined. Prior to inclusion in the block, transactions are stored in a dedicated memory pool known as the transaction pool.
  • Mining starts, which is a process that fortifies the blockchain and yields new coins as a reward for miners who allocate sufficient computational resources. Upon solving the PoW (Proof of Work) puzzle, a miner broadcasts the freshly mined block to the network.
  • Ultimately, confirmations begin to surface in the recipient's wallet, and after roughly three confirmations, the transaction is deemed finalized and verified.

Who are Miners?

Miners are the actual brains behind the whole process of mining and solvin the puzzles in POW.

Upon establishing a connection to the Bitcoin network, a Bitcoin miner undertakes several essential responsibilities −

Network Synchronization

When a new node integrates into the Bitcoin network, it initiates the process of downloading the blockchain by requesting historical blocks from existing nodes

Validation of Transactions

Transactions disseminated across the network undergo validation by full nodes, which verify and authenticate signatures and outputs.

Validation of Blocks

Both miners and full nodes engage in the validation of blocks they receive by assessing them against specific criteria. This process includes verifying each transaction within the block as well as confirming the nonce value.

Creation of New Blocks

Miners generate a new block by aggregating transactions that have been broadcast on the network, following their validation.

Execution of Proof of Work (PoW)

This task constitutes the fundamental aspect of the mining process. The block header features a 32-bit nonce field, and miners must continuously adjust the nonce until the resulting hash meets a predetermined target.

Reward Acquisition

After a node successfully solves the hash puzzle (PoW), it promptly broadcasts the outcome, allowing other nodes to verify and accept the block.

The Process of Mining

Mining Pools

A mining pool is created when a collective of miners collaborate to mine a block. The pool administrator obtains the coinbase transaction upon successful mining of the block, and is tasked with distributing the reward among the miners who contributed resources to mine the block.

Mining Pools and Their Hashing Power

This method proves to be better than solo mining, where a single miner attempts to solve the partial hash inversion function (hash puzzle) alone, as in mining pools, the reward is distributed to every member of the pool irrespective of whether they (or their individual node) solved the puzzle or not.