Homework on Mining and Proof of Work - Questions

  1. it is important to ensure that miners spend money (on electricity) while mining to ensure that the miners are incentivised to secure the network. This means that miners are incentivised to play by the rules set out by the blockchain and protects against situations such as double spending or miners adding anything malicious or incorrect data to the chain. Miners FIRST pay for the electricity consumption used by the processing power of their mining hardware in advance to receiving the financial benefit of a block that they have newly created which in addition has also been validated and accepted by all other nodes on the network. This is what creates the incentive to secure the network as they will lose money in overheads if their block is not deemed valid by the nodes on the network.

The network is made secure by the combined hashing power of all miners on the network defined as the hash rate therefore incentivising participation is key.

  1. It would be difficult for someone to go back and change a previously added block because of 2 main factors

Firstly it is important to understand that each block has a unique hash which is calculated using the hash of the previous block, the data within that block and a nonce, blocks are connected via a link which is generated using a proof of work algorithm and the properties of this link are dependent on the data within the previous block.

As the hash of any given block is calculated using the hash of the previous block, if the data in a previous block is edited, the hash of that block will change drastically and this as a direct result will edit the imformation in the subsequent block which contains the now editted blocks hash. This will cause the link between the two blocks to break meaning all links between all subsequent blocks from this point on in the chain will be broken as the data of one block leads into anothers and so on and so forth.
This is the first factor.

The second factor is the POW algorithm. In order for a new block to be created a nonce is used as a key component of a cryptographic puzzle miners compete to solve, in order to successfully create a new block that is added to a chain. The nonce is hashed into the data of a block and therefore if a blocks data is changed the block will need to be re-mined. this therefore means that all subsequent blocks will need to be re-mined as well, re-establishing the links between each block. This mining process is expensive because of the difficulty. On top of this the new chain that is being created will need to catch up to the current chain which is still creating newly mined valid blocks - because the nodes will continue to use the longest chain as the valid blockchain - and until the size of the altered chain is greater than the size of the current chain it will not be accepted by the network.

  1. The network regulates the mining difficulty using the proof of work algorithm. Because of a use of a nonce in the data of a block, miners have to solve a cryptographic puzzle whereby a string of numbers is randomly selected and added onto the end of (combined or brought together with) the data of transactions and the hash of the previous block on the current block. The hash of these is then compared to a target set by the POW algorithm, and if the hash is lower than the target, the block is created and added onto the chain. If the hash is higher than the target, a new nonce is selected randomly and the hash function is recalculated. this process is repeated again and again until the hash is lower than the target.

Therefore the mining difficulty is regulated by how low or high of a number the target is set as. What determines this target is the hash rate of the network which is to say the total computing power of all of the miners combined. This means that as the number of miners competing in solving the cryptographic puzzle increases, the target is lowered and subsequently the difficulty goes up. The reverse is also true in that as the number of competing miners decreases the target goes up and resulting in the difficulty decreasing.

1 Like

Homework on Mining and Proof of Work - Questions

  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    The large investments of energy required to mine for coin is an assurance that the miners that put in the effort and expense will want to be rewarded.
  2. Why would it be very difficult for someone to go back change a previously added block?
    Each block in the chain has 3 cryptographic security features that make it nearly impossible to change anything in the blockchain. After the initial block, each subsequent block has the unique hash signature of the previous block plus a hash of the details of the transactions and also a nonce which varies the input to the hash algorithm forcing it to generate a hash lower than the target.
  3. How does the network regulate mining difficulty?
    The difficulty of mining is directly proportional to the amount of mining being done. The more miners hashing, the higher the difficulty.
1 Like
  1. To incentivize truthful blocks as invalid ones will be rejected and the cost of mining will be wasted.
  2. The hash of the previous block is added to the next block so if a previously mined block is changed its hash will also change. This will make all blocks after it to become invalid.
  3. The more hashrate there is in the network, the higher the difficulty will be when the rates adjust.
1 Like

Thanks a lot @mayjer :v:

Not the nonce, but the target is lowered. The nonce is just a random number. You put transactions in a block, hash it, and your block needs to have a hash below target. If it isn’t, change the nonce to another number, and hash it again. Repeat until you have a blockhash below target.

1 Like

