<h2>Why do we mine?</h2>

<p>We need to all agree on who owns which coins.  If your idea of who owns what is different than mine then how can we trade?</p>

<p>To achieve this, the Bitcoin protocol keeps its ledger of all transactions in a series of blocks, with each block recording a collection of transactions.  Since we don't have a central authority to declare which blocks are valid, we run a 'lottery' instead.</p>

<p>Each miner bundles up all the new transactions he knows about, adds in an extra transaction which creates some coins out of thin air and pays them to the miner, mixes in a random number and hashes the whole thing.  If he gets a hash less than a certain number, he wins and his block is added to the blockchain.  If not, he tries with a different random number, over and over.  Everyone else can verify that his random number with his transactions hashes to a low enough number, so they accept his block.  The network periodically adjusts what this target "low enough number" is, in an attempt to keep the average speed of block generation at about 10 minutes.</p>

<h2>Why do we need a GPU, not a CPU?</h2>

<p>You generate coins by calculating hashes.  Each hash you calculate has a certain chance of making a block, and earning the associated reward, which is currently 50 coins.  The faster you can calculate hashes, the more chance you have of generating 50 coins.  It just so happens that ATI GPUs have the right kind of hardware in them to calculate sha256 hashes many times faster than an Intel CPU can do it.  That's why people use GPUs instead of CPUs.</p>

<p>The Bitcoin network automatically adjusts the "chance per hash" to try to keep the global rate of generation at one block every ten minutes.</p>

<p>In the beginning, before GPU mining started in earnest and not many people were mining, CPU mining worked just fine.  But as more people joined the network and hash rates became faster, the network difficulty increased to keep the blocks coming along every 10 minutes or so.  As a result, CPU mining became less rewarding per CPU.</p>

<p>Then when it became more common for miners to use GPU hardware to mine because it is so much faster and more energy efficient than CPU mining, the global network hash rate increased still further eventually making it completely useless to mine with a CPU; the expected rewards are less than the power consumed by the CPU.</p>

<p>Maybe one day <a href="http://en.wikipedia.org/wiki/Field-programmable_gate_array">FPGAs</a> or <a href="http://en.wikipedia.org/wiki/Application-specific_integrated_circuit">ASICs</a> will render GPUs useless for mining, like GPUs already did to CPUs.</p>

CC BY-SA 3.0
2012-03-16T06:13:18.767Z
I'd avoid phrases like "before GPU mining had even been thought of". In all likelihood, it was clear that GPUs would be better for the task even before the genesis block was generated. Contrary to popular belief, Bitcoin didn't invent GPGPU.
Meni Rosenfeld
CC BY-SA 3.0
2012-05-29T11:52:22.580Z
Thanks for this explanation, but could you also tell us why the hash needs to be less than a certain number?
Will Sheppard
CC BY-SA 3.0
2012-05-29T19:44:23.577Z
"network difficulty increases to keep the blocks coming along every 10 minutes or so".  If there wasn't some kind of criterion to decide which blocks are valid there would be thousands of blocks made per second.  The "less than x" is to make it hard enough to find a block that on average they are found only once every 10 minutes.
Chris Moore
CC BY-SA 3.0
2012-05-29T19:45:27.523Z
@WillSheppard This sentence in the answer should answer that for you: 'The network periodically adjusts what this target "low enough number" is, in an attempt to keep the average speed of block generation at about 10 minutes.'  It's just an arbitrary way of making it 'just hard enough' to find a block.
Chris Moore
CC BY-SA 3.0
2013-11-30T08:56:35.173Z
"Maybe one day FPGAs or ASICs will render GPUs useless for mining" - and the day has come.
Karel Bílek
CC BY-SA 3.0
2012-03-15T18:19:08.833Z
2012-03-16T07:22:32.413Z
2012-03-16T07:22:32.413Z
Chris Moore
<p>Bitcoin blocks have been <strong>deliberately</strong> made difficult to mine. The point is:</p>

