Bitcoin Forum
May 11, 2024, 09:05:47 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Find out max supply just from github source code  (Read 196 times)
fratrad (OP)
Full Member
***
Offline Offline

Activity: 240
Merit: 100


View Profile
January 30, 2019, 10:24:10 AM
 #1

Hi, is there a way how I can find out the max supply of on altcoin (SHA256) just from searching in the source code?

https://github.com/Infernoman/C-Bit

Thanks in advance
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
January 30, 2019, 10:30:22 AM
Merited by OgNasty (2), pooya87 (1), mk4 (1), o_e_l_e_o (1)
 #2

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/chainparams.cpp#L73
Halving interval = each 210.000 blocks

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/chainparams.cpp#L81
Average time between 2 blocks = 60* 10 seconds (10 minutes)

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/main.cpp#L1729
subsidy = 500 coins

The rest should be simple math... You start with a block reward of 500, the average time between blocks should be ~10 minutes and the block reward halves every 210.000 blocks.

Hint: bitcoin has a max supply of 21.000.000 BTC (slightly less), and started with a block reward of 50 BTC Wink It also halves every 210.000 blocks and has an average time between blocks of 10 minutes

Last but least, this line is also interesting:
https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/main.cpp#L1726
It tells you how many halvings before the subsidy will return 0 (even if the subsidy is > 0 at that time) Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
fratrad (OP)
Full Member
***
Offline Offline

Activity: 240
Merit: 100


View Profile
January 31, 2019, 11:03:35 AM
 #3

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/chainparams.cpp#L73
Halving interval = each 210.000 blocks

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/chainparams.cpp#L81
Average time between 2 blocks = 60* 10 seconds (10 minutes)

https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/main.cpp#L1729
subsidy = 500 coins

The rest should be simple math... You start with a block reward of 500, the average time between blocks should be ~10 minutes and the block reward halves every 210.000 blocks.

Hint: bitcoin has a max supply of 21.000.000 BTC (slightly less), and started with a block reward of 50 BTC Wink It also halves every 210.000 blocks and has an average time between blocks of 10 minutes

Last but least, this line is also interesting:
https://github.com/Infernoman/C-Bit/blob/73bc5652564d344af6847eefde6d386225d4ad02/src/main.cpp#L1726
It tells you how many halvings before the subsidy will return 0 (even if the subsidy is > 0 at that time) Smiley

Thank you, I calculated the answer  Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!