Homework on Mining and Proof of Work - Questions

  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    If the miners have to spend money while mining, they are incentivized to play by the rules in order to earn money.

  2. Why would it be very difficult for someone to go back change a previously added block?
    Because one small change in an old block changes the hash of the block itself and the hash of every block following. So you’d have to also mine every block afterwards.

  3. How does the network regulate mining difficulty?
    It is regulated by lowering or raising the target. The lower the target is the more difficult it is to guess the right nonce.

1 Like
  1. By forcing miners to spend electricity, they are incentivised to be honest, because they will not get the block reward if they try to mine fraudulent transactions, as their block will be rejected by validating nodes. If they do not get the block reward now and then - their investment in mining hardware and electricity usage will have been in vain. This all helps to keep the chain secure.

  2. Should someone try to mine a whole new chain to take over the network they would have to spend so much electricity (hence money) to accomplish that, so it would not make sence from an economic perspective - if at all possible. There is more reason in using that hardware+electricity to do honest mining. Also: Let’s say they could succeed - when this hack would be common knowledge Bitcoin would probably loose all its value, making the hack a suicide attempt from the hacker.

  3. The difficulty is regulated by adjusting the socalled target hash, which is 32 byte value consisting of an amount of leading zeroes. To produce a valid hash, you have to come up with a hash less than this value (by guessing repeatedly). When the difficulty is high, there is more leading zeroes given fewer valid values in the 32 byte range, and when difficulty is lower there are fewer leading zeroes. The decision to raise/lower difficulty is based on the average blocktime that should be around 10 minutes.

1 Like

Thank you for the correction! That was definitely one of the harder concepts of that lecture and now after reading your explanation I think I have a better understanding. Have a great day man!

1 Like
  1. To prove they worked hard enough, hence proof of work.
  2. One would need to re-mine all the blocks between the one modified and the latest one faster than the rest of the planet is mining the latest one.
  3. The mining difficulty increases with the number of miners in the network by lowering the target.
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    Miners have a responsibility and incentive to use their resources to verify/mine transactions.

  2. Why would it be very difficult for someone to go back change a previously added block?
    A miner would need control of at least 51% of the mining power which is nearly impossible.

  3. How does the network regulate mining difficulty?
    Difficulty increases with more hashing power.

1 Like

Its important for miners to spend money on electricity to ensure that they act in good faith and don’t try anything malicious. If they do they will lose money on wasted electricity use.

It would be difficult to change a previously block because changing any bit of information changes the hash of that block which changes hash of next block and so on and so forth

the network regulates mining difficulty based on the number of miners working and the hash rate. The more miners there are the more difficult it is to find the correct answer to puzzle the less miners there are on the network the easier it is to find the answer to the puzzle

1 Like
  1. Because it incentivizes the miners to remain honest. If they were to try and break the rules their invalid block will be rejected and there will be a cost to them - their electricity bill. Whereas if they play by the rules then they have the chance to mine a block that is accepted and they can use the block reward (and fees) to pay for their electricity expenditure, keeping the remainder as profit.

  2. Because each block contains the hash of the block that precedes it. So changing even a single bit within a block will change the hash of thet block and all subsequent blocks. If a miner tried to change info within a previously mined block it would be rejected by the network unless the miner could mine blocks faster than the rest of the network, which would require exorbitant electricity costs.

  3. By changing the difficulty target, which is the number of zeros required at the start of the hash of the previous blocks transactions plus nonce. The more zeroes, the more difficult it is to find the nonce that, when combined with the previous block, will produce the required target. When the hash rate is too high blocks will be mined faster than every 10 minutes on average. In that case the difficulty target is made higher (more zeros) to calibrate the block time back to 10 minutes on average. The opposite happens if the hash rate is too low.

1 Like
  1. So the miners have the incentive to keep mining to reimburse their electricity bill and make a profit.

  2. Because changing a previously added block impacts all the following blocks who no longer fulfill the requirement of the target in the PoW process. That person would thus need to remine all the following blocks so they comply with the PoW rules, which requires too great of a hashpower to be feasible. If he doesn’t do so, it breaks the following part of the blockchain, which makes it shorter. Since the network only choses the longest chain, that new tampered version of the blockchain would be considered as invalid and be ignored.

  3. By changing the target number in the PoW process. If it is lower, it becomes harder to find the right nonce. If it is higher, it becomes easier. The goal is to regulate the difficulty so a block is produced every 10min on average.

1 Like

Homework on Mining and Proof of Work

Why is it important to make sure that miners spend money (on electricity) while mining?
This is necessary to create security on the blockchain. There needs to be a significant enough investment into securing the blockchain from the miners for the reward that they will be getting.

