Difference between revisions of "Block chain"

Line 1: Line 1:
A '''block chain''' is a transaction database shared by all [[Node|nodes]] participating in a system based on the Bitcoin protocolA full copy of a currency's block chain contains every [[Bitcoin Transactions|transaction]] ever executed in the currency.  With this information, one can the full ownership record of all Bitcoins managed on the ledger at any point in history.
+
The Bitcoin '''block chain''' is the transaction database that is built by [[Node|nodes]] participating in the [[mining]] process on the Bitcoin networkThe block chain contains every [[Bitcoin Transactions|transaction]] ever executed on the network.  With this information, one can calculate and trace the ownership record of all Bitcoins managed on the ledger at any point in history.
  
Every [[Block|block]] contains a reference to the block it builds upon. This has the effect of creating a chain of blocks from the [[genesis block]] to the current block. Each block is guaranteed to come after the previous block chronologically because the previous block's hash would otherwise not be known. Each block is also computationally impractical to modify once it has been in the chain for a while because every block after it would also have to be regenerated.
+
Every [[Block|block]] contains a reference to the block it builds upon. This has the effect of creating a chain of blocks from the [[genesis block]] to the current block. Blocks become computationally impractical to modify they have been built upon for a period of time due to the amount of [[Proof of work|work]] that would need to be regenerated.
  
Honest miners only build on a block (by referencing it in blocks they create) if it is the latest block in the longest valid chain. A chain is valid if all of the blocks and transactions within it are valid, and only if it starts with the genesis block. Miners can dispute blocks by choosing ''not'' to build upon them. A block that is not built upon is called an [[Orphan Block]].
+
Miners extend the blockchain by building on what they consider to be the most recent valid block in the longest chain of proof of work. Miners can dispute blocks by choosing ''not'' to build upon them. A block that is not built upon is called an [[Orphan Block]].
  
For any block on the chain, there is only one path to the genesis block. Coming from the genesis block, however, there can be forks. Forks can be created from time to time when two valid blocks are created just a few seconds apart. When that happens, nodes will attempt to build a new block whichever one of the blocks they received first. When a new block is found, the block it built upon becomes part of the main chain, orphaning its competitor.
+
For any block on the chain, there is only one path to the genesis block. Coming from the genesis block, however, there can be forks. Forks can be created from time to time when two valid blocks are created just a few seconds apart. When this happens, nodes will attempt to build a new block whichever one of the blocks they received first. When a new block is found, the block it built upon becomes part of the longest chain, orphaning its competitor.
  
 
Forks can also occur when nodes disagree on network rules. Two notable forks have occurred on Bitcoin, the first in 2017 when Bitcoin was forked onto the BCH network when BTC nodes elected to adopt Segregated Witness into the BTC network rules, and again in November 2018 when BCH nodes elected to implement new opcodes and consensus rules that were unaligned with the original protocol.
 
Forks can also occur when nodes disagree on network rules. Two notable forks have occurred on Bitcoin, the first in 2017 when Bitcoin was forked onto the BCH network when BTC nodes elected to adopt Segregated Witness into the BTC network rules, and again in November 2018 when BCH nodes elected to implement new opcodes and consensus rules that were unaligned with the original protocol.
  
Blocks in shorter chains (or invalid chains) are not used for anything. When the bitcoin client switches to another, longer chain, all valid transactions of the blocks inside the shorter chain are re-added to the pool of queued transactions and will be included in another block. The reward for the blocks on the shorter chain will not be present in the longest chain, so they will be practically lost, which is why a network-enforced 100-block maturation time for generations exists.
+
Blocks in shorter chains (or invalid chains) are not used for anything. If a node detects the creation of a longer chain than the one it is working on, all valid transactions of the block template inside the shorter chain are re-added to the pool of queued transactions and will be included in another block. The reward for the blocks on the shorter chain will not be present in the longest chain, so they will be practically lost, which is why a network-enforced 100-block maturation time for generations exists.
  
 
Because a block can only reference one previous block, it is impossible for two forked chains to merge.
 
Because a block can only reference one previous block, it is impossible for two forked chains to merge.
  
The block chain is broadcast to all nodes on the networking using the Bitcoin Network protocol.
+
Blocks are broadcast to all nodes on the networking using the Bitcoin Network protocol.

Revision as of 12:04, 11 December 2019

The Bitcoin block chain is the transaction database that is built by nodes participating in the mining process on the Bitcoin network. The block chain contains every transaction ever executed on the network. With this information, one can calculate and trace the ownership record of all Bitcoins managed on the ledger at any point in history.

Every block contains a reference to the block it builds upon. This has the effect of creating a chain of blocks from the genesis block to the current block. Blocks become computationally impractical to modify they have been built upon for a period of time due to the amount of work that would need to be regenerated.

Miners extend the blockchain by building on what they consider to be the most recent valid block in the longest chain of proof of work. Miners can dispute blocks by choosing not to build upon them. A block that is not built upon is called an Orphan Block.

For any block on the chain, there is only one path to the genesis block. Coming from the genesis block, however, there can be forks. Forks can be created from time to time when two valid blocks are created just a few seconds apart. When this happens, nodes will attempt to build a new block whichever one of the blocks they received first. When a new block is found, the block it built upon becomes part of the longest chain, orphaning its competitor.

Forks can also occur when nodes disagree on network rules. Two notable forks have occurred on Bitcoin, the first in 2017 when Bitcoin was forked onto the BCH network when BTC nodes elected to adopt Segregated Witness into the BTC network rules, and again in November 2018 when BCH nodes elected to implement new opcodes and consensus rules that were unaligned with the original protocol.

Blocks in shorter chains (or invalid chains) are not used for anything. If a node detects the creation of a longer chain than the one it is working on, all valid transactions of the block template inside the shorter chain are re-added to the pool of queued transactions and will be included in another block. The reward for the blocks on the shorter chain will not be present in the longest chain, so they will be practically lost, which is why a network-enforced 100-block maturation time for generations exists.

Because a block can only reference one previous block, it is impossible for two forked chains to merge.

Blocks are broadcast to all nodes on the networking using the Bitcoin Network protocol.