Homework on Mining and Proof of Work - Questions

To ensure that miners are being financially committed and incentivised to follow the rules to not loose money by trying to cheat.

Because that would change the hash of the block, and all blocks after in the chain. The miner would also have to play catch-up against other miners that have continued to add to the longest chain. All this would consume extreme amounts of electricity/money and time, wich makes it practically impossible if the blockchain has large amounts of hashing-power and is decentralized.

Mining-difficulty is regulated relative to the hash-rate of the network. At high hash-rates the target will be lower, therefore difficulty will be higher.

1 Like
  1. Because they have to be invested on it. If they try to do something shady, they would have lost electricity money.
  2. Because they would have to change every block afterwards as well.
  3. If less people mine, there minig is easy, promoting more people to mine.
1 Like
  1. The production cost in mining Bitcoins are energy. Energy to the node to compute and solve the “mathematical problems” with the nonce so a new block can be added to the blockchain. The reward for the network of nodes to solve mathematical problems are earning Bitcoins.

  2. If the blockchain shall stay trustless all users need to know that every and each transaction added to a blockchain is true/veriifed. So going backwards and trying to change an verified transaction have to be impossible. And it is due to the complex validation/verification process of a block with “hash of a hash” functionality including a nonce within a block.

  3. As there are more nodes of cumputers in a system to solve a mathematical problem the dificulty of solving that mathematical problem must increasy. This to keep production cost for mining and reward when mining in balance.

1 Like
  1. When the miners need to spend money ( on electricity) to mine they will follow the rules so they can get reworded, money.

  2. If they change a previous block the rest of the block will change and it brakes the next and next link.

3.Every 10 minutes a block is mined. If more computers are trying the hashing power will increase so as the difficulty. Less computers = less hashing rate = lower difficulty.

1 Like

Regarding question 3 I understand that the nounce is regulating difficulty, but what mechanism determines the nounce difficulty?
And further, how is the mechanism determining that the hash is low enough?

Sorry for noob question!

Miners need to hash the block and make sure that the hash has a low enough number ( a certain amount of leading zero’s) To achieve a low enough
Hash, you need to add a random number (nonce) hash again and check if the hash has enough leading zero’s in front. If it doesn’t, you change the nonce to another number, hash the block again and check again if hash is lower than target. This step is repeated until you have a hash that is low enough. If you check the hash of bitcoin blocks, you wil see that they start with a certain number of leading zero’s.

The more miners are mining, the faster the probability of mining new blocks, so every 2016
Blocks the network adjust difficulty so we keep having an average of 10min per block. By adjusting the target ( certain amount of leading zero’s the block needs to have to get accepted)

Thanks for reply Fabrice! It was a bit clearer, but still think I need to learn some more to really understand how this works.I will take your advice and check the hash of bitcoin blocks.
Regarding the average block time, you made that quite a lot clearer, thank you!

1 Like

If you Don’t understand it completely, we can always have a voice chat on discord or something

Appreciate the offer Fabrice. I am still in a very early learning phase, so think I will play a bit more around before I ask for more help.
I probably will need some more help later on though:)

1 Like
  1. So they are incentivised to mine blocks to pay for the electric they have used.

  2. It would take them too long to mine it again and by the time they had mined one, there would be more and more blocks added by other miners and there block would never be added.

  3. The network lowers the target (nonce) in relation to the number of miners to make it more difficult to guess the number. The lower the target, the less chance there is to guess it.

The target is not the same as the nonce.
The nonce is a random number to add in a block so that if you hash the entire block, the hash needs to be lower than the target. The target is a certain amount (with some leading zeros) that the hash has to have to be valid.

3 Likes

Thank you.

Regards
Mark.

1 Like
  1. when miners first need to invest money in electricity, they are more encouraged to follow the rules because they have invested in the mining process to receive the block reward and tx fees

  2. if someone wants to change a previous block, it would break the entire chain from that block and all blocks thereafter. in addition, he must re-mine all blocks that follow the changed block, which costs enormous amounts of energy / money and, above all, time. Technically maybe possibly realistically impossible

  3. As there are more miners, the difficulty of guessing the nonce increases by decreasing the target

  1. It acts as an incentive for miners to behave honestly. They risk losing the money they spent on mining if their block gets rejected by the network.

  2. Any change to a previous block results in changing the hash of that block and therefore also changes the hashes of all subsequent blocks. This means that all block following the changed block has to be mined again and that would take a tremendous amount of hashing power.

  3. Hashes of blocks need to be below a certain target. The difficulty can be increased by lowering the target value.

Answer:

  1. It creates an incentive for miners to play by the rules because they have skin in the game. Electricity costs money, so when they don’t play by the rules, they are losing money, which is bad for business.
  2. If miner wants to go back and change data in the previous block, even one bit of change dramatically changes the hash of that block. Since that block is hash to the next block, it also changes. So the miner has to mine next block too. Moreover, others are continuing to mine the original blockchain. Our someone has to mine faster to catch up with everyone else and exceed the original chain, which requires an astronomical amount of electric and processing power. Until then, his blockchain is rejected by the network.
  3. The network creates a target. The lover the target, the harder it is to find the right hash. The processing of guessing the hash is random. Lover target hash has more zeros in its string.
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
  • It is important to make sure that miners spend money on electricity while mining because it ensures that they are using incentives while doing their personal work.
  1. Why would it be very difficult for someone to go back and change a previously added block?
  • It would be very difficult for someone to go back and change a previously added block because if one block is altered, then the other blocks and the link between them will be broken as well. This would take many, many years for someone to fix.
  1. How does the network regulate mining difficulty?
  • The network regulates mining difficulty by setting a target. When the target is low, the difficulty is high. With this, it will be harder to guess the nonce for those mining.
1 Like
  1. So that the reward is greater than cheating the network

  2. They would need a large amount of hashing power, that they would be able to create the longest blockchain.

  3. As miners increase, so does difficulty and vice versa.

1 Like
  1. It is important to make sure that miners spend money on electricity while mining so that if they are dishonest and try to cheat instead of securing the network, they will lose money.

  2. It would be very difficult for someone to go back and change a previously added block because if you change a previous block, it will also break the links to all of the future blocks. This would mean you would have to mine every block after the one you are changing, and all of the other nodes would see that it doesn’t make sense and the block is invalid. To change the block you would have to re mine every single block after the one you are changing and catch up to the network which is practically impossible.

  3. The difficulty is determined by a target number. When you hash a random number, the nonce, with the previous hash and the transaction list, the hash of the block needs to be lower than the target number. If a lot of people are mining, the target number will be lower so it will be more difficult to find the nonce.

1 Like
  1. It means that they have to cover their expenses plus they have to make a profit. They can only do that if they are playing according to the rules.
  2. Because then they would have to remine all the other block and change all the following blocks
  3. If the hash rate rises, the difficulty rises. If the hash rate goes down, the mining difficulty will be lower.
1 Like

Why is it important to make sure that miners spend money (on electricity) while mining?
There has to be an incentive therefore It is important to make sure that miners spend money while mining so that they have incentive to do so.

Why would it be very difficult for someone to go back change a previously added block?
It would be very difficult because each block contains the hash of the block, the data and the hash of the previous block. Hash codes are created by a math function that turns digital information into a string of numbers and letters. If that information is edited in any way, the hash code will also change.

How does the network regulate mining difficulty?
The network regulates mining by adjusting the mining difficulty every 2016 blocks, mining difficulty will be higher when there are more miners and less difficult with less miners.

1 Like