https://github.com/jsarenik/halving
Understanding Bitcoin Halving
https://github.com/jsarenik/halving
bitcoin halving script shell
Last synced: about 2 months ago
JSON representation
Understanding Bitcoin Halving
- Host: GitHub
- URL: https://github.com/jsarenik/halving
- Owner: jsarenik
- Created: 2021-04-14T11:17:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-22T10:55:30.000Z (over 1 year ago)
- Last Synced: 2025-06-30T19:50:26.689Z (12 months ago)
- Topics: bitcoin, halving, script, shell
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Understanding Bitcoin Halving
The POSIX shell script `halving.sh` contains all the logic
needed to compute Bitcoin halving data in following format
per line:
For example:
5670000 37 2116
Read it like this: From block `5670000` the subsidy will be `37` satoshi
and it should happen approximately in year `2116`.
The `sum-sats.sh` and `sum-total.sh` scripts process the output of
`halving.sh`.
Examples:
$ ./sum-sats.sh
2099999997690000
$ ./sum-total.sh
99.99999989%
So eventually there will be almost 21 million bitcoin.
One bitcoin is one hundred million satoshi.
1 BTC = 100 000 000 sat
Not a single satoshi will ever disappear\*. The transaction
fees are mined by the miners and recycled this way. When
the subsidy will be 0, the miners will get _only_ the fees
paid by Bitcoin users in the transactions (a.k.a. reward).
\* There is actually a possibility that the miner
will not issue a coinbase transaction or will ask for less
than what they could (see first link in the end).
And there is a possibility the coins are burned in
a provable way using `OP_RETURN`.
## Links
* https://en.bitcoin.it/wiki/Controlled_supply
* https://blog.amberdata.io/why-the-bitcoin-supply-will-never-reach-21-million
* https://medium.com/amberdata/why-the-bitcoin-supply-will-never-reach-21-million-7263e322de1
* https://www.makeuseof.com/bitcoin-remove-21-million-coin-limit/
* https://finematics.com/bitcoin-halving-explained-code-analysis/
* https://bitcoinik.com/bitcoin-halving-code-explained/
* [listedreserve article](https://www.listedreserve.com/education/transactions-and-the-bitcoin-money-supply/)
* https://savingsatoshi.com/