<ol>
<li><p>To prevent the network to be flooded with a ton of  valid blocks that have to be checked for validity and stored. (The difficulty to mine them is <em>dynamically</em> adjusted so that in average, worldwide, one block is generated every 10 minutes.)</p></li>
<li><p>Also, this gives time for newly created blocks to spread across the network. Typical millisecond latencies can then be ignored. If latencies were not negligible, the mining 'game' would be unfair to poorly connected miners.</p></li>
</ol>

<p>And to finish answering your question, the purpose of mining is <strong>not</strong> to distribute coins, but to collectively build a reference transaction history. Coin distribution is just a reward to those who participate. Please refer to <a href="https://bitcoin.stackexchange.com/questions/910">How does the mining process support the currency?</a></p>

CC BY-SA 3.0
2012-03-15T16:53:09.430Z
It wasnt made deliberatelydifficult. Its difficulty is a result of the size of the network to keep it proportional.
MaxSan
CC BY-SA 3.0
2012-03-15T17:32:08.683Z
Stop the nonsense please.
Stéphane Gimenez
CC BY-SA 3.0
2012-03-16T02:04:20.237Z
And (maybe most importantly) 3: To make it impossible for any one party to create a majority of blocks. With hash mining, you can only expect to get a number of blocks representing your fraction of computing power *across the whole network*. That way the block chain ends up with a transaction ordering that the whole network agrees on, and sustaining a network fork over a long time becomes practically impossible.
Thilo
CC BY-SA 3.0
2012-03-16T02:33:48.140Z
And maybe 4: Since hashing is so difficult that block generation is spread "evenly" across miners, this process can be used to generate new coins (mining) and distribute them across all invested participants (as opposed to having started with 21 million coins up-front sitting all in Satoshi's wallet).
Thilo
CC BY-SA 3.0
2012-03-15T15:49:36.110Z
2012-03-15T18:36:33.347Z
2017-04-13T12:47:33.283Z
Stéphane Gimenez
<p>The logic behind mining Bitcoins is similar to the one behind all the security features used in all currencies - to prevent people from counterfeiting them.</p>

<p>Traditional money uses special fabric, paint, serial numbers and highly detailed design patterns to prevent people from making their own copies and thus flooding the market. If you'd get rid of all that, anyone could write down "10$" on a piece of paper and use it as currency.</p>

<p>With Bitcoin, the problem is a bit harder - as there is no central authority, mining was chosen to be the way for money to be created and transferred. The cryptographic problem that is being solved with each new block is a proof that someone went through the effort of mining that particular block. The process of legitimately creating Bitcoin takes both time and computing power and counterfeiting Bitcoin takes roughly the same amount of work, encouraging people to be fair.</p>

<p>Without mining we would either need a central authority to manage the amount of created Bitcoins and how they are transferred (which defeats the purpose of a decentralised cryptocurrency), or we would be stuck with worthless bits that anyone could make in any amount.</p>

CC BY-SA 3.0
2012-03-16T22:32:06.957Z
2012-03-16T22:32:06.957Z
ThePiachu
<p>Bitcoin cleverly combines two functions via mining:</p>

<ol>
<li>Ensuring an "equitable" distribution of currency during the (current) generation phase of the Bitcoin economy.</li>
<li>Providing a secure distributed time-stamping function to provide a trusted ordering of all Bitcoin transactions.</li>
</ol>

<p>The creator of Bitcoins realized that there would have to be some way to get Bitcoins into circulation.  Since it is decentralized, he did not want to issue coins from a central authority.  So, he enticed others to "mine" for Bitcoins by exchanging computation power for Bitcoins.  The mining process is quite similar to a lottery, where you buy "tickets" by computing hashes; the more hashes you compute, the more likely you are to win 50 Bitcoins.</p>

<p>This scheme has the economic benefit that value is not created out of thin air - Bitcoin miners have to trade one valuable resource (their computing time and energy), in exchange for another (Bitcoins).  This helps establish a correlation between a "real world" value, and the value of a Bitcoin.</p>

<p>It just so happens that mining also is used to establish a well defined ordering of Bitcoin transactions; so we kill two birds with one stone, and provide incentives for people to contribute resources to keep the Bitcoin network operating.</p>

CC BY-SA 3.0
2013-11-13T00:48:52.453Z
The genius of mining and the block reward is that it provides an incentive for people to provide enough proof of work to keep Bitcoin payments secure before transaction fees will be valuable enough to do it on their own. Otherwise, someone would have had to bankroll the Bitcoin system or it would have been insecure.
David Schwartz
CC BY-SA 3.0
2012-03-17T18:29:25.630Z
2012-03-17T18:29:25.630Z
mckoss
<p>Bitcoin mining is the process of adding transaction records to Bitcoin's public ledger of past transactions or blockchain. This ledger of past transactions is called the block chain as it is a chain of blocks.</p>

<p>Bitcoin 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.</p>

<p>The primary purpose of mining is to allow Bitcoin nodes to reach a secure, tamper-resistant consensus. 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.</p>

<p>Miners do expensive computation to solve puzzle and they broadcast it over the network. It contains a number called nonce which can be used to easily verify that actual work was done. This is called proof of work. The solution takes lot of trials and is computationally difficult but it can be easily verified by other nodes on network. Any evesdropper, if tries to alter any block or transactions, will need to do alter all following blocks in blockchain that will get exponentially difficult. Thus it makes alterations in block impossible and a secure and tamper resistant ledger is created on blockchain.</p>

CC BY-SA 4.0
2018-05-13T12:55:01.990Z
2018-05-13T12:55:01.990Z
user2203937
<p>The term "money doesnt grow on trees" springs to mind. Ask yourself these questions for now.</p>

<ol>
<li>Where do we distribute wealth?</li>
<li>What gives it value?</li>
<li>How can we stop people making forgeries?</li>
</ol>

<p>All these problems can be resolved by requiring complex computational algorithms that require you (or your hardware as the case may be) to work out.</p>

<p>Using cryptography we can use a distributed system, give it rarity due to the supply at which they can be created and highly improbable for someone to make a forgery (or double spend a transaction in this case).</p>

<p>These are only a few of the possible scenarios which rely on cryptography to solve problems with Bitcoin. </p>

CC BY-SA 3.0
2012-03-15T15:48:07.643Z
Thanks for your answer.
I think i need more time to process this, but im loving this project.
Pascual
CC BY-SA 3.0
2012-03-15T15:57:42.997Z
This answer is definitely misleading and unaware of the workings of bitcoin.
Stéphane Gimenez
CC BY-SA 3.0
2012-03-15T16:51:21.260Z
It was ment as a high level concept. Judging by the question it was not looking for an ovely technical answer on the working of the network.
MaxSan
CC BY-SA 3.0
2012-03-15T15:23:33.630Z
2012-03-16T16:49:28.060Z
2012-03-16T16:49:28.060Z
MaxSan
<p>I don't understand the logic of "mining", if bitcoins are a digital currency, why do we need a GPU to "make 'em"?</p>

CC BY-SA 3.0
2012-03-17T22:05:19.267Z
Similar question: [What exactly is Mining?](http://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining)
D.H.
<mining-theory><money-supply>
What is the rationale behind Bitcoin mining?
Pascual
# What is the rationale behind Bitcoin mining?

(Asked by: username_0 on 2012-03-15)

I don't understand the logic of "mining", if bitcoins are a digital currency, why do we need a GPU to "make 'em"?

**Tags:** mining-theory, money-supply

> **Comments:**
> **username_1**: Similar question: [What exactly is Mining?](http://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining)  

---

## 6 answers

### Answer by username_2 on 2012-03-15. Score: 8

## Why do we mine?

We need to all agree on who owns which coins. If your idea of who owns what is different than mine then how can we trade?

To achieve this, the Bitcoin protocol keeps its ledger of all transactions in a series of blocks, with each block recording a collection of transactions. Since we don't have a central authority to declare which blocks are valid, we run a 'lottery' instead.

Each miner bundles up all the new transactions he knows about, adds in an extra transaction which creates some coins out of thin air and pays them to the miner, mixes in a random number and hashes the whole thing. If he gets a hash less than a certain number, he wins and his block is added to the blockchain. If not, he tries with a different random number, over and over. Everyone else can verify that his random number with his transactions hashes to a low enough number, so they accept his block. The network periodically adjusts what this target "low enough number" is, in an attempt to keep the average speed of block generation at about 10 minutes.

## Why do we need a GPU, not a CPU?

You generate coins by calculating hashes. Each hash you calculate has a certain chance of making a block, and earning the associated reward, which is currently 50 coins. The faster you can calculate hashes, the more chance you have of generating 50 coins. It just so happens that ATI GPUs have the right kind of hardware in them to calculate sha256 hashes many times faster than an Intel CPU can do it. That's why people use GPUs instead of CPUs.

The Bitcoin network automatically adjusts the "chance per hash" to try to keep the global rate of generation at one block every ten minutes.

In the beginning, before GPU mining started in earnest and not many people were mining, CPU mining worked just fine. But as more people joined the network and hash rates became faster, the network difficulty increased to keep the blocks coming along every 10 minutes or so. As a result, CPU mining became less rewarding per CPU.

Then when it became more common for miners to use GPU hardware to mine because it is so much faster and more energy efficient than CPU mining, the global network hash rate increased still further eventually making it completely useless to mine with a CPU; the expected rewards are less than the power consumed by the CPU.

Maybe one day [FPGAs](http://en.wikipedia.org/wiki/Field-programmable_gate_array) or [ASICs](http://en.wikipedia.org/wiki/Application-specific_integrated_circuit) username_4 render GPUs useless for mining, like GPUs already did to CPUs.

> **Comments:**
> **username_3**: I'd avoid phrases like "before GPU mining had even been thought of". In all likelihood, it was clear that GPUs would be better for the task even before the genesis block was generated. Contrary to popular belief, Bitcoin didn't invent GPGPU.  
> **username_4**: Thanks for this explanation, but could you also tell us why the hash needs to be less than a certain number?  
> **username_2**: "network difficulty increases to keep the blocks coming along every 10 minutes or so".  If there wasn't some kind of criterion to decide which blocks are valid there would be thousands of blocks made per second.  The "less than x" is to make it hard enough to find a block that on average they are found only once every 10 minutes.  
> **username_2**: @username_4 This sentence in the answer should answer that for you: 'The network periodically adjusts what this target "low enough number" is, in an attempt to keep the average speed of block generation at about 10 minutes.'  It's just an arbitrary way of making it 'just hard enough' to find a block.  
> **username_5**: "Maybe one day FPGAs or ASICs username_4 render GPUs useless for mining" - and the day has come.  

---

### Answer by username_6 on 2012-03-15. Score: 2

Bitcoin blocks have been **deliberately** made difficult to mine. The point is:

1. To prevent the network to be flooded with a ton of valid blocks that have to be checked for validity and stored. (The difficulty to mine them is *dynamically* adjusted so that in average, worldwide, one block is generated every 10 minutes.)
2. Also, this gives time for newly created blocks to spread across the network. Typical millisecond latencies can then be ignored. If latencies were not negligible, the mining 'game' would be unfair to poorly connected miners.

And to finish answering your question, the purpose of mining is **not** to distribute coins, but to collectively build a reference transaction history. Coin distribution is just a reward to those who participate. Please refer to [How does the mining process support the currency?](https://bitcoin.stackexchange.com/questions/910)

> **Comments:**
> **username_7**: It wasnt made deliberatelydifficult. Its difficulty is a result of the size of the network to keep it proportional.  
> **username_6**: Stop the nonsense please.  
> **username_8**: And (maybe most importantly) 3: To make it impossible for any one party to create a majority of blocks. With hash mining, you can only expect to get a number of blocks representing your fraction of computing power *across the whole network*. That way the block chain ends up with a transaction ordering that the whole network agrees on, and sustaining a network fork over a long time becomes practically impossible.  
> **username_8**: And maybe 4: Since hashing is so difficult that block generation is spread "evenly" across miners, this process can be used to generate new coins (mining) and distribute them across all invested participants (as opposed to having started with 21 million coins up-front sitting all in Satoshi's wallet).  

---

### Answer by username_9 on 2012-03-16. Score: 2

The logic behind mining Bitcoins is similar to the one behind all the security features used in all currencies - to prevent people from counterfeiting them.

Traditional money uses special fabric, paint, serial numbers and highly detailed design patterns to prevent people from making their own copies and thus flooding the market. If you'd get rid of all that, anyone could write down "10$" on a piece of paper and use it as currency.

With Bitcoin, the problem is a bit harder - as there is no central authority, mining was chosen to be the way for money to be created and transferred. The cryptographic problem that is being solved with each new block is a proof that someone went through the effort of mining that particular block. The process of legitimately creating Bitcoin takes both time and computing power and counterfeiting Bitcoin takes roughly the same amount of work, encouraging people to be fair.

Without mining we would either need a central authority to manage the amount of created Bitcoins and how they are transferred (which defeats the purpose of a decentralised cryptocurrency), or we would be stuck with worthless bits that anyone could make in any amount.


---

### Answer by username_10 on 2012-03-17. Score: 1

Bitcoin cleverly combines two functions via mining:

1. Ensuring an "equitable" distribution of currency during the (current) generation phase of the Bitcoin economy.
2. Providing a secure distributed time-stamping function to provide a trusted ordering of all Bitcoin transactions.

The creator of Bitcoins realized that there would have to be some way to get Bitcoins into circulation. Since it is decentralized, he did not want to issue coins from a central authority. So, he enticed others to "mine" for Bitcoins by exchanging computation power for Bitcoins. The mining process is quite similar to a lottery, where you buy "tickets" by computing hashes; the more hashes you compute, the more likely you are to win 50 Bitcoins.

This scheme has the economic benefit that value is not created out of thin air - Bitcoin miners have to trade one valuable resource (their computing time and energy), in exchange for another (Bitcoins). This helps establish a correlation between a "real world" value, and the value of a Bitcoin.

It just so happens that mining also is used to establish a well defined ordering of Bitcoin transactions; so we kill two birds with one stone, and provide incentives for people to contribute resources to keep the Bitcoin network operating.

> **Comments:**
> **username_11**: The genius of mining and the block reward is that it provides an incentive for people to provide enough proof of work to keep Bitcoin payments secure before transaction fees username_4 be valuable enough to do it on their own. Otherwise, someone would have had to bankroll the Bitcoin system or it would have been insecure.  

---

### Answer by username_12 on 2018-05-13. Score: 1

Bitcoin mining is the process of adding transaction records to Bitcoin's public ledger of past transactions or blockchain. This ledger of past transactions is called the block chain as it is a chain of blocks.

Bitcoin 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 allow Bitcoin nodes to reach a secure, tamper-resistant consensus. 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.

Miners do expensive computation to solve puzzle and they broadcast it over the network. It contains a number called nonce which can be used to easily verify that actual work was done. This is called proof of work. The solution takes lot of trials and is computationally difficult but it can be easily verified by other nodes on network. Any evesdropper, if tries to alter any block or transactions, username_4 need to do alter all following blocks in blockchain that username_4 get exponentially difficult. Thus it makes alterations in block impossible and a secure and tamper resistant ledger is created on blockchain.


---

### Answer by username_7 on 2012-03-15. Score: -3

The term "money doesnt grow on trees" springs to mind. Ask yourself these questions for now.

1. Where do we distribute wealth?
2. What gives it value?
3. How can we stop people making forgeries?

All these problems can be resolved by requiring complex computational algorithms that require you (or your hardware as the case may be) to work out.

Using cryptography we can use a distributed system, give it rarity due to the supply at which they can be created and highly improbable for someone to make a forgery (or double spend a transaction in this case).

These are only a few of the possible scenarios which rely on cryptography to solve problems with Bitcoin.

> **Comments:**
> **username_0**: Thanks for your answer. I think i need more time to process this, but im loving this project.  
> **username_6**: This answer is definitely misleading and unaware of the workings of bitcoin.  
> **username_7**: It was ment as a high level concept. Judging by the question it was not looking for an ovely technical answer on the working of the network.  

---

