-1

I've watched a lot of Cryptocurrency lectures on how they work and I think I am about 75% of the way of understanding completely how they work. One question has been bothering me though.

When a miner solves a block, he gets a block reward made out of thin air. For Bitcoin this is currently around 12.5 BTC. What dictates this specific amount of money? Is the the locally ran software? If so, can't that be tampered with? Does the miner ask other clients what the current block reward amount is? If so how does it know it's being fed the right updated information?

Same goes for the number of zeroes found on the hash. If a miner finds a hash value like 00000000000000000000000000000000000000000000000000000000010101111110110101010101 he would then check how many zeroes it starts with. Let's say the current solve requires 30 zeroes. Who makes that rule? How is it updated? At what points does it change from 30 -> 31? Who makes that decision to increase or decrease it. What if one computer thinks it's 29 and not 30. What stops people from gaming the system?

Same with block sizes. What stops miners from sending blocks with increased maximum sizes? Would clients reject the block if they don't match a certain size? If so, how do they know what are the maximum amount of transactions? Who told them?

Hatefiend
  • 3,416
  • 6
  • 33
  • 74
  • 1
    I'm voting to close this question as off-topic because it is not a programming question. – Raymond Chen Feb 05 '18 at 02:33
  • @RaymondChen You misunderstand the question then. I'm asking how that global functionality is implemented at the programming level. – Hatefiend Feb 05 '18 at 05:38

1 Answers1

0

A single miner can tamper with a block as much as they want, changing block award or difficulty or double-spending, but such a block will not be accepted by the rest of the network.

Bitcoin network needs a consensus to accept a specific block. As long as more than half of the nodes of the network are "good" ones, the tampered block will be rejected.

This functionality is implemented by Bitcoin P2P protocol.

YinYang16
  • 461
  • 3
  • 5
  • Interesting... so essentially someone can tamper with the code that runs their peer to peer protocol, but as long as more than half of bitcoin users are 'playing nicely', their clients will reject the invalid protocol? – Hatefiend Feb 05 '18 at 05:42
  • Yes, this is exactly how it works. Also, users are incentivized to "play nicely" in order to keep the network running and receiving the benefits of being a part of the network. – YinYang16 Feb 06 '18 at 17:37