Difference between revisions of "Mining"

(Created page with "<!-- This page is designed to be short and simple! It should provide only a very brief explanation of things that have their own page and should link to other pages whenever p...")
 
 
(98 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- This page is designed to be short and simple! It should provide only a very brief explanation of things that have their own page and should link to other pages whenever possible. This page should serve as an entry point and a place to organize most of our mining articles. Thank You! (-Atheros) -->
 
[[File:Quick-and-dirty-4x5970-cooling.jpg|thumb|right|A home-made "[[Mining rig|mining rig]]"]]
 
 
== Introduction ==
 
== Introduction ==
'''Mining''' is the process of adding transaction records to Bitcoin's public ledger of past transactions (and a "[[Mining rig|mining rig]]" is a colloquial metaphor for a single computer system that performs the necessary computations for "mining".
+
'''Mining''' is the process where nodes in the Bitcoin [[Network]] assemble newly broadcast [[Bitcoin Transactions]] into a data structure called a [[block]]. Nodes then compete to append their block to the public [[Blockchain]] by repeatedly mutating the block's header data structure, usually by incrementing the nonce field, then hashing it in an attempt to find a value that satisfies a difficult [[Proof of Work|proof-of-work]].  
This ledger of past transactions is called the [[block chain]] as it is a chain of [[block|blocks]].
 
The blockchain serves to [[Confirmation|confirm]] transactions to the rest of the network as having taken place.
 
Bitcoin nodes use the blockchain to distinguish legitimate Bitcoin transactions from attempts to re-spend coins that have already been spent elsewhere.
 
  
Mining is intentionally designed to be resource-intensive and difficult so that the number of blocks found each day by miners remains steady. Individual [[blocks]] must contain a [[proof of work|proof of work]] to be considered valid. This proof of work is verified by other Bitcoin nodes each time they receive a block. Bitcoin uses the [[hashcash]] proof-of-work function.
+
When a node finds a valid proof-of-work hash for a block, it broadcasts the block to all nodes. Other nodes accept this block only if all the transactions in it are valid and have not yet been included in a block. Other nodes in the network then express their acceptance of the block by building upon it to create the next block in the chain.
  
The primary purpose of mining is to set the history of [[transactions]] in a way that is [[Irreversible Transactions|computationally impractical to modify by any one entity]]. By downloading and verifying the blockchain, bitcoin [[full node|nodes]] are able to reach consensus about the ordering of events in bitcoin.
+
Every block is [[Block timestamp|timestamped]] and references the hash of the block preceding it. Blocks form a backward reinforcing, timestamped chain – a [[Timechain]], the precursor to the term ‘Blockchain’.
  
Mining is also the mechanism used to [[Controlled supply|introduce Bitcoins]] into the system:
+
The Blockchain structures itself in a manner that is computationally and economically impractical to modify by any one entity. Due to this, transactions included in the Blockchain are considered [[immutable]]. In addition to this quality, the Blockchain establishes an authoritative order of these transactions throughout the network by establishing which, out of any pair of conflicting transactions was seen first, thereby protecting users from [[Double-spending|attempts to re-spend coins]] that have already been spent elsewhere. This is the key innovation of mining and of Bitcoin.
Miners are paid any [[transaction fees]] as well as a "subsidy" of newly created coins.
 
This both serves the purpose of disseminating new coins in a decentralized manner as well as motivating people to provide security for the system.
 
  
Bitcoin mining is so called because it resembles the mining of other commodities:
+
=== Nodes ===
it requires exertion and it slowly makes new units available to anybody who wishes to take part. An important difference is that the [[Controlled supply|supply]] does not depend on the amount of mining. In general changing total miner hashpower does not change how many bitcoins are created over the long term.
+
Nodes are entities which run software that carries out the mining functions above. Nodes communicate using a [[P2P Network]] with its own protocol, and are the authors of the Bitcoin ledger and enforcers of the [[protocol]] rules.
  
== Difficulty ==
+
Interestingly, the Bitcoin whitepaper makes no reference to the term ‘Miner’ or the concept of ‘mining’. These terms cover the actions described in section 5 of the [http://bitcoinsv.io/bitcoin.pdf Bitcoin whitepaper] which describes the responsibilities of nodes on the network.  
=== The Computationally-Difficult Problem ===
 
Mining a block is difficult because the SHA-256 hash of a block's header must be lower than or equal to the [[Target|target]] in order for the block to be accepted by the network. This problem can be simplified for explanation purposes: The hash of a block must start with a certain number of zeros. The probability of calculating a hash that starts with many zeros is very low, therefore many attempts must be made. In order to generate a new hash each round, a [[Nonce|nonce]] is incremented. See [[Proof of work]] for more information.
 
  
=== The Difficulty Metric ===
+
It is possible to run the node client software without performing block assembly or proof-of-work. Such a setup can be used as an interface to the network for other systems such as block explorers, payment gateways and archives. Eventually it is expected that customised client software will be developed for each of these services so they will no longer be dependent on the node client to operate.
The [[Difficulty|difficulty]] is the measure of how difficult it is to find a new block compared to the easiest it can ever be. The rate is recalculated every 2,016 blocks to a value such that the previous 2,016 blocks would have been generated in exactly one fortnight (two weeks) had everyone been mining at this difficulty. This is expected yield, on average, one block every ten minutes.
 
  
As more miners join, the rate of block creation increases. As the rate of block generation increases, the difficulty rises to compensate, which has a balancing of effect due to reducing the rate of block-creation. Any blocks released by malicious miners that do not meet the required [[Target|difficulty target]] will simply be rejected by the other participants in the network.
+
Computers that run a node client which do not perform proof-of-work cannot append new blocks to the Blockchain. This means they can neither express acceptance of valid blocks by working on extending them, nor reject invalid blocks by refusing to work on them. These computers exist as passive entities that follow the gatekeepers of the network, the Miners.
  
=== Reward ===
+
=== Mempool ===
When a block is discovered, the discoverer may award themselves a certain number of bitcoins, which is agreed-upon by everyone in the network. Currently this bounty is 12.5 bitcoins; this value will halve every 210,000 blocks. See [[Controlled Currency Supply]].
+
Before a transaction can be timestamped in the Bitcoin [[Blockchain]] it needs to be received and validated by a Miner. If the Miner deems the transaction valid, they add the transaction to one of several [[Protocol#mempool|mempools]]. Mempools are temporary transaction stores and can be used to hold transactions grouped in different ways, such as transactions to be mined in the next block, transactions to watch, or transactions which cannot be mined due to an nLocktime/nSequence lock.
  
Additionally, the miner is awarded the fees paid by users sending transactions. The fee is an incentive for the miner to include the transaction in their block. In the future, as the number of new bitcoins miners are allowed to create in each block dwindles, the fees will make up a much more important percentage of mining income.
+
It is important to note every Miner has their own mempools and that mempools vary across Miners. It is also important to note that an individual transaction can be included in different mempools at the same time.  
  
== The mining ecosystem ==
+
A Miner takes the transactions it intends to include in the next block and hashes them into a [[Protocol#Merkle_Trees|merkle tree]] structure, and includes the resulting [[merkle root]] within a candidate [[block header]]. The Miner then hashes this candidate block header, attempting to find a valid proof-of-work.
 +
 
 +
=== Hashing ===
 +
A hash is a function that converts a string of data into a fixed length value that represents the original string, called the hash value. Every hash value is unique.
 +
 
 +
Hashing is a one-way function, meaning it is infeasible to determine what the input data is by looking at the hash produced from it. Conversely, it is trivial to run the same input data through the same hash function and reproduce the same hash. Because of this, a hash value of input data can be thought of as the digital fingerprint of that data. In Bitcoin mining, the input data is the 80-byte [[Block hashing algorithm|block header]].
 +
 
 +
The hashing algorithm used in Bitcoin mining is [[SHA-256]]. SHA-256 stands for Secure Hash Algorithm – 256 bit. Passing the same block header data through this algorithm will always output the same 256-bit number. However, if the header data is modified even by a single bit, the result will be a completely different and unrelated 256-bit number.
 +
 
 +
Bitcoin mining passes the block header data through the SHA-256 algorithm twice (SHA-256d).
 +
 
 +
=== Proof-of-work ===
 +
Bitcoin uses a [[Proof of Work]] function based on the earlier work of [[hashcash]].
 +
 
 +
A Miner cannot create a new block without finding a valid proof-of-work hash, for the block header they are hashing. To be valid, the SHA-256d hash (which is just a number) of the block header must be less than another number, called the [[target]]. The target value is defined by the [[Block hashing algorithm|Bits]] field in the block header that is being hashed.
 +
 +
The target adjusts so that the average time it takes for the entire network to find a valid proof-of-work hash is ten minutes.
 +
 
 +
Because of the extraordinarily large SHA-256 target space, it is extremely unlikely that any given hash will be below the target. As a result of this, hashing entities invest large amounts of capital into specialised hashing hardware, along with the associated electricity costs in order to produce as many of these hashes as possible in a given time period. Therefore, the only way a Miner can append a block to the Block chain is through a substantial commitment of operational expenditure – proof-of-work.
 +
 
 +
=== Incentive ===
 +
The first transaction in every block is called the [[Coinbase]] transaction. The Coinbase transaction is a special transaction which pays bitcoins to the Miner of the block. The Coinbase payment is made up of the [[Miner subsidy|subsidy]] amount and the sum of all [[transaction fees]] paid by transactions within the mined block.
 +
 
 +
== Competition ==
 +
 
 +
=== Propagation and validation ===
 +
If a Miner finds a valid proof-of-work for the block header they are hashing, they immediately announce this by sending the entire block to other Miners. Meanwhile, they start working on finding the next block in the chain.
 +
 
 +
Competing Miners receive this block and immediately check that all transactions within the block, as well as the proof-of-work are valid. If the block is valid, they discontinue mining on top of the previous block and start working on hashing a new block header, building on the block just found by their competitor.
 +
 
 +
There are incentives at play here. First, winning 'Miner A' strives to get their winning block to all other Miners as quickly as possible. This reduces the possibility that competing 'Miner B' (who found a valid block at approximately the same time) propagates their block to some Miners before 'Miner A' could. This opens up the possibility that 'Miner A's' block, could later be [[Orphan Block|orphaned]] and the Coinbase reward rendered invalid and unusable by 'Miner A'. The degree of bandwidth and connectivity to other Miners can be seen as a competitive advantage and as such, the mining network tends toward a densely connected, small world structure with high bandwidth.
  
=== Hardware ===
+
There also exists a competitive advantage in validating transactions. When validating a block, each transaction's inputs must be looked up in the miner's [[VOUT|UTXO]] set to check they are unspent and the amount in satoshis is correct. Additionally, each inputs locking and unlocking scripts need to be run by the Miner to assess whether each transaction is valid.
[[File:Usb-fpga module 1.15x-hs-800.jpg|thumb|right|FPGA Module]]
 
Users have used various types of hardware over time to mine blocks. Hardware specifications and performance statistics are detailed on the [[Mining Hardware Comparison]] page.
 
==== CPU Mining ====
 
Early Bitcoin client versions allowed users to use their CPUs to mine. The advent of GPU mining made CPU mining financially unwise as the hashrate of the network grew to such a degree that the amount of bitcoins produced by CPU mining became lower than the cost of power to operate a CPU. The option was therefore removed from the core Bitcoin client's user interface.
 
  
==== GPU Mining ====
+
=== Rejected blocks ===
GPU Mining is drastically faster and more efficient than CPU mining. See the main article: [[Why a GPU mines faster than a CPU]]. A variety of popular [[Mining rig|mining rigs]] have been documented.
+
At any given point in time, two or more independent Miners may mine a block at the same time. In this situation, nodes can be in disagreement about which of these blocks should be the tip of the Block chain.
==== FPGA Mining ====
 
FPGA mining is a very efficient and fast way to mine, comparable to GPU mining and drastically outperforming CPU mining. FPGAs typically consume very small amounts of power with relatively high hash ratings, making them more viable and efficient than GPU mining. See [[Mining Hardware Comparison]] for FPGA hardware specifications and statistics.
 
==== ASIC Mining ====
 
An application-specific integrated circuit, or ''ASIC'', is a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013. For the amount of power they consume, they are vastly faster than all previous technologies and already have made GPU mining financially.
 
  
==== Mining services (Cloud mining) ====
+
Miners always follow the longest chain they deem to be valid. Eventually another block will be found that builds on one of the competing chain tips. Miners then switch to this tip provided they consider it to be valid. As such, such scenarios are eventually resolved back to one persistent chain through the actions of the majority of hash power via [[Nakamoto Consensus]].
[[:Category:Mining_contractors|Mining contractors]] provide mining services with performance specified by contract, often referred to as a "Mining Contract." They may, for example, rent out a specific level of mining capacity for a set price at a specific duration.
 
  
=== Pools ===
+
In this scenario, a block that doesn't end up forming part of the longest chain is rejected by the network and called an [[Orphan Block]]. An orphan block represents wasted effort on the behalf of a Miner and an incentive to invest in infrastructure in order to reduce the frequency of these events. However, orphans do not reduce the overall revenues of the Bitcoin system as the wasted work is not factored into the difficulty adjustment.  Thus, if a certain percentage of hashing work is wasted due to the orphaned blocks, the difficulty will adjust downwards by a similar percentage, maintaining the same rate of valid block production overall. Additionally, the fee paying transactions in the orphaned block will still be valid and included in the competing block or its descendants.
As more and more miners competed for the limited supply of blocks, individuals found that they were working for months without finding a block and receiving any reward for their mining efforts. This made mining something of a gamble. To address the variance in their income miners started organizing themselves into [[Pooled mining|pools]] so that they could share rewards more evenly. See [[Pooled mining]] and [[Comparison of mining pools]].
 
  
=== History ===
+
Competing valid blocks are not the only way that blocks end up being rejected. Any miner can refuse to build on any block for any reason. Such an action by a particular Miner is only meaningful if the majority of Miners carry out the same action. It is through this mechanism that the mining network can establish consensus on variables that are Miner configurable - such as maximum block size. This is the basis of [[Nakamoto Consensus]]:
Bitcoin's public ledger (the "block chain") was started on January 3rd, 2009 at 18:15 UTC presumably by [[Satoshi Nakamoto]]. The first block is known as the [[genesis block]]. The first transaction recorded in the first block was a single transaction paying the reward of 50 new bitcoins to its creator.
 
  
== Staking ==
+
{{quote|1=''" They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. Any needed rules and incentives can be enforced with this consensus mechanism."''}}
  
Staking is a concept in the [[Delegated proof of stake]] coins, closely resembling pooled mining of proof of work coins. According to the [[Proof of Stake|proof of share]] principle, instead of computing powers, the partaking users are pooling their ''stakes'', certain amounts of money, blocked on their wallets and delegated to the pool’s staking balance.
+
== The mining ecosystem ==
  
The network periodically selects a pre-defined number of top staking pools (usually between 20 and 100), based on their staking balances, and allows them to validate transactions in order to get a reward. The rewards are then shared with the delegators, according to their stakes with the pool.
+
=== Asic mining ===
 +
An application-specific integrated circuit, or [[ASIC]], is a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013. For the amount of power they consume, they are vastly more energy efficient than predecessor approaches to mining - using [[CPU]], GPU or FPGA.
  
Although staking doesn’t require lots of computing power as mining, it still needs very stable and fast Internet connection in order to collect, verify and sign all transactions in the queue within a small timespan, which can be as short as one second. If a pool fails to do so, it doesn’t get the reward, and it may be shared with the next pool in order.
+
=== Pooled mining ===
 +
Pooled mining is the use of a block template allocation system that provides, distributed hashing infrastructure updated block headers against which they perform proof of work. This system of hash allocation to nodes is a primary part of [[Nakamoto Consensus]], in that individual operators of hash power can choose to re-allocate their hash to nodes, producing blocks that meet their expectations in terms of maximised profitability and adherence to the Bitcoin ruleset. Miners who distribute block templates that don't maximise profit, or which attempt to implement changed rule sets, risk the owners of the hash machinery they depend on re-deploying it to a different node on the network.
 +
 +
==== Stratum ====
 +
Stratum is an open-source mining protocol used by many mining pools. Stratum facilitates coordination between the mining pool operator and individual mining machines.
  
==See Also==
+
==See also==
 +
* [https://bitcoinsv.io/bitcoin.pdf Bitcoin Whitepaper]
  
* [https://99bitcoins.com/beginners-guide-to-mining/ Beginner's Guide to Bitcoin Mining]
+
==Attribution==
* [https://www.zpool.ca Bitcoin Multipool]
+
This content is based on content sourced from https://en.bitcoin.it/wiki/Mining under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated, we acknowledge the original authors.
* [https://www.bitcoinmining.com Bitcoin Mining]
 
* [http://codinginmysleep.com/bitcoin-mining-in-plain-english Bitcoin Mining in Plain English] by David Perry
 
* [https://www.weusecoins.com/en/mining-guide/ Getting Started With Bitcoin Mining]
 
* [[Automatically mine when computer is locked|Tutorial to automatically start mining when you lock your computer]]. (Windows 7)
 
* [http://bitcoinminer.com Bitcoin Miner]
 
* [http://www.bitcongress.org/bitcoin/best-bitcoin-mining-hardware/ Bitcoin Mining Hardware Comparison]
 
* [http://www.reddit.com/r/Bitcoin/comments/18q2jx/eli5_bitcoin_mining_xpost_in_eli5/ Simplified Explanation of Bitcoin Mining] by reddit user [http://www.reddit.com/user/azotic azotic]
 
* [https://bitcoinchain.com/pools Bitcoin Mining Pools Comparison]
 
* [http://www.bitcoinmining.com/best-bitcoin-cloud-mining-contract-reviews/ Research, Review and Compare Cloud Mining Contracts]
 
* [https://www.youtube.com/watch?v=GmOzih6I1zs Video: What is Bitcoin Mining?]
 
* [http://yogh.io/#mine:last Mining Simulator] ([https://github.com/JornC/bitcoin-transaction-explorer GitHub source])
 
* [http://bitcoindaily.org/bitcoin-guides/what-is-bitcoin-mining/ Bitcoin Mining Explained]
 
[[ru:Mining]]
 
[[Category:Mining]][[Category:Vocabulary]]
 

Latest revision as of 04:26, 25 April 2022

Introduction

Mining is the process where nodes in the Bitcoin Network assemble newly broadcast Bitcoin Transactions into a data structure called a block. Nodes then compete to append their block to the public Blockchain by repeatedly mutating the block's header data structure, usually by incrementing the nonce field, then hashing it in an attempt to find a value that satisfies a difficult proof-of-work.

When a node finds a valid proof-of-work hash for a block, it broadcasts the block to all nodes. Other nodes accept this block only if all the transactions in it are valid and have not yet been included in a block. Other nodes in the network then express their acceptance of the block by building upon it to create the next block in the chain.

Every block is timestamped and references the hash of the block preceding it. Blocks form a backward reinforcing, timestamped chain – a Timechain, the precursor to the term ‘Blockchain’.

The Blockchain structures itself in a manner that is computationally and economically impractical to modify by any one entity. Due to this, transactions included in the Blockchain are considered immutable. In addition to this quality, the Blockchain establishes an authoritative order of these transactions throughout the network by establishing which, out of any pair of conflicting transactions was seen first, thereby protecting users from attempts to re-spend coins that have already been spent elsewhere. This is the key innovation of mining and of Bitcoin.

Nodes

Nodes are entities which run software that carries out the mining functions above. Nodes communicate using a P2P Network with its own protocol, and are the authors of the Bitcoin ledger and enforcers of the protocol rules.

Interestingly, the Bitcoin whitepaper makes no reference to the term ‘Miner’ or the concept of ‘mining’. These terms cover the actions described in section 5 of the Bitcoin whitepaper which describes the responsibilities of nodes on the network.

It is possible to run the node client software without performing block assembly or proof-of-work. Such a setup can be used as an interface to the network for other systems such as block explorers, payment gateways and archives. Eventually it is expected that customised client software will be developed for each of these services so they will no longer be dependent on the node client to operate.

Computers that run a node client which do not perform proof-of-work cannot append new blocks to the Blockchain. This means they can neither express acceptance of valid blocks by working on extending them, nor reject invalid blocks by refusing to work on them. These computers exist as passive entities that follow the gatekeepers of the network, the Miners.

Mempool

Before a transaction can be timestamped in the Bitcoin Blockchain it needs to be received and validated by a Miner. If the Miner deems the transaction valid, they add the transaction to one of several mempools. Mempools are temporary transaction stores and can be used to hold transactions grouped in different ways, such as transactions to be mined in the next block, transactions to watch, or transactions which cannot be mined due to an nLocktime/nSequence lock.

It is important to note every Miner has their own mempools and that mempools vary across Miners. It is also important to note that an individual transaction can be included in different mempools at the same time.

A Miner takes the transactions it intends to include in the next block and hashes them into a merkle tree structure, and includes the resulting merkle root within a candidate block header. The Miner then hashes this candidate block header, attempting to find a valid proof-of-work.

Hashing

A hash is a function that converts a string of data into a fixed length value that represents the original string, called the hash value. Every hash value is unique.

Hashing is a one-way function, meaning it is infeasible to determine what the input data is by looking at the hash produced from it. Conversely, it is trivial to run the same input data through the same hash function and reproduce the same hash. Because of this, a hash value of input data can be thought of as the digital fingerprint of that data. In Bitcoin mining, the input data is the 80-byte block header.

The hashing algorithm used in Bitcoin mining is SHA-256. SHA-256 stands for Secure Hash Algorithm – 256 bit. Passing the same block header data through this algorithm will always output the same 256-bit number. However, if the header data is modified even by a single bit, the result will be a completely different and unrelated 256-bit number.

Bitcoin mining passes the block header data through the SHA-256 algorithm twice (SHA-256d).

Proof-of-work

Bitcoin uses a Proof of Work function based on the earlier work of hashcash.

A Miner cannot create a new block without finding a valid proof-of-work hash, for the block header they are hashing. To be valid, the SHA-256d hash (which is just a number) of the block header must be less than another number, called the target. The target value is defined by the Bits field in the block header that is being hashed.

The target adjusts so that the average time it takes for the entire network to find a valid proof-of-work hash is ten minutes.

Because of the extraordinarily large SHA-256 target space, it is extremely unlikely that any given hash will be below the target. As a result of this, hashing entities invest large amounts of capital into specialised hashing hardware, along with the associated electricity costs in order to produce as many of these hashes as possible in a given time period. Therefore, the only way a Miner can append a block to the Block chain is through a substantial commitment of operational expenditure – proof-of-work.

Incentive

The first transaction in every block is called the Coinbase transaction. The Coinbase transaction is a special transaction which pays bitcoins to the Miner of the block. The Coinbase payment is made up of the subsidy amount and the sum of all transaction fees paid by transactions within the mined block.

Competition

Propagation and validation

If a Miner finds a valid proof-of-work for the block header they are hashing, they immediately announce this by sending the entire block to other Miners. Meanwhile, they start working on finding the next block in the chain.

Competing Miners receive this block and immediately check that all transactions within the block, as well as the proof-of-work are valid. If the block is valid, they discontinue mining on top of the previous block and start working on hashing a new block header, building on the block just found by their competitor.

There are incentives at play here. First, winning 'Miner A' strives to get their winning block to all other Miners as quickly as possible. This reduces the possibility that competing 'Miner B' (who found a valid block at approximately the same time) propagates their block to some Miners before 'Miner A' could. This opens up the possibility that 'Miner A's' block, could later be orphaned and the Coinbase reward rendered invalid and unusable by 'Miner A'. The degree of bandwidth and connectivity to other Miners can be seen as a competitive advantage and as such, the mining network tends toward a densely connected, small world structure with high bandwidth.

There also exists a competitive advantage in validating transactions. When validating a block, each transaction's inputs must be looked up in the miner's UTXO set to check they are unspent and the amount in satoshis is correct. Additionally, each inputs locking and unlocking scripts need to be run by the Miner to assess whether each transaction is valid.

Rejected blocks

At any given point in time, two or more independent Miners may mine a block at the same time. In this situation, nodes can be in disagreement about which of these blocks should be the tip of the Block chain.

Miners always follow the longest chain they deem to be valid. Eventually another block will be found that builds on one of the competing chain tips. Miners then switch to this tip provided they consider it to be valid. As such, such scenarios are eventually resolved back to one persistent chain through the actions of the majority of hash power via Nakamoto Consensus.

In this scenario, a block that doesn't end up forming part of the longest chain is rejected by the network and called an Orphan Block. An orphan block represents wasted effort on the behalf of a Miner and an incentive to invest in infrastructure in order to reduce the frequency of these events. However, orphans do not reduce the overall revenues of the Bitcoin system as the wasted work is not factored into the difficulty adjustment. Thus, if a certain percentage of hashing work is wasted due to the orphaned blocks, the difficulty will adjust downwards by a similar percentage, maintaining the same rate of valid block production overall. Additionally, the fee paying transactions in the orphaned block will still be valid and included in the competing block or its descendants.

Competing valid blocks are not the only way that blocks end up being rejected. Any miner can refuse to build on any block for any reason. Such an action by a particular Miner is only meaningful if the majority of Miners carry out the same action. It is through this mechanism that the mining network can establish consensus on variables that are Miner configurable - such as maximum block size. This is the basis of Nakamoto Consensus:

" They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. Any needed rules and incentives can be enforced with this consensus mechanism."

The mining ecosystem

Asic mining

An application-specific integrated circuit, or ASIC, is a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013. For the amount of power they consume, they are vastly more energy efficient than predecessor approaches to mining - using CPU, GPU or FPGA.

Pooled mining

Pooled mining is the use of a block template allocation system that provides, distributed hashing infrastructure updated block headers against which they perform proof of work. This system of hash allocation to nodes is a primary part of Nakamoto Consensus, in that individual operators of hash power can choose to re-allocate their hash to nodes, producing blocks that meet their expectations in terms of maximised profitability and adherence to the Bitcoin ruleset. Miners who distribute block templates that don't maximise profit, or which attempt to implement changed rule sets, risk the owners of the hash machinery they depend on re-deploying it to a different node on the network.

Stratum

Stratum is an open-source mining protocol used by many mining pools. Stratum facilitates coordination between the mining pool operator and individual mining machines.

See also

Attribution

This content is based on content sourced from https://en.bitcoin.it/wiki/Mining under Creative Commons Attribution 3.0. Although it may have been extensively revised and updated, we acknowledge the original authors.