Mining: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Therilith (talk | contribs)
mNo edit summary
Kamariks (talk | contribs)
No edit summary
 
(101 intermediate revisions by 44 users not shown)
Line 1: Line 1:
{{stub}}
<!-- 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 quick and dirty mining rig]]
[[File:Quick-and-dirty-4x5970-cooling.jpg|thumb|right|A home-made "[[Mining rig|mining rig]]"]]
== Introduction ==
== Introduction ==
'''Transaction recording''', or '''mining''', is the process of adding transaction records to Bitcoin's public ledger or journal. The ledger serves to [[confirmations|confirm]] those transactions to the rest of the network as having taken place. Through the public ledger, Bitcoin nodes can distinguish legitimate Bitcoin transactions from attempts to respend coins that have already been spent elsewhere.
'''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".
This ledger of past transactions calls itself the [[blockchain]] 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.


Transaction recording is intentionally designed to be resource-intensive and difficult.  It is also designed such that the records themselves provide a "proof-of-work" - in other words, that it is possible for any node to estimate how much collective computational work went into creating each record.
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.


The more work for which a record contains proof, the more valid that record is considered to be. The proof of work provides a quick and simple way to reconcile conflicting versions of portions of the ledger, which may occur from time to time due to differences in timing and perspective from different nodes.  In case of conflict, the version that shows proof of the greatest amount of work is deemed to be the version as witnessed by the majority of the nodes, and becomes the winner.
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 a consensus about the ordering of events in bitcoin.


When a conflict is resolved, transactions from the "losing" version are automatically transplanted into later pages following the "winning" page, assuming there is no conflict with any of the earlier transactions on the "winning" page. During reconciliation, legitimate transactions are highly unlikely to conflict, but a conflict might occur in the event of a deliberate attempt to spend the same Bitcoins in two different places simultaneously.  Because the transaction on the "winning" page takes precedence, any such conflict will be resolved in favor of the transaction that was successfully recorded on the earliest winning page.
Mining is also the mechanism used to [[Controlled supply|introduce Bitcoins]] into the system:
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.


Anyone can add records to Bitcoin's public ledger, it is just not easy.  In order to add a page of transaction records to the public journal (also referred to as adding a ''[[block]]'' to the ''[[block chain]]''), one must compute the answer to a difficult mathematical problem and include the correct answer into the block.  The answer for each block is different, and depends on all of the transactions that have been included in the block.
Bitcoin mining is so-called because it resembles the mining of other commodities:
 
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.
The person who successfully records a page is able to collect the transaction fees that are offered in each of the transactions he or she successfully recorded.
 
As an economic incentive to build the peer-to-peer infrastructure for recording transactions in the absence of fee-paying transaction volume, Bitcoin was designed such that a reward of newly minted Bitcoins would be distributed to each participant who successfully records a page (block) into the public transaction journal.  The reward per page diminishes over time so that the limit of 21 million Bitcoins can take effect, with the expectation that transaction volume will increase and that the efforts of transaction recorders can transition from receiving rewards of new Bitcoins to receiving transaction fees.
 
Transaction recording is also commonly called '''mining''' because it resembles gold mining in the sense that it requires exertion and slowly yields new currency.
 
== History ==
Bitcoin's public journal was started on January 3rd, 2009 at 18:15 UTC presumably by [[Satoshi Nakamoto]]. This page (block) is known as the [[genesis block]].  The first transaction recorded on the first page (block) was a single transaction paying the reward of 50 new Bitcoins to its creator.
 
Bitcoin mining is so called because the rate at which bitcoins are generated resembles the rate at which commodities like gold are mined from the ground. See [[Controlled Currency Supply]].  


== Difficulty ==
== Difficulty ==
=== The Computationally-Difficult Problem ===
=== 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.
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 ===
=== The Difficulty Metric ===
The [[Difficulty|difficulty]] is the measure of how difficult it is to find a new block compared to the easiest it can ever be. It is recalculated every 2016 blocks to a value such that the previous 2016 blocks would have been generated in exactly two weeks had everyone been mining at this difficulty. This will yield, on average, one block every ten minutes. As more miners join, the rate of block creation will go up. As the rate of block generation goes up, the difficulty rises to compensate which will push the rate of block creation back down. Any blocks released by malicious miners that do not meet the required difficulty [[Target|target]] will simply be rejected by everyone on the network and thus will be worthless.  
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.


=== Reward ===
=== Reward ===
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 50 bitcoins; this value will halve every 210,000 blocks. See [[Controlled Currency Supply]].  
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 6.25 bitcoins; this value will halve every 210,000 blocks. See [[Controlled Currency Supply]].
 
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.
 
== The mining ecosystem ==


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.
=== Hardware ===
==== Making a Profit ====
== Hardware ==
[[File:Usb-fpga module 1.15x-hs-800.jpg|thumb|right|FPGA Module]]
[[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.
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 ===  
==== CPU Mining ====
=== GPU 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 ====
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.
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.
=== FPGA Mining ===
==== FPGA Mining ====
=== Mining in the Future ===
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) ====
[[: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 ===
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 ===
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 ==
 
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 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.
 
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.
 
A lot of [[altcoin]]s are using staking. Staking is often marketed as a much more efficient alternative. Unfortunately staking has the potential to not be much different than politics. A good example is that it's easy for a big actor to take over the network by simply buying enough coins. This actually happened in 2020 when TRON's Justin Sun took over the Steem "forum" network and then did some things that made some people unhappy.
 
==See Also==


== Pools ==
* [https://99bitcoins.com/beginners-guide-to-mining/ Beginner's Guide to Bitcoin Mining]
As mining a block became more and more difficult, individuals found that they were working for months without finding a block and receiving ''any'' reward for their mining efforts. Thus they started organizing themselves into [[Pooled mining|pools]] so that they could share rewards more evenly. See [[Pooled mining]] and [[Comparison of mining pools]].
* [https://www.zpool.ca Bitcoin Multipool]
* [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]]
[[Category:Mining]][[Category:Vocabulary]]

Latest revision as of 17:56, 23 November 2022

A home-made "mining rig"

Introduction

Mining is the process of adding transaction records to Bitcoin's public ledger of past transactions (and a "mining rig" is a colloquial metaphor for a single computer system that performs the necessary computations for "mining". This ledger of past transactions calls itself the blockchain as it is a chain of blocks. The blockchain serves to 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 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.

The primary purpose of mining is to set the history of transactions in a way that is computationally impractical to modify by any one entity. By downloading and verifying the blockchain, bitcoin nodes are able to reach a consensus about the ordering of events in bitcoin.

Mining is also the mechanism used to introduce Bitcoins into the system: 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: it requires exertion and it slowly makes new units available to anybody who wishes to take part. An important difference is that the 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.

Difficulty

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 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 is incremented. See Proof of work for more information.

The Difficulty Metric

The 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 difficulty target will simply be rejected by the other participants in the network.

Reward

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 6.25 bitcoins; this value will halve every 210,000 blocks. See Controlled Currency Supply.

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.

The mining ecosystem

Hardware

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

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 rigs have been documented.

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)

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

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 pools so that they could share rewards more evenly. See Pooled mining and Comparison of mining pools.

History

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

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 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 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.

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.

A lot of altcoins are using staking. Staking is often marketed as a much more efficient alternative. Unfortunately staking has the potential to not be much different than politics. A good example is that it's easy for a big actor to take over the network by simply buying enough coins. This actually happened in 2020 when TRON's Justin Sun took over the Steem "forum" network and then did some things that made some people unhappy.

See Also