<p>every detail of bitcoin can be changed by the developer by editing the source code. 21million was satoshi nakamotos design decision. afaik this number is not directly contained in the source-code. every ~10minutes a new block will be created. every 210000 (~every 4 years) blocks will the block reward be halved. so in many years (after many halvings) miner will not anymore really earn blockrewards because the blockrewards are approximately 0btc. => then virtually no new bitcoins will be created. that is why the entire amount of bitcoin is limited. (but the miner still earn the transaction-fees).</p>

CC BY-SA 3.0
2017-12-22T11:32:01.103Z
Does this mean transaction fees will increase going forward? On several youtube videos, bitcoin enthusiasts claim that bitcoin transactions can be made free of charge from one corner of the globe to another. Now I know that is false.
user781486
CC BY-SA 3.0
2017-12-22T11:33:54.943Z
this is a very good question. the user determine the fee for their transactions, not the miner. the miner have less profit after halvings. but they can not force the user to send higher fees. the problem is, that then some miner will stop mining because they would probably loose money caused by electricity costs. but this is a problem which will be acute in many years, not today.
anion
CC BY-SA 3.0
2017-12-22T11:35:07.587Z
If user sets the fees, everyone would put zero. There would be no incentive for the miners to mine. Sounds like a big problem is coming.
user781486
CC BY-SA 3.0
2017-12-22T12:07:15.387Z
Any deflationary coin will eventually have no mining reward other than transaction fees.  Users set a fee they're willing to pay.  There will always be miners willing to mine for a market-driven fee schedule.   If profitability is too low, eventually difficulty will decrease.  Theoretically it could decrease so low that we go back to mining on cheaper hardware.  It's all market driven. There's no big problem with this in my opinion.
dimsumcode
CC BY-SA 3.0
2017-12-22T11:29:19.360Z
2017-12-22T11:29:19.360Z
anion
<p>How is this number 21 million bitcoins arrived at? What is the mathematics behind this number? Or is this number a constant that can be changed in the source code?</p>

<bitcoin-core><bitcoin-core-development><math>
What is the mathematics behind the maximum number of 21 million bitcoins that can be generated?
user781486
# What is the mathematics behind the maximum number of 21 million bitcoins that can be generated?

(Asked by: username_0 on 2017-12-22)

How is this number 21 million bitcoins arrived at? What is the mathematics behind this number? Or is this number a constant that can be changed in the source code?

**Tags:** bitcoin-core, bitcoin-core-development, math


---

## 1 answers

### Answer by username_1 on 2017-12-22. Score: 3

every detail of bitcoin can be changed by the developer by editing the source code. 21million was satoshi nakamotos design decision. afaik this number is not directly contained in the source-code. every ~10minutes a new block will be created. every 210000 (~every 4 years) blocks will the block reward be halved. so in many years (after many halvings) miner will not anymore really earn blockrewards because the blockrewards are approximately 0btc. => then virtually no new bitcoins will be created. that is why the entire amount of bitcoin is limited. (but the miner still earn the transaction-fees).

> **Comments:**
> **username_0**: Does this mean transaction fees will increase going forward? On several youtube videos, bitcoin enthusiasts claim that bitcoin transactions can be made free of charge from one corner of the globe to another. Now I know that is false.  
> **username_1**: this is a very good question. the user determine the fee for their transactions, not the miner. the miner have less profit after halvings. but they can not force the user to send higher fees. the problem is, that then some miner will stop mining because they would probably loose money caused by electricity costs. but this is a problem which will be acute in many years, not today.  
> **username_0**: If user sets the fees, everyone would put zero. There would be no incentive for the miners to mine. Sounds like a big problem is coming.  
> **username_2**: Any deflationary coin will eventually have no mining reward other than transaction fees.  Users set a fee they're willing to pay.  There will always be miners willing to mine for a market-driven fee schedule.   If profitability is too low, eventually difficulty will decrease.  Theoretically it could decrease so low that we go back to mining on cheaper hardware.  It's all market driven. There's no big problem with this in my opinion.  

---

