Bitcoin Forum
June 22, 2024, 01:04:29 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BlockSubsidy reward  (Read 65 times)
dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
October 04, 2021, 01:59:30 AM
 #1

Hi All

Alot of these altcoins have the GetBlockSubsidy method in regards to mining/rewards. In regards to rewards would be calculated as follows:

CAmount nSubsidy = 50 * COIN;


What stops someone from changing the above line of code to something ridiculous ie:

CAmount nSubsidy = 50000000 * COIN;

Wouldnt that cause the next block that is mined (against the above compiled line of code) to reward a ridiculious amount of coins?

Thanks
adaseb
Legendary
*
Offline Offline

Activity: 3794
Merit: 1723


View Profile
October 04, 2021, 04:29:10 AM
 #2

Hi All

Alot of these altcoins have the GetBlockSubsidy method in regards to mining/rewards. In regards to rewards would be calculated as follows:

CAmount nSubsidy = 50 * COIN;


What stops someone from changing the above line of code to something ridiculous ie:

CAmount nSubsidy = 50000000 * COIN;

Wouldnt that cause the next block that is mined (against the above compiled line of code) to reward a ridiculious amount of coins?

Thanks

Yes anyone can change that but if they change that then the protocol is completely different and its a completely different coin. It would basically fork all the main chain. So you can compile your own Bitcoin, change the next block reward to something crazy and mine a block, however what will happen is that you would only get the large amount of coins on your own chain which nobody else is using. The main chain the reward given to you would be the original 50 BTC or so.

Bitcoins and all cryptos are open source, you can easily modify the code however if nobody runs YOUR code then there is not much that can be done really. So you don't have to worry about someone changing the code and giving themselves an unlimited amount of coins when nobody would be running that particular client.
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!