Why would it be very difficult for someone to go back and change a previously added block?
This would be very difficult because altering one piece of data on the blockchain causes the whole thing to collapse. This is so because the hash on each block of the blockchain is based on the transactions of that block, the hash of the previous block, and a nonce (random number). Altering even the tiniest bit of data will cause so many inaccuracies that the altered block/blockchain would be rejected.

How does the network regulate mining difficulty?
With an increases in the total number of mining power on the network the difficulty increases and as the mining power decreases the difficulty decreases. This is regulated by hash target. The miner needs to repeatedly guess a nonce that in combination with the other hash parameters (transaction data, previous hash) generates a hash with value below the hash target. When the target is high the difficulty is low, when the hash target is low the difficulty is high.

1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    Because it introduces a physical cost to the system. Without an actual cost to mine there would be no security, since there would be no cost to rewrite the block chain. By making miners expend a measurable amount of capital, it incentives miners to follow the rules. If they are dishonest they while lose the money and time they invested.

  2. Why would it be very difficult for someone to go back change a previously added block?
    Changing a previous block is improbable because of the necessary computational work required. To change a previous block would require you to do the same amount of work as the first time, and while you are doing that you would need to be staying ahead of the current longest chain on the network.

  3. How does the network regulate mining difficulty?
    It does so by measuring the hash rate and the number of miners on the net work by regulating the difficulty of finding the nonce. The network will try to keep the new block validation at ten minutes. So if block time is over ten minutes, it makes the math problem (target) for the nonce easier, while if blocks are being confirmed in under ten minutes it increases the difficulty for the target.

1 Like
  1. Because if electricity was free there would be essentially no penalty for attempting to be dishonest.

  2. Because they would have to re-mine that block and every other block in between.(which is practically impossible).

  3. Depending on how many miners are competing on the network. The more miners there are trying to solve the block the higher the difficulty will be. It self regulates at about 10 min per block.

1 Like
  1. To create an incentive to keep mining. Mining takes a lot of energy and resources but the rewards are high when mining.
  2. Because all blocks contain the hash of the previous block. When a block is changed then the block after that one is also changed etc. and then you have to do the whole process of guessing the puzzle all over again. That takes an unreasonable amount of time that it’s not worth it.
  3. More people mining means more miners in the network which means the target number of the nonce is lower which means the difficulty of guessing is higher.
1 Like

1: It is important to ensure that miners need to make an investment in electricity and processing resources to ensure the integrity and security of the blockchain.

2: It would require that one entity control 51% of the mining power and would prove far less rewarding than the rewards and tx fees collected by working honestly.

3: The network regulates mining difficulty based on hashrate. As hashrate increases, difficulty increases. As hashrate decreases so does difficulty.

1 Like
  1. Because there are incentives, Work and make btc (money) in profit.

  2. If you were to go back, you would change the original hash of the block, which in turn changes all proceeding Blocks and Hash. And when the changed block is mined, then miner must catch up and mine the remaining blocks and hash. The Blockchain will only choice the longest Chain as the public ledger and after every cycle wipes out all other blockchain. it would practically be impossible to go back and change a previously added block.

  3. The network regulates mining difficulty to by lowering and raising the difficulty every 10 mins.

  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    • Miners have to solve a cryptographic puzzle and be the fastest to solve the puzzle in order to get his block appended to the blockchain and get a reward.
    • Miners cannot be malicious or make errors. They have to create a block that fits with the consensus rules of the network. If they do not do so, they would lose the money spent on electricity. Since the electricity is paid “upfront”.
  2. Why would it be very difficult for someone to go back and change a previously added block?
    • The blocks are dependent on one-another. This would mean that if a block in the past is changed, the blocks in the future would also have to be changed. This would mean that all the blocks after the amended block would have to be re-mined.
    • Since the difficulty of solving the puzzle and adding a block to the blockchain is proportional to the global hashrate, it becomes practically impossible for a single malicious actor to be able to amend the blockchain w/o spending a huge amount of electricity.
    • The new amended blockchain would also have to be the longer chain to be accepted by the other nodes which means it must have enough hashrate to outpace creation of blocks in the other chain.
  3. How does the network regulate mining difficulty?
    • Using Targets. If difficulty is high, target is low.
    • When the target is low, the miners require more time to guess a hash that is smaller than the target.
    • Difficulty adjustments made every 2 weeks based on the average time it takes to produce a block/ guess a block hash that is lesser than the target.
1 Like