Homework on Mining and Proof of Work - Questions

  1. Why is it important to make sure that miners spend money (on electricity) while mining?

Miners spend a lot of electricity to solve a cryptographic puzzles, competing with each other to solve first and get the block to append to the blockchain and receive their rewards, if a miner tries to be dishonest or sends errors, the network will acknowledge and reject it, then the block will be dropped and the miner will loose all the rewards and by then would have spent a lot of electricity with the process of solving the puzzle, incurred a cost of electricity which will not be covered, therefor the spending electricity is a way to make all miners perform an honest and smoothly work to the Blockchain contributing on a honest basis.

  1. Why would it be very difficult for someone to go back change a previously added block?

Cryptographic puzzles are made based on the content of each block, its hash function (SHA256) is an unique finger print of the block based on the previous block, so if a block suffers an alteration then a full blockchain can be invalidated. Between blocks exists links, once one block is altered the following links for the following blocks will be broken and to fix this we would have to re-mine new cryptographic puzzles based on the new changes, otherwise the network will not recognise the changes. However to proceed to re-mine the blockchain again, it would take an undetermined amount of time that can not be accrued to our life time, it can take hundreds of years and taking into account that we would have to catch up to the new blocks, then electricity costs, machinery and all related costs to run the mining facility, realistically to change a previously added block would be practically impossible.

  1. How does the network regulate mining difficulty?

On an average of 10 minutes a new block is mined, the BTC Protocol ensures this timing remains the same so:

  • Increases network difficulty when it becomes easier for miners to mine.
  • Decrease network difficulty when it becomes harder for miners to mine.

All valid blocks must have a hash below the target.
When hash rate becomes high, the bitcoin difficulty eventually gets higher as well, making it tougher for miners to mine easily within the network.
The inverse is also true. If Bitcoin’s hash rate decreases, the network difficulty will reduce as well, i.e. for instance if a lot of miners stops mining

To calculate difficulty the Bitcoin’s network difficulty changes every 2016 blocks.
The formula used by the network to calculate difficulty goes like this:
difficulty = difficulty_1_target / current_target

In the formula above:

  • target is a 256-bit number. As per Bitcoin’s protocol, the targets are a custom floating-point type with limited accuracy. Bitcoin clients approximate difficulty based on this fact. This value is also known as bdiff.’’
1 Like

1: It’s important that a miner spends money to mine because it creates incentive for the miner to stick to the rules of the blockchain and focus all the energy (electrical) on processing transactions and solving the nonce.

2: It would be difficult because of the exorbitant time and cost to change a previously added block.

3: It regulates mining difficulty by lowering the target as the amount of miners increases, making it more difficult to guess the nonce.

1 Like

In the video Ivan mentions then the whiole chain breaks up.Could you please expand and claim how this technically works and the consequences?

I’m not sure what you mean by breaking up the chain. If you want to undo a tx then the receiver has to send the funds back to you. The other way would be to revert blocks back before the tx happened which would invalidate all other transactions that were made in the meantime and would require the coordination of the entire network.

Thanks for the reply.I’m also not sure but that was what Ivan said in the video and that’s why I’m asking.What you say though makes 100% sense.

  1. because miners are incentivized to stick to the rules by paying upfront. If they dont act like the blockchain wants them to do, they wont get rewards and loose money they spent on electricity.

  2. every hash contains the previous hash, data and a nonce. if somebody tried to change a block in history than every following block would be invalidated and the person would have to mine them again till he is on the same level of existing blockchain. You would need at least 51% hashing power. (pratically impossible)

  3. the more miners are active, the more difficult mining gets. This is regulated by a so called target. The lower the target, the higher the difficulty.

1 Like
  1. This ensures that miners have “skin in the game” and are incentivized not to waste this money by being a bad actor as there efforts will be rejected and they will lose the money spent on electricity.

  2. The hash created are a calculation that includes the previous hashes from the previous blocks. If a transaction was altered, it would alter all subsequent hashes, which would have to be recalculated to guess the new puzzle that is mathematically created.

  3. Mining difficulty increases with the halvenings and also is affected by the amount of hashing power on the network, which lowers the nonce target.

1 Like

1.The costs ensure the miner will follow the rules to get the rewards.If they take the risk to break the rules, they can be punished, and then the costs/reaward ratio of that is very high and is not worth.
2.When you go back to change some previous block, every following block has to change too, meanwhile new blocks are being created. It demands super hashpower which is almost impossible.
3. By using the target number, only if the hash number is less than the target, then that block is accepted by the network. The more miners, the lower target, then more difficult to guess the nonce.

1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    Miners are incentivized to be good actors that want to solve ‘puzzle’ and get rewarded.
  2. Why would it be very difficult for someone to go back change a previously added block?
    It would invalidate all other blocks and you would have to start over again, which is incredibly time consuming.
  3. How does the network regulate mining difficulty?
    It depends on the number of active miners. The complexity increases in correlation with the number of active miners, attempting to solve the ‘puzzle’ and receive the reward.
