Bitcoin Forum
November 18, 2019, 06:39:27 PM *
News: 10th anniversary art contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Find out max supply just from github source code  (Read 106 times)
fratrad
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
1574102367
Hero Member
*
Offline Offline

Posts: 1574102367

View Profile Personal Message (Offline)

Ignore
1574102367
Reply with quote  #2

1574102367
Report to moderator
1574102367
Hero Member
*
Offline Offline

Posts: 1574102367

View Profile Personal Message (Offline)

Ignore
1574102367
Reply with quote  #2

1574102367
Report to moderator
The Bitcoin Forum is turning 10 years old! Join the community in sharing and exploring the notable posts made over the years.
1574102367
Hero Member
*
Offline Offline

Posts: 1574102367

View Profile Personal Message (Offline)

Ignore
1574102367
Reply with quote  #2

1574102367
Report to moderator
1574102367
Hero Member
*
Offline Offline

Posts: 1574102367

View Profile Personal Message (Offline)

Ignore
1574102367
Reply with quote  #2

1574102367
Report to moderator
mocacinno
Legendary
*
Online Online

Activity: 1764
Merit: 1825


https://unblur.ninja =>lightning network testsite


View Profile WWW
January 30, 2019, 10:30:22 AM
Merited by OgNasty (2), pooya87 (1), mjglqw (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

fratrad
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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!