Note: this post was almost exclusively pulled from “Mastering Bitcoin” by Andreas Antonopoulos. you can read it for free with a GitHub account here –> https://github.com/bitcoinbook/bitcoinbook

Bitcoin Nodes

Bitcoin nodes are the central nervous system of the Bitcoin network. They broadcast, verify, and store transactions. They act both as gateways to the network and an information superhighway to relay network data to all participants.  When a node receives a new transaction or block, it relays it to its peers, so that all nodes and miners can remain in sync and maintain identical blockchains. 

Bitcoin nodes share new blocks and transactions among themselves in order to keep each node up-to-date on the state of the blockchain. This sharing occurs over a peer-to-peer network; each node connects directly to several other nodes and shares data with those nodes. Most nodes connect over the internet, but some nodes connect via satellite, mesh network, or even radio. This peer-to-peer network ensures that there is no central authority controlling the blockchain.

Bitcoin’s decentralized consensus emerges from the interplay of four processes that occur independently on nodes across the network:

  • Independent verification of each transaction, by every full node, based on a comprehensive list of criteria
  • Independent aggregation of transactions into new blocks by mining nodes, coupled with demonstrated computation through a Proof-of-Work algorithm
  • Independent verification of new blocks by every node and assembly into a chain
  • Independent selection, by every node, of the chain with the most cumulative computation demonstrated through Proof-of-Work

Independent Verification of Each Transaction

Before a full node can validate unconfirmed transactions and recently-mined blocks, it must download and validate all blocks from block 1 (the block after the hardcoded genesis block) to the current tip of the best block chain. This is the Initial Block Download (IBD) or initial sync.

every Bitcoin node that receives a transaction will first verify the transaction. This ensures that only valid transactions are propagated across the network, while invalid transactions are discarded at the first node that encounters them.  Each node verifies every transaction against a long checklist of criteria. 

By independently verifying each transaction as it is received and before propagating it, every node builds a pool of valid (but unconfirmed) transactions known as the transaction pool, memory pool, or mempool. Whatever transactions remain in the memory pool are unconfirmed and are waiting to be recorded in a new block.  

In the bitcoin system, every node is free to use any record of transaction or monetary policy it desires, and no authority can stop it from, or punish it for, using fraudulent records. But in order for the node to be operating in consensus and synced with the network, it needs to only consider additions to the blockchain presented by miners who have solved the proof-of-work mathematical problems.

Types of Nodes

Full Node

A full node’s main function is to independently verify the state of the Bitcoin blockchain. It does so by downloading every block and transaction and checking them against Bitcoin’s consensus rules. If a transaction or block violates one of Bitcoin’s consensus rules, a full node will automatically reject it.

“Trusted third parties are security holes.” — Nick Szabo

With a full node, you do not need to trust anyone, including your brokerage, block explorer, or wallet provider. Because your node stores the entire Bitcoin blockchain, you can enforce their honesty yourself

When you run your own node, you can create and broadcast transactions directly from the node, and thus avoid using services that might compromise private information. 

A node also removes the need to use a block explorer to verify the status of your transactions. Block explorers allow third parties to track your transaction history and link it to your IP address, leaking your physical location, your bitcoin balance, and your financial counterparties.

Another motivation for running a full node is to make the Bitcoin network more robust. As more nodes exist to fully validate transactions, the network becomes more resistant to certain types of attacks. Distributed, fully-functioning nodes are central to Bitcoin’s decentralized, peer-to-peer architecture and help keep the network secure.

Lightweight / SPV client: A lightweight or Simplified Payment Verification client, are similar to full nodes in that they can verify whether transactions were included in a block. However, light nodes do not verify and validate all of the network’s transactions and do not store a copy of the blockchain.

Miners

Some of the nodes on the Bitcoin network are specialized nodes called miners.  Miners validate new bitcoin transactions and record them on the global ledger. A new block, containing transactions that occurred since the last block, is “mined” every 10 minutes on average, thereby adding those transactions to the blockchain.

Bitcoin mining is so called because it resembles the mining of other commodities: it requires exertion and it slowly makes new currency available at a rate that resembles the rate at which commodities like gold are mined from the ground.

miners compete to solve a difficult mathematical problem based on a cryptographic hash algorithm. The solution to the problem, called the Proof-of-Work, is included in the new block and acts as proof that the miner expended significant computing effort. The competition to solve the Proof-of-Work algorithm to earn the reward and the right to record transactions on the blockchain is the basis for bitcoin’s security model.

Bitcoin miners solve proof-of-work problems by repeatedly guessing and checking to discover the correct answer. This is a probabilistic process, and the more processing power dedicated to the guessing, the more guesses are made per unit of time, and the faster the correct answer will be found. 

Mining a Block

To illustrate explanations of mining – we use fictional person, Jing, who is a bitcoin miner.

Jing earns bitcoin by running a “mining rig,” which is a specialized computer-hardware system designed to mine bitcoin. 

Jing’s specialized mining hardware is connected to a server running a full Bitcoin node.  Like every other full node, Jing’s node receives and propagates unconfirmed transactions on the Bitcoin network. Jing’s node, however, also aggregates these transactions into new blocks.

Jing’s node is listening for new blocks, propagated on the Bitcoin network, as do all nodes. However, the arrival of a new block has special significance for a mining node. The competition among miners effectively ends with the propagation of a new block that acts as an announcement of a winner. the end of one round of a competition is also the beginning of the next round. 

When a candidate block has been constructed by Jing’s node, it is time for Jing’s hardware mining rig to “mine” the block, to find a solution to the Proof-of-Work algorithm that makes the block valid.  A block becomes valid only if a miner succeeds in finding a solution to the Proof-of-Work algorithm

The first transaction in any block is a special transaction, called a coinbase transaction. This transaction is constructed by Jing’s node and contains his reward for the mining effort.  If Jing’s mining node writes the coinbase transaction, what stops Jing from “rewarding” himself 100 or 1000 bitcoin? The answer is that an incorrect reward would result in the block being deemed invalid by everyone else, wasting Jing’s electricity used for Proof-of-Work. Jing, the miner, only gets to spend the bitcoin reward if the block is accepted by everyone across The bitcoin network of nodes.


Discover more from def-invest

Subscribe to get the latest posts sent to your email.

Posted in

Leave a comment