<p><a href="https://en.bitcoin.it/wiki/How_bitcoin_works#Bitcoin_mining">Mining</a> is just doing computational work to secure the transaction block chain. A side effect of mining is creation of new coins and earning additional money by signing on transactions.</p>

CC BY-SA 3.0
2011-08-30T23:48:07.857Z
2011-08-30T23:48:07.857Z
ripper234
<p><strong><em>mining</em> is doing the <em>work</em> of finding <em>nonce</em> so that <em>sha256(sha256(data+nonce)) &lt; difficulty</em></strong></p>

<p>where</p>

<ul>
<li><em>nonce</em> is an integer number the miner chooses freely (this choosing of the nonce and checking if the condition (<em>&lt; difficulty</em>) is met comprises the <em>work</em></li>
<li><em>data</em> is a hash over the contents of the block (transactions) and the previous block's hash</li>
<li><em>sha256()</em> is the SHA-256 cryptographic hashing function (<a href="http://en.wikipedia.org/wiki/SHA-2">wikpedia SHA-2 article</a>)</li>
<li><em>difficulty</em> is a value that is adjusted consensually by the nodes of the bitcoin network to adjust for change in network computation power in order to have one block every 10 minutes found by the network</li>
</ul>

<p>The resulting <em>nonce</em> is the <em>proof of work</em>: since it's impossible to find <em>nonce</em> without essentially trying different <em>nonces</em> and calculating the two hash functions, having found a <em>nonce</em> that satisfies the condition is proof this <em>work</em> of searching and calculating has in fact been done. </p>

<p>This is the central idea behind Bitcoin to solve the double spending problem: due to the inclusion of the previous block's hash in <em>data</em> (this links the blocks to form a chain) and the fact that the honest nodes of the network always do their <em>work</em> on the longest chain of blocks, a <a href="http://en.wikipedia.org/wiki/Double-spending">double spending</a> attack involves calculating (and later publishing) a forked block chain in secret that is longer than the "honest chain" (containing the transaction that should be undone). 
Due to the <em>work</em> required to do this, this race can only be won if the attacker has greater computation power than the rest of the network together. Since using such computation power to honestly mine is likely more profitable than pulling a double-spend, the incentive for doing a double-spend attack is low.</p>

CC BY-SA 3.0
2011-09-12T21:02:23.450Z
2016-09-20T10:58:44.983Z
2016-09-20T10:58:44.983Z
molecular
<p>Mining is the process of securing transactions and committing them into the bitcoin public chain. It requires winning a kind of computational lottery where each hash you perform is like buying one ticket. The Bitcoin protocol currently permits the miner who generates a block to claim 50 bitcoins as well as any transaction fees for the transactions that miner chooses to include. The number of bitcoins that can be claimed decreases by half every 210,000 blocks in what is known as &quot;halving&quot;.</p>
<p>The Bitcoin system uses the mining process to generate coins, secure transactions, and publish transactions.</p>

CC BY-SA 3.0
2016-10-23T14:41:46.467Z
The block reward is now 12.5 bitcoins.
Dheeraj Vepakomma
CC BY-SA 4.0
2020-06-27T10:16:26.000Z
The block reward is now 6.25 bitcoins.
Antoine Poinsot
CC BY-SA 4.0
2024-04-20T10:26:42.357Z
The block reward is now 3.125 bitcoins.
Vojtěch Strnad
CC BY-SA 3.0
2013-06-29T06:36:05.570Z
The block reward is now 25 bitcoins.
David Schwartz
CC BY-SA 4.0
2011-08-30T23:47:24.283Z
2024-01-03T11:56:50.850Z
2024-01-03T11:56:50.850Z
David Schwartz
<p>In more simple terms:
Actual mining means, you sweat digging something and then find some useful metals.
In bitcoin mining, your computer sweats calculating blocks and in return the bitcoin protocol gives you some bitcoins.</p>

<p>And in actual mining, you find precious metals which doesn't belong to anyone. Similarly, in bitcoin mining, the bitcoin protocol generates new bitcoins (Only upto 21 millions though) (which are not belonged to anybody) and gives you.</p>

<p>So the word "mining" makes perfect sense.</p>

CC BY-SA 3.0
2014-01-13T00:04:50.807Z
2014-01-13T00:04:50.807Z
ghalways
<p>The answers in this section all present different, useful perspectives.  Another useful, but non-technical perspective is:</p>

<p>Mining is a battle between those who want to see Bitcoin succeed for the greater good, and those who don't care if it is destroyed as long as they achieve some victory, even if only to be part of the destruction (they might not get any BTCs from their destructive efforts).</p>

<p>In other words, Bitcoin is a fascinating attempt to establish an alternate money system.  Since the P2P, decentralised architecture is integral to its success it is, by design, open to any participant.  The mining process assumes that some participants are evil.  It pitches 'good' against 'evil' in the hope that 'good' will continue to succeed and maintain the integrity of the network.</p>

CC BY-SA 3.0
2013-04-11T05:12:22.677Z
2013-04-11T05:12:22.677Z
user4020
<p>Bitcoin <strong>mining</strong> 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>

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

CC BY-SA 4.0
2018-05-13T20:14:22.663Z
2018-05-13T20:14:22.663Z
user2203937
<p>Mining is just running a application on your computer to confirm the transactions of the crypto currency for which you get paid as fees.</p>

<p>I will say mining is the soul of crypto currency, according to today's scenario everyone creating new coin everyday but some of them goes to the moon and some of them just vanish in a couple of weeks, why? because a coin is alive until there are people to mine it. Take a example of a coin which has only 100 miners and you bought 1000 such coins after a few days miners stopped mining that coin, now you cannot sell that coin to anyone even if you have a potential buyer, why? because your transaction will not confirm until there are people mining that coin. The price of coins go up because of mining, why? because as many miners start mining the currency the difficulty increases, with the increase of difficulty mining coins will take more time, more miners more demand less coins. Increment in rates.</p>

CC BY-SA 3.0
2014-01-12T22:57:03.003Z
2014-01-12T22:57:03.003Z
Khan Shahrukh
<p>Miners maintain the immutability property of the blockchain. Proof-of-work makes it so that the cost to &quot;undo&quot; any mined transaction will grow with time. Miners get paid for this service: with block reward subsidy &amp; user's transaction fees.</p>
<p>You can think of transactions as <a href="https://bitcoin.stackexchange.com/questions/63556/is-a-wallet-simply-a-folder-of-private-keys/115830#115830">destroying bills and creating new bills of total same value</a>. Nodes maintain a current database of active bills, and will reject a transaction trying to use an old bill. That's the double-spend check. It requires look-up / delete / insert operations with the UTXO database.</p>
<p>Popular belief is that miners get paid for the job of verifying and assembling transactions into blocks, but that is wrong. That is a job any node is capable of doing and it doesn't cost them much. Your RPi node can assemble transactions into a &quot;block template&quot;, but it just can't fill in the 1 blank that will satisfy the last consensus rule it needs to satisfy to be a valid block - the PoW difficulty check. <strong>That's why you can't simply kick out one block and replace it with another, because finding that nonce takes time. PoW's purpose is to increase the cost of undo.</strong></p>
<p>Miners get paid for the job of filling in the nonce that will produce a satisfying block header hash, they get paid for the hashes because the only way to find a satisfying nonce is to make lots of guesses and hash the guesses. The network essentially bids for the hashes with block reward subsidy and users bid for the hashes with their transaction fees, and the more total reward the more secure the whole network becomes* since the cost of &quot;undoing&quot; a block will be bigger because difficulty will grow higher.
(*assuming constant price)</p>
<p>Each transaction is a business transaction with a miner, they're the recipient of the implicit output (the fee), which is a payment from user for the service of maintaining the immutability property of the ledger! Of course miners would include their own business transactions into blocks they create!</p>
<p>During the early days of Bitcoin, nodes did all these jobs:</p>
<ol>
<li>Verified incoming transactions and blocks</li>
<li>Made their own transactions and broadcast them to the network</li>
<li>Assembled transactions into a block template (full block, with just the nonce missing)</li>
<li>Filled in the nonce to make the block header pass the PoW check</li>
</ol>
<p>Since then, the jobs have been separated.</p>
<p>Now it's mostly pools who do 1-3, and &quot;miners&quot; are just blindly doing the 4.: getting 80 bytes of block header from the pool and grinding the nonce. How do the miners verify what they're mining? Well, they have to get paid eventually, right?</p>
<p>Miners get paid their reward from the pool, so to independently verify they're getting paid correctly in proportion to their work, they also need to have some regular node, which can be off-site and doesn't need to be involved in mining! In that case they run a node to verify they themselves got paid for some past work in the right currency! This gives pools the power to direct hash-power of many as they like, but the pool can't really hide what they're doing, so everyone's on good behavior.</p>
<p>Note that &quot;miners&quot; are not exclusive to a single blockchain network. All Bitcoin miners are sha256d miners, but not all sha256d miners are Bitcoin miners! The era of one blockchain is long gone. Networks bid for the hashes, miners sell the hashes.</p>
<p>What happens if a subset of nodes changes the rules? All nodes under old rules will reject changed rules, and all nodes with changed rules will reject old rules. This happened in 2017 with the BCH fork. If both will be mined, then both will continue to exist independently.
Which will get more hashes? It will depend on market price.</p>
<p>Miners pay for their energy usage and hardware in some external currency, they have to exchange it to pay the bills. If they can exchange the blockchain's native currency (BTC, BCH) for the cost currency (USD, CNY), and still have something left -- then they can make a profit. Their profit depends on there being liquidity for the native currency and the native currency having value! So they don't just arbitrarily decide which network to mine. They have strong incentive to get a ROI on their hardware, and optimal mining is to mine ALL networks which have a liquid market for the rewards, and in proportion to market value of their block rewards.</p>

CC BY-SA 4.0
2024-01-03T13:05:33.347Z
2024-01-03T13:05:33.347Z
bca-0353f40e
<p><strong>Bitcoin mining</strong> is the process by which new bitcoins are created and transactions are verified and added to the public ledger, known as the blockchain. It involves solving complex mathematical puzzles using computer hardware, such as specialized mining devices called Application-Specific Integrated Circuit (ASIC) miners or graphics processing units (GPUs).</p>
<p>Here's a brief overview of how Bitcoin mining works:</p>
<p>Miners collect and validate recent Bitcoin transactions into a data structure called a block.
Miners then compete to find a solution to a complex mathematical problem, called the proof-of-work algorithm, which is based on the block's content and the previous block's unique hash.
The first miner to find the solution, or the valid hash, broadcasts it to the network.
Other miners verify the solution, and if it's correct, they add the block to their version of the blockchain.
The miner who found the valid hash is rewarded with a certain number of newly created bitcoins (called the block reward) and transaction fees from the transactions included in the block.
The process repeats roughly every 10 minutes for each new block.
Bitcoin mining serves two purposes: it creates new bitcoins in a controlled and predictable manner, and it secures the network by validating transactions and maintaining a decentralized consensus.</p>
<p>The mining process is designed to become more difficult over time as the total number of bitcoins in existence approaches its maximum limit of 21 million. This increasing difficulty helps maintain the 10-minute block interval and ensures that the network remains secure as more miners join the system.</p>
<p>It's important to note that Bitcoin mining consumes a significant amount of electricity, which has led to concerns about its environmental impact. Consequently, there is ongoing debate about potential changes to the mining process to make it more energy-efficient or to explore alternative consensus mechanisms.</p>

CC BY-SA 4.0
2023-10-20T20:12:28.917Z
1. Bitcoin mining does not involve “solving complex mathematical puzzles”. It involves making an astronomical number of attempts at guessing a number that leads to a valid block. 2. GPU mining has not been profitable in Bitcoin since ~2013. 3. Mining doesn’t validate transactions, every node validates transactions when they add them to their mempool. Miners just build blocks from what is in their mempools.
Murch
CC BY-SA 4.0
2023-04-26T11:49:48.353Z
2023-04-26T11:49:48.353Z
BBCD Satoshi
<p>David Schwartz's answer is entirely accurate, but all that "bitspeak" might be a little intimidating to the average user.  Let me try and put it into more plain language:</p>

<p>The way Bitcoin works is that instead of having one central authority who secures and controls the money supply (like most governments do for their national currencies), this work is spread out all across the network.  <strong>Most of the heavy lifting for Bitcoin is done by "miners".</strong></p>

<p>Miners collect the transactions on the network (like "Alice pays Karim 10 bitcoins" and "Liam pays Sofia 8.3 bitcoins") into large bundles called <strong><a href="https://en.bitcoin.it/wiki/Block" rel="noreferrer">blocks</a></strong>.  These blocks are strung together into one continuous, authoritative record called the <strong><a href="https://en.bitcoin.it/wiki/Block_chain" rel="noreferrer">block chain</a></strong>, which doesn't permit any conflicting transactions.  This is necessary because without it people would be able to sign the same bitcoins over to <a href="http://en.wikipedia.org/wiki/Double-spending" rel="noreferrer">two different recipients</a>, like writing cheques for more money than you have in your account.  <strong>The block chain lets you know for sure exactly which transactions count and can be trusted</strong> (so no bad cheques!).</p>

<p>The way Bitcoin makes sure there is only one block chain is by making blocks really hard to produce.  So instead of just being able to make blocks at will, miners have to compute a <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="noreferrer">cryptographic hash</a> of the block that meets certain criteria.  Bitcoiners refer to this process as <strong>"hashing"</strong>.  The only way to find a cryptographic hash that's "good enough to count" is to try computing a whole bunch of them until you get lucky and find one that works.  This is the "lottery" that David Schwartz refers to, because miners who successfully create a block are <a href="https://bitcoin.stackexchange.com/questions/161/how-many-bitcoins-will-there-eventually-be">rewarded some bitcoins according to a preset schedule</a>.  The difficulty of the criteria for the hash is continually adjusted based on how frequently blocks are appearing, so <strong>more competition equals more work needed to find a block</strong>.  Modern dedicated mining hardware (e.g. ASIC miners) can try trillions of hashes per second, so to be competitive in this race to find hashes miners need specialised hardware, otherwise they will tend to spend more on electricity than they make in the "lottery".</p>

<p>In addition to the hash criteria, a block needs to contain only valid, non-conflicting transactions.  So <strong>the other main task for miners is to carefully validate all the transactions that go into their blocks</strong>, otherwise they won't get any reward for their work!</p>

<p>Because of all this work, when a Bitcoin client signs on to the network it can trust the block chain that was most difficult to produce (since this is evidently the one that was being worked on by the most miners).  If there was a "fake" blockchain competing with the real ones (say, where someone pretends that they didn't <em>actually</em> give Sofia those 8.4 bitcoins and they still have them), the fraudster would have to do as much work as the whole rest of the network to make their block chain look as trustworthy.  So essentially, <strong>the intense work that goes into finding blocks through hashing secures the network against fraud</strong>.  There is also, of course, some nifty code that figures out how to choose between conflicting transactions; and what to do if two people find valid blocks at the same time.</p>

<p>One last thing:  <strong>why is it called mining?</strong>  In the original analogy, people who performed this essential work were compared to gold miners digging the gold out of the ground so that everyone could use it.  But in reality, Bitcoin "miners" are just running computer programs on very specialised hardware that automates the process of securing the network.  To sum up, this software</p>

<ul>
<li><strong>Collects transactions from the network</strong></li>
<li><strong>Validates them, and doesn't allow conflicting ones</strong></li>
<li><strong>Puts them into large bundles called <a href="https://en.bitcoin.it/wiki/Block" rel="noreferrer">blocks</a></strong></li>
<li><strong>Computes <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="noreferrer">cryptographic hashes</a> over and over until if finds one "good enough to count"</strong></li>
<li><strong>Then submits the block to the network, adding it to the block chain and earning a reward in return</strong>.</li>
</ul>

<p><strong>That's mining in a nutshell!</strong></p>

CC BY-SA 4.0
2011-09-08T14:53:05.110Z
2018-11-07T13:41:33.490Z
2018-11-07T13:41:33.490Z
eMansipater
<p>I have heard that mining is for people with ready hardware and blah blah blah... But what exactly is it? Does it operate like real mining? I mean, people talk about it like you are <em>physically</em> mining.</p>

<mining-reward><proof-of-work><mining-theory>
What exactly is Mining?
Phonics The Hedgehog
# What exactly is Mining?

(Asked by: username_0 on 2011-08-30)

I have heard that mining is for people with ready hardware and blah blah blah... But what exactly is it? Does it operate like real mining? I mean, people talk about it like you are *physically* mining.

**Tags:** mining-reward, proof-of-work, mining-theory


---

## 10 answers

### Answer by username_14 on 2011-09-08. Score: 235 | Accepted answer

username_3 username_3's answer is entirely accurate, but all that "bitspeak" might be a little intimidating to the average user. Let me try and put it into more plain language:

The way Bitcoin works is that instead of having one central authority who secures and controls the money supply (like most governments do for their national currencies), this work is spread out all across the network. **Most of the heavy lifting for Bitcoin is done by "miners".**

Miners collect the transactions on the network (like "Alice pays Karim 10 bitcoins" and "Liam pays Sofia 8.3 bitcoins") into large bundles called **[blocks](https://en.bitcoin.it/wiki/Block)**. These blocks are strung together into one continuous, authoritative record called the **[block chain](https://en.bitcoin.it/wiki/Block_chain)**, which doesn't permit any conflicting transactions. This is necessary because without it people would be able to sign the same bitcoins over to [two different recipients](http://en.wikipedia.org/wiki/Double-spending), like writing cheques for more money than you have in your account. **The block chain lets you know for sure exactly which transactions count and can be trusted** (so no bad cheques!).

The way Bitcoin makes sure there is only one block chain is by making blocks really hard to produce. So instead of just being able to make blocks at will, miners have to compute a [cryptographic hash](http://en.wikipedia.org/wiki/Cryptographic_hash_function) of the block that meets certain criteria. Bitcoiners refer to this process as **"hashing"**. The only way to find a cryptographic hash that's "good enough to count" is to try computing a whole bunch of them until you get lucky and find one that works. This is the "lottery" that username_3 username_3 refers to, because miners who successfully create a block are [rewarded some bitcoins according to a preset schedule](https://bitcoin.stackexchange.com/questions/161/how-many-bitcoins-will-there-eventually-be). The difficulty of the criteria for the hash is continually adjusted based on how frequently blocks are appearing, so **more competition equals more work needed to find a block**. Modern dedicated mining hardware (e.g. ASIC miners) can try trillions of hashes per second, so to be competitive in this race to find hashes miners need specialised hardware, otherwise they will tend to spend more on electricity than they make in the "lottery".

In addition to the hash criteria, a block needs to contain only valid, non-conflicting transactions. So **the other main task for miners is to carefully validate all the transactions that go into their blocks**, otherwise they won't get any reward for their work!

Because of all this work, when a Bitcoin client signs on to the network it can trust the block chain that was most difficult to produce (since this is evidently the one that was being worked on by the most miners). If there was a "fake" blockchain competing with the real ones (say, where someone pretends that they didn't *actually* give Sofia those 8.4 bitcoins and they still have them), the fraudster would have to do as much work as the whole rest of the network to make their block chain look as trustworthy. So essentially, **the intense work that goes into finding blocks through hashing secures the network against fraud**. There is also, of course, some nifty code that figures out how to choose between conflicting transactions; and what to do if two people find valid blocks at the same time.

One last thing: **why is it called mining?** In the original analogy, people who performed this essential work were compared to gold miners digging the gold out of the ground so that everyone could use it. But in reality, Bitcoin "miners" are just running computer programs on very specialised hardware that automates the process of securing the network. To sum up, this software

* **Collects transactions from the network**
* **Validates them, and doesn't allow conflicting ones**
* **Puts them into large bundles called [blocks](https://en.bitcoin.it/wiki/Block)**
* **Computes [cryptographic hashes](http://en.wikipedia.org/wiki/Cryptographic_hash_function) over and over until if finds one "good enough to count"**
* **Then submits the block to the network, adding it to the block chain and earning a reward in return**.

**That's mining in a nutshell!**


---

### Answer by username_2 on 2011-09-12. Score: 110

***mining* is doing the *work* of finding *nonce* so that *sha256(sha256(data+nonce)) < difficulty***

where

* *nonce* is an integer number the miner chooses freely (this choosing of the nonce and checking if the condition (*< difficulty*) is met comprises the *work*
* *data* is a hash over the contents of the block (transactions) and the previous block's hash
* *sha256()* is the SHA-256 cryptographic hashing function ([wikpedia SHA-2 article](http://en.wikipedia.org/wiki/SHA-2))
* *difficulty* is a value that is adjusted consensually by the nodes of the bitcoin network to adjust for change in network computation power in order to have one block every 10 minutes found by the network

The resulting *nonce* is the *proof of work*: since it's impossible to find *nonce* without essentially trying different *nonces* and calculating the two hash functions, having found a *nonce* that satisfies the condition is proof this *work* of searching and calculating has in fact been done.

This is the central idea behind Bitcoin to solve the double spending problem: due to the inclusion of the previous block's hash in *data* (this links the blocks to form a chain) and the fact that the honest nodes of the network always do their *work* on the longest chain of blocks, a [double spending](http://en.wikipedia.org/wiki/Double-spending) attack involves calculating (and later publishing) a forked block chain in secret that is longer than the "honest chain" (containing the transaction that should be undone).
Due to the *work* required to do this, this race can only be won if the attacker has greater computation power than the rest of the network together. Since using such computation power to honestly mine is likely more profitable than pulling a double-spend, the incentive for doing a double-spend attack is low.


---

### Answer by username_3 on 2011-08-30. Score: 58

Mining is the process of securing transactions and committing them into the bitcoin public chain. It requires winning a kind of computational lottery where each hash you perform is like buying one ticket. The Bitcoin protocol currently permits the miner who generates a block to claim 50 bitcoins as well as any transaction fees for the transactions that miner chooses to include. The number of bitcoins that can be claimed decreases by half every 210,000 blocks in what is known as "halving".

The Bitcoin system uses the mining process to generate coins, secure transactions, and publish transactions.

> **Comments:**
> **username_3**: The block reward is now 25 bitcoins.  
> **username_4**: The block reward is now 12.5 bitcoins.  
> **username_5**: The block reward is now 6.25 bitcoins.  
> **username_6**: The block reward is now 3.125 bitcoins.  

---

### Answer by username_1 on 2011-08-30. Score: 16

[Mining](https://en.bitcoin.it/wiki/How_bitcoin_works#Bitcoin_mining) is just doing computational work to secure the transaction block chain. A side effect of mining is creation of new coins and earning additional money by signing on transactions.


---

### Answer by username_7 on 2014-01-13. Score: 4

In more simple terms:
Actual mining means, you sweat digging something and then find some useful metals.
In bitcoin mining, your computer sweats calculating blocks and in return the bitcoin protocol gives you some bitcoins.

And in actual mining, you find precious metals which doesn't belong to anyone. Similarly, in bitcoin mining, the bitcoin protocol generates new bitcoins (Only upto 21 millions though) (which are not belonged to anybody) and gives you.

So the word "mining" makes perfect sense.


---

### Answer by username_8 on 2013-04-11. Score: 1

The answers in this section all present different, useful perspectives. Another useful, but non-technical perspective is:

Mining is a battle between those who want to see Bitcoin succeed for the greater good, and those who don't care if it is destroyed as long as they achieve some victory, even if only to be part of the destruction (they might not get any BTCs from their destructive efforts).

In other words, Bitcoin is a fascinating attempt to establish an alternate money system. Since the P2P, decentralised architecture is integral to its success it is, by design, open to any participant. The mining process assumes that some participants are evil. It pitches 'good' against 'evil' in the hope that 'good' will continue to succeed and maintain the integrity of the network.


---

### Answer by username_9 on 2018-05-13. Score: 0

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

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.


---

### Answer by username_10 on 2014-01-12. Score: 0

Mining is just running a application on your computer to confirm the transactions of the crypto currency for which you get paid as fees.

I will say mining is the soul of crypto currency, according to today's scenario everyone creating new coin everyday but some of them goes to the moon and some of them just vanish in a couple of weeks, why? because a coin is alive until there are people to mine it. Take a example of a coin which has only 100 miners and you bought 1000 such coins after a few days miners stopped mining that coin, now you cannot sell that coin to anyone even if you have a potential buyer, why? because your transaction will not confirm until there are people mining that coin. The price of coins go up because of mining, why? because as many miners start mining the currency the difficulty increases, with the increase of difficulty mining coins will take more time, more miners more demand less coins. Increment in rates.


---

### Answer by username_11 on 2024-01-03. Score: 0

Miners maintain the immutability property of the blockchain. Proof-of-work makes it so that the cost to "undo" any mined transaction will grow with time. Miners get paid for this service: with block reward subsidy & user's transaction fees.

You can think of transactions as [destroying bills and creating new bills of total same value](https://bitcoin.stackexchange.com/questions/63556/is-a-wallet-simply-a-folder-of-private-keys/115830#115830). Nodes maintain a current database of active bills, and will reject a transaction trying to use an old bill. That's the double-spend check. It requires look-up / delete / insert operations with the UTXO database.

Popular belief is that miners get paid for the job of verifying and assembling transactions into blocks, but that is wrong. That is a job any node is capable of doing and it doesn't cost them much. Your RPi node can assemble transactions into a "block template", but it just can't fill in the 1 blank that will satisfy the last consensus rule it needs to satisfy to be a valid block - the PoW difficulty check. **That's why you can't simply kick out one block and replace it with another, because finding that nonce takes time. PoW's purpose is to increase the cost of undo.**

Miners get paid for the job of filling in the nonce that will produce a satisfying block header hash, they get paid for the hashes because the only way to find a satisfying nonce is to make lots of guesses and hash the guesses. The network essentially bids for the hashes with block reward subsidy and users bid for the hashes with their transaction fees, and the more total reward the more secure the whole network becomes\* since the cost of "undoing" a block will be bigger because difficulty will grow higher.
(\*assuming constant price)

Each transaction is a business transaction with a miner, they're the recipient of the implicit output (the fee), which is a payment from user for the service of maintaining the immutability property of the ledger! Of course miners would include their own business transactions into blocks they create!

During the early days of Bitcoin, nodes did all these jobs:

1. Verified incoming transactions and blocks
2. Made their own transactions and broadcast them to the network
3. Assembled transactions into a block template (full block, with just the nonce missing)
4. Filled in the nonce to make the block header pass the PoW check

Since then, the jobs have been separated.

Now it's mostly pools who do 1-3, and "miners" are just blindly doing the 4.: getting 80 bytes of block header from the pool and grinding the nonce. How do the miners verify what they're mining? Well, they have to get paid eventually, right?

Miners get paid their reward from the pool, so to independently verify they're getting paid correctly in proportion to their work, they also need to have some regular node, which can be off-site and doesn't need to be involved in mining! In that case they run a node to verify they themselves got paid for some past work in the right currency! This gives pools the power to direct hash-power of many as they like, but the pool can't really hide what they're doing, so everyone's on good behavior.

Note that "miners" are not exclusive to a single blockchain network. All Bitcoin miners are sha256d miners, but not all sha256d miners are Bitcoin miners! The era of one blockchain is long gone. Networks bid for the hashes, miners sell the hashes.

What happens if a subset of nodes changes the rules? All nodes under old rules will reject changed rules, and all nodes with changed rules will reject old rules. This happened in 2017 with the BCH fork. If both will be mined, then both will continue to exist independently.
Which will get more hashes? It will depend on market price.

Miners pay for their energy usage and hardware in some external currency, they have to exchange it to pay the bills. If they can exchange the blockchain's native currency (BTC, BCH) for the cost currency (USD, CNY), and still have something left -- then they can make a profit. Their profit depends on there being liquidity for the native currency and the native currency having value! So they don't just arbitrarily decide which network to mine. They have strong incentive to get a ROI on their hardware, and optimal mining is to mine ALL networks which have a liquid market for the rewards, and in proportion to market value of their block rewards.


---

### Answer by username_12 on 2023-04-26. Score: -4

**Bitcoin mining** is the process by which new bitcoins are created and transactions are verified and added to the public ledger, known as the blockchain. It involves solving complex mathematical puzzles using computer hardware, such as specialized mining devices called Application-Specific Integrated Circuit (ASIC) miners or graphics processing units (GPUs).

Here's a brief overview of how Bitcoin mining works:

Miners collect and validate recent Bitcoin transactions into a data structure called a block.
Miners then compete to find a solution to a complex mathematical problem, called the proof-of-work algorithm, which is based on the block's content and the previous block's unique hash.
The first miner to find the solution, or the valid hash, broadcasts it to the network.
Other miners verify the solution, and if it's correct, they add the block to their version of the blockchain.
The miner who found the valid hash is rewarded with a certain number of newly created bitcoins (called the block reward) and transaction fees from the transactions included in the block.
The process repeats roughly every 10 minutes for each new block.
Bitcoin mining serves two purposes: it creates new bitcoins in a controlled and predictable manner, and it secures the network by validating transactions and maintaining a decentralized consensus.

The mining process is designed to become more difficult over time as the total number of bitcoins in existence approaches its maximum limit of 21 million. This increasing difficulty helps maintain the 10-minute block interval and ensures that the network remains secure as more miners join the system.

It's important to note that Bitcoin mining consumes a significant amount of electricity, which has led to concerns about its environmental impact. Consequently, there is ongoing debate about potential changes to the mining process to make it more energy-efficient or to explore alternative consensus mechanisms.

> **Comments:**
> **username_13**: 1. Bitcoin mining does not involve “solving complex mathematical puzzles”. It involves making an astronomical number of attempts at guessing a number that leads to a valid block. 2. GPU mining has not been profitable in Bitcoin since ~2013. 3. Mining doesn’t validate transactions, every node validates transactions when they add them to their mempool. Miners just build blocks from what is in their mempools.  

---