1 Like
  1. In so doing, it gives incentive for miners to complete the block, adhering to honest protocols.
    2.By changing a previously added block, every block mined after that one would have to be changed also, while trying to compete with other miners who are regularly mining new blocks, it really wouldn’t be worth the effort, as hash power required for this would be astronomical.
    3.By using a target, the hash must be less than the target for the block to be accepted by the network.
    The more miners there are, the lower the target is, hence the more difficult it is to guess the nonce and claim the reward.
1 Like
  1. To give them incentives to be honest (otherwise they will have to pay for being dishonest through electricity)
  2. The network always chooses the longest blockchain, so before changing the previous block, which is already hard to do, they will not have time to catch up with the addition of new blocks to have the longest chain
  3. Through changing the nonce. The higher the hashrate, or computing power of the network, the lower the target number, hence the harder it is to hash.
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
  • it forces miners to be lawful and adhere to the set rules, in order to be rewarded for the energy and money spent. It is not economically sound to break the set rules.
  1. Why would it be very difficult for someone to go back change a previously added block?
  • Only a single longest blockchain is accepted universally, and new blocks are continously added onto the longest blockchain, meaning that to corrupt a data in the previous block, subsequet blocks have to be hash and added on the new blockchain and also over take the exisiting longest blockchain that is being worked on.
  1. How does the network regulate mining difficulty?
  • when there are more miners, the target for the hash value is lower, increasing the difficulty for the block to be accpeted
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?

Otherwise there would be no cost to producing blocks, and thefore attackers could not be prevented from creating incorrect blocks. The money spent acts as a security budget for bitcoin, ensuring that it is more expensive to attack the network compared to any gain from creating false blocks.

  1. Why would it be very difficult for someone to go back change a previously added block?

The blocks are all linked so each subsequent block would need to be remined with the cost of proof-of-work, increasing the difficulty with each block. You would need to outcompete the rest of the network to add new blocks which would require tremendous computing power.

  1. How does the network regulate mining difficulty?

The nodes record the time it takes to create new blocks and on a given time interval the average block creation time is compared and if it is greater than 10 minutes, the difficulty decreases and if below 10 then it increases which keeps the average block time around 10 minutes.

1 Like
  1. So that they are incentivized to follow the rules. Also to make it difficult to change the previous block.

  2. Because it takes a lot of electricity and time to find the hash for the new block, rehash/re-mine the blocks after that, and to catch up in terms of mining all of the blocks that it missed while going back in the blockchain.

  3. If the target is low then the mining difficulty is high and vice versa.

1 Like
  1. It is important that miners spend money on electricity while mining so that they are incentivized to make that money back and make profit. The only way to make money while mining is to be honest and follow the rules so miners have no choice but to do that in order to make money.

  2. Because they have to guess all of the nonce’s over and over again and then catch up to the latest block which can take thousands of years.

  3. Mining difficulty depends on how many miners there are. If there are a lot of miners mining in the network the target is lower which makes mining harder. When there are not a lot of miners mining in the network then the target is higher which makes it easier to guess the nonce.

1 Like
  1. Because they are incentivized for honest prove of work and if they provide dishonest data they won’t receive any rewards and they will lose the money and energy used on electricity.
  2. Because once an old block is changed they have to change all the other blocks also. and other miners on the network keep on adding new blocks and changing all those blocks will be impossible.
  3. after every 2016 block they calculate the average time taken to mine all those blocks. if the time is less than 10 minutes the difficulty is increased and if it’s less than 10 mins the difficulty is decreased.
1 Like
  1. It’s important miners spend money to mine to ensure they have an incentive to be honest.

  2. It would be very difficult for someone to change a previously added block because they would need to change each following block and that would require an enormous amount of capital to even attempt.

  3. The network regulates mining difficulty by automatically adjusting the difficulty every 2016 block to ensure the average time to mine a block is 10 minutes.

1 Like

The high cost of electricity keeps miners honest.
The blocks hash is based off of previous hashes . it would take thousands of years to reproduce blocks .by making the target smaller.

1 Like

1 – So they are incentivized to play by the rules and ultimately be able to mine a valid block with a target low enough to be accepted and added to the blockchain. By doing this they will receive the block reward plus the transaction fees and have funds to pay for the electricity they used in advance and make profits.

2 – By changing a previously added block a person would have to mine again all the links up until the newest block (blocks keep being added in the meantime) which is an extremely difficult task that implies that person having a lot of computing power and spending a lot of electricity. This would imply spending big sums of money.

3 – The more miners participate in the network the higher is the mining difficulty. With more miners participating the hashing target that they have to find is lower (beginning with more zeros) meaning the probability of achieving it is lower requiring more work.

1 Like
  1. Setting an expense for the miners prevents them from being malicious players, as they would lose the investment made in electricity.
  2. If a previous block is changed, al the following blocks would also change, and the bad actor would have to guess all the previous “new” blocks and the new one before another miner solves the new and “good” block.
    2.As solving the hash funcion implies getting a number below the target, the more miners securing the network, difficulty of solving the hash function increases by lowering the target number.
1 Like