Homework on Mining and Proof of Work - Questions

Homework on Mining and Proof of Work - Questions

  1. Why is it important to make sure that miners spend money (on electricity) while mining? To incentivize them to be honest and mine the next block so they can continue to make a profit.
  2. Why would it be very difficult for someone to go back change a previously added block? Going back to change a block changes the hash there for all blocks moving forward need to be re-mined. All other miners will continue mining the largest chain so it basically impossible to do on the Bitcoin network due to the mining POW that is utilized on that network.
  3. How does the network regulate mining difficulty? This is done by the protocol which lowers and raises the difficulty to keep mined blocks as close to 10 mins as possible. I think the protocol changes every two weeks.
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 to incentivize them to play by the rules. If there is no upfront cost in mining the risk of losing money by maliciously misrepresenting data in the blockchain doesn’t exist.

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

It is difficult to go back and change a block because in doing so you subsequently change every block thereafter. Therefore you would have to reconstruct every block after the block that was changed, and you would have to do so faster than the rest of the miners could construct new blocks. This is unpractical because the network always accepts the chain with the mos PoW and there is no practical way to keep up and outpace all other miners.

  1. How does the network regulate mining difficulty?

The network regulates mining difficulty depending on the hash rate withing the network. The Higher the hash rate of the network, the more difficult mining is. Vice versa, the lower the hash rate of the network the easier mining difficulty becomes.

1 Like
  1. Electricity (as well as time) is the price miners pay to participate in guessing a correct nonce within the target range to add to the blockchain. If miners break any rules during the process like tampering with the integrity of previous transactions on the chain or attempting to add fraudulent information they will lose the opportunity to win that new block, they will only have spent money on electricity and wasted their own time.

  2. If someone wanted to change a previously added block it would affect the integrity of that block and all those that follow. Someone would have to spend time and money changing the block in question, plus all the linked blocks that include information derived from that one, and all of the new blocks still being created simultaneously by other miners while they were still attempting to change the first block (close to impossible to do in a lifetime).

  3. The more miners in the network, the higher the difficulty. The higher the difficulty means the lower the target range is to guess the nonce for that particular block.

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

incentives to follow the rules since
Why would it be very difficult for someone to go back change a previously added block?would break the link to the next and the following blocks.

How does the network regulate mining difficulty?
  1. more miners the difficulty to guess is increased by lowering the target.
1 Like

Glenn_CostaRica

1. Why is it important to make sure that miners spend money (on electricity) while mining?
Mining in the most important factor for security in Bitcoin. Miners are in charge of providing a virtually impossible-to-break barrier against false transactions, against double spending and hackings, and against any kind of attack directed towards the integrity on the network. However, miners are humans too. They could feel tempted to cheat or play against the rules. For this reason, the Bitcoin network implements a powerful system of incentives: miners have to invest a gigantic amount of money, usually in Fiat, in electricity, in order to solve cryptographic puzzles to be able to propose acceptable blocks and earn big incentives in Bitcoin. Since they have to invest a lot of money in order to propose a block, they are highly discouraged to waste their money in creating bad blocks that would be rejected by the network. Incentives make them invest their money in protecting the network and playing by the rules.

2. Why would it be very difficult for someone to go back change a previously added block?
Each block on the blockchain is connected to the next block by a ā€œlinkā€: the link is actually a hash created for a new block based on three parameters: i. the hash of the previous block, ii. the list of transactions for the new block and iii. a NONCE. The nonce constitutes the puzzle that miners try to solve by spending electricity. A nonce is a random number that, if added to the block, it ensures that, when one hashes the entire new block, one would obtain a certain number which is lower that a specific target. Finding the nonce and having the new hash for the new block is the essential task of a miner. In Bitcoin, finding the last block implies hashing trillions and trillions of guesses with different nonces, until a correct LINK in found. And this can be done only by mining farms or supercomputers. Each link requires an immense amount of guessing: an immense investment in electricity for the Proof of Work. The more links one actor needs to remake in order to modify some data, the more and more the Proof of Work that has to be done to reconstruct the whole chain. This is almost impossible for anyone to do. And even, if someone were successful to do it for one, or for a few links, during this remaking, other miners would be mining more and more new blocks on the original chain, and making it exponentially harder to rebuild the chain that contains the alteration. One might requiere millions of years to remake the chain and infinite resources.

3. How does the network regulate mining difficulty?
This is done by elevating or lowering the maximum limit of the number acceptable for the hash of a new block. The lower and lower the limit is, the harder Proof of Work turns. It is usually said that, the more difficult mining is at a given time, the more zeros one can see at the left side on a hash of a new block.

1 Like

It happens approximately every 2 weeks, but the actual adjustment is done based on the blocks. It happens every 2016 blocks. All in all great homework. :slight_smile:

The third questions is correct. However I don’t understand the answer to the first question. Could you possibly answer the first one and the second one as it is missing. If you need help, feel free to say so. I will help you.

  1. Spending money on electricity incentivises miners to solve the puzzle to create a new block and gain rewards. A false block will not be rewarded and the miner will lose money.

  2. Changing a previously added block would result in all subsequent blocks becoming invalid. To validate them all of the calculations required to create the blocks would have to be carried out again which is infeasible.

  3. Mining difficulty is regulated by the difficulty needed to guess the nonce. The greater the number of miners the greater the difficulty.

1 Like
  1. This is so as to ensure that they are invested in the process which in turn provides incentives to them to play by the rules to get their reward
  2. As the blocks are linked together and the hash of a new block also contains the hash of the old block and the variable Nonce. Changing a previous block will cause the hash of the new block causing it to affect all other subsequent blocks in the chain. Each block would have to rehashed and re-mined with Nonces until they all meet the respective varying Targets (hash value) for each block. It would require an incredible amount of electrical and hash power and would be practical.
  3. When the hash rate of the network is very meaning that a lot mining activity is going on, the Target no is set to a lower value thus reducing the probability of it being met by any miner
1 Like
  1. Because they’re paying upfront and then miners are incentives to play by rules and get block reward.

  2. Because each block contains hash of previous block . Each change in this previous block will affect others following blocks and those following blocks would have to be change also.

  3. When more people are mining then more difficult is guess the nonce. Miners need to spend more energy. Target is lower = difficulty is higher.

1 Like
  1. Firstly it secure whole blockchain because miners are Intensives for PoW on the blocks. If they don’t follow the rules they will loose money. This way everybody use the right practice not to loose the income after they spend so much on energy expenses.

  2. Due to the Hash rate… due to so many miners is mine it is impossible to go back and change anything in block. If you change one block than all links to the following blocks will be broken and you need to try to catch up with new block produce…Impossible!!

  3. More miners in the network the target number will be very low… the difficulty will increase to guess the nonce target number …solve the puzzle will be harder.

1 Like
  1. Because in that way they are incentivized to follow the rules, they will get rewarded in the form of a transaction fee and blockreward

  2. Because they would basically need to have more hashing power then the rest of the bitcoin network to redo all the transactions

  3. If there more people mining, so the hash rate of the network is high, the target moves lower making it more difficult/expensive for miners to guess the target number. If it becomes so difficult people will stop mining, the target will move up making it cheaper to guess the target number.

1 Like

Thanks Mauro, I appreciate the extra info

1 Like

Woah, the thread is too long to read it all :sweat_smile:

So regarding number 3 I understand that the difficulty is changed to keep the block creation at ~10mins. but how?

I see that some posts talk about the target being adjusted every 2 weeks. by who? why would they choose a more difficult target? what’s the consensus procedure on that?

so many questions… I guess I’ll keep on learning :smiley: if you can point me to some answers I’ll be tankful! Also @ivan it would be nice to have some pointers to go deeper in such niches directly on the course page (ie: even external blog posts or articles).

Great learning so far!

1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    They must spend money to make money. It helps to keep the honesty in the system. They must follow proper protocol to make up what they spend and gain profitability.
  2. Why would it be very difficult for someone to go back change a previously added block?
    It is difficult due to the block information hash and puzzle to connect the next block which must contain information from previous block and continue on the the next continuous block. One change breaks the connection forward and must be re-mined again throughout. This is quite extensive and keeps the system truthful.
  3. How does the network regulate mining difficulty?
    when many people are mining the difficulty is harder because the target is lower.
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?

The difficulty in mining the blockchain is a disincentive to cheating and dishonesty. The amount of work, and energy spent thereof, required to mine a block under normal circumstances is sufficient to discourage cheating

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

The difficulty stems from the fact that each block is linked to the previous block using the hash value of the combined transaction records (data), nonce (randomly generated number only used once), and the previous hash. When any of these three items change, the hash value changes thus breaking the link between blocks. Once that link breaks, every subsequent link breaks as well.

  1. How does the network regulate mining difficulty?

This is regulated using the concept of the randomly generated NONCE (Number Only used Once). This is the value miners must guess, in order to combine with the data and the previous hash, to generate a new hash value which must be less than equal to a specific value.

1 Like
  1. It is important to make sure miners spend money on electricity so that they can play by the rules accordingly. And if they go against the rules that means they will loose all the electricity cost involved in the process, hence they will all follow the rules in order to get rewarded.

  2. It will be difficult for someone to go back and change a previously added block because any change would affect the other blocks that are linked to it in the forward direction, hence you have to re-create and mine all the affected blocks all over again and this is absolutely impossible to achieve.

  3. With increase in miners, the hashing power will increase. So the difficulty to guess the nonce is increased by lowering the target, such that guessing of the nonce is approximately 10 min apart.

1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    It is important that miners spend money on electricity while mining so that they are following the rules and get the rewards and fees to be able to cover the cost.

  2. Why would it be very difficult for someone to go back change a previously added block?
    If it happens that the link would be broken, all the following links would be broken as well because the hash value would change along with the following blocks.

  3. How does the network regulate mining difficulty?
    The mining difficulty level depends on the target and the number of miners on the network. A lower target means higher the difficulty level. A higher target means that the difficulty level is lower.

1 Like
  1. To make it practically impossible to modify previous blocks.
  2. Every link from that block onwards would be broken and every block would need to be re-mined. By the time this has been done the chain has grown by an amount of additional blocks that make the process of altering previous blocks a complete waste while mining by following the rules will provide rewards.
  3. By adjusting the target difficulty level. The lower the target the harder it will be for miners to find the right nonce. Difficulty is proportional to hash rate.
1 Like

1.because you cant mine without electricity

  1. because to change the previous block you have to change them all

  2. the network regulates the difficulty of mining by the amount of miners.