Homework on Mining and Proof of Work - Questions

  1. To decentivize malicious intent
  2. One would have to rehash all proceeding blocks in the chain
  3. As more mining power enters the network the less likely it is to discover an acceptable hash
1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?

To decentivize them from cheating on the network. Because it cost a lot of money and electricity to do mining they have no other choice but to follow the rule and make it as an investment to get profit from it. No one will spend a lot of money and electricity to do all this mining if they weren’t getting something in return or a reward.

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

Because all the blocks are cryptographic related and connected with each other. When you change something in a block you need to change all the blocks.

  1. How does the network regulate mining difficulty?

The more miners, the more difficult to solve the puzzle. The target range decreases the more miners in the network making the puzzle to become more difficult to solve. The less miners in the network making the puzzle easy to solve, which incentivizes more miners to join the network.

1 Like

Why is it important to make sure that miners spend money (on electricity) while mining?
so that they can be incentivised to keep mining according to the rules to earn the block rewards and fees

Why would it be very difficult for someone to go back change a previously added block?
the blocks are linked via cryptographic hashes based on the content of blocks, their hashes an nonces. so if these change the whole link becomes compromised and invalidated because all the blocks are linked through mathematical cryptography .

How does the network regulate mining difficulty?
By dropping or making the target value for the hash value during the mining process smaller and hence more difficult to achieve a result below the target for each random nonce guess to be able to claim the mining benefits.

1 Like
  1. Because in this way, the miners are forced to make an initial investment (in electricity) and in order to recover their spend money, they have the incetive to follow the rules.
  2. Since the hash of every block is also based on the hash of previous blocks, the link would be broken for all coming blocks and it would need to mine all blocks again plus the accumulated new ones.
  3. If there are a lot of miners, the nonce will be lower therefore the target will be more difficult to reach
1 Like
  1. Because if miners spend money upfront they are more incentivated in working harder for getting rewards.

  2. Because if you change just a fraction of information all the later hashes change. Hence you would have to re-mine all the future blocks starting from the one you had changed. Such an operation could take infinite time and would cost a lot of electricity (money).

  3. The difficulty in the network is regulated by the target number. The more the miners, the lower the target number and the higher the difficulty.

1 Like
  1. Why is it important to make sure that miners spend money (on electricity) while mining?
    Proof of Work. Secondly, to prevent fraud or cheating.
  2. Why would it be very difficult for someone to go back change a previously added block?
    When you go back to change one block it breaks the links of the subsequently mined blocks meaning you would waste hash power without incentive.
  3. How does the network regulate mining difficulty?
    If there are more miners, the difficulty to guess the nonce is increased by lowering the target.
1 Like
  1. It is important because the sunk costs ensure the minors are incentivized enough to play by the rules and keep competing for the next block.

  2. It would be very difficult because the amount of time and resources it would take to mint a counterfeit block would be astronomical and you would then immediately have to mint blocks faster than the rest of the blockchain in order to have the longest chain.

  3. The network regulates mining difficulty by lowering the target hash by an amount inversely proportionate to the amount of miners currently on the network. This increases mining difficulty as more miners join the network.

1 Like
  1. To make sure miners will spend money on electricity there is in bitcoin blockchain some kind of cryptographic puzzle which involves CPUs to guess the number which leads to hash lower than specified target.
  2. Because it would be required to recalculate all the cryptographic puzzles since the block which was changed and during this recalculation new blocks will be mined in the orginal blockchain. This trial would require a lot of electricity (so it would not be profitable).
  3. Network regulates difficulty by changing the target number below which the hash must be calculated as a valid one. The target is changed according to current hash rate. The bigger hash rate, the lower target so the more difficult to mine the block.
1 Like

1.Because of that miners will have incentive to play by the rules.
2.Because is very expensive to do it.
3.Difficulty is raising with hashing power. The more miners, the more is difficult.

1 Like
  1. It is important that miners spend money on electricity while mining because they will lose out if they do not play by the rules. Bascially, if the miner plays by the rules they will be compensated for the electricity cost and gains some bitcoins as profit.

  2. If some on goes back and changes a transaction on a previous block, it would invalidate the entire chain, on top of that they would have to remine all the subsequent blocks. The thing is that when they do that they will have to continuously catch up with the other miners who are all appending new blocks simultaneously. The only real way to catch up with the other miners is to have at least 51% of the hash rate of the entire network, which is only theoretically possible and not practically possible (however, in my opinion, anything that is theoretically possible might just one day become a practical possibility, would love to discuss that with anyone).

  3. the network regulates mining difficulty by increasing the cryptographic challenge (meaning more hash rate required to solve) when there are more miners, and decreasing the challenge cryptographic puzzle when there are less miners (incentivizing lower hash rate individuals to pick up some mining jobs in these environments).

1 Like

In any case everybody could arrangement a blockchain or can change the entire blockchain. There should be a speculation to have the option to get the blockchain.

Since every one of the squares are cryptographic related with one another. At the point when you change something in a square you need to change every one of the squares.

By checking the time asolution is found.

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

Because by doing so, they are paying the cost to get the incentive. To compensate the cost of electricity they will go by rules of law so that they can win the block reward. all this activity will ensure Blockchain Security.

In other wards if mining the block was set to be free of cost than security of the blockchain was being compromised. anyone can anytime mined or re-mined the block.

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

Because tempering any block in blockchain effect the subsequent blocks. because each block contain hash of the previous block. Tempering the block data will change the hash of that block and all the block afterward subsequently.

secondly it will cost them hell lot of money in the form of electricity and ages to do so.

  1. How does the network regulate mining difficulty?
    Network is designed to mined 1 block every 10 minutes and to achieve this target it regulate the mining difficulty by taking account the number of miners in the network and by adjusting the target value.

More miners = More competition = More difficulty so target is set high to accommodate the network.
Less Miners = Less competition = less difficulty so target is set low to increase the difficulty to mined the block.

1 Like
  1. In that case they are incentivized to get their money back that they had spent on electricity + rewards that they will get from mining
  2. Because you will need to change all of the blocks that were after it as hashing number will change.
  3. By lowering the target and raising difficulty
1 Like
  1. forced up front fee to incentivize mining block for reward (without new block output no reward is given)

  2. all blocks linked like a chain, to alter a prev. block , all blocks after must be altered as well and it is virtually impossible to catch up to current blocks, thus wasting electricity$$$

  3. setting a lower target for more miners, vice versa. higher target , less miners

1 Like
  1. It is all about insentives. Because miners have to spend money up front the only way to get the money back is to play by the rules and mine correctly

  2. Because they would have to go back intime and catch up to the block being currently mined which is the longest block. For someone to this by themselves would be practicaly impossible. (51% ???)

  3. The target is adjusted according to the how many miners there are.

2 Likes

1. Why is it important to make sure that miners spend money (on electricity) while mining?
It is important to incentivize them to spend money on electricity in advance, so they are motivated to play by the rules, because that is the only way they get rewarded.

2. Why would it be very difficult for someone to go back change a previously added block?
Several reasons. 1) It would change the hash of that block. 2) because of 1, it would change hashes of all following blocks. 3) because of 2), someone would have to solve the puzzle for all the new hashes they created for already existing blocks. This is very time-taxing procedure and by the time they would reach the block which was the latest block in the blockchain when they made the change, miners would already have created a lot of blocks.

3. How does the network regulate mining difficulty?
By adjusting the “target number”. Miners have to guess such a nonce, that after hashing hash of previous block, data in “proposed block” and guessed nonce, resulting output (hash) is below that “target number”

2 Likes
  1. This ensures the miners have a real-world financial incentive (“skin in the game”) to continue mining to recover their investment (electricity costs).
  2. Changing a previous block would break the link and hash data for all blocks down the chain. The attacker would then need to re-hash a large amount of data quickly to become the longest chain.
  3. The difficulty of the nonce is adjusted, raised or lowered, with the hash rate of the network.
1 Like
  1. So that the miners will stay honest and work within the rules. If they are spending money on electricity, they want to make a profit on the amount of money used to mine.

  2. If you change one thing in a previous block it then changes everything in the block after that transaction. And the math to get the blocks after that change to their original transaction would take weeks, months, or even years. Meanwhile other miners would be confirming blocks and getting paid. You do not get rewards unless you are confirming blocks on the blockchain.

  3. It calculates a certain amount of time for a block to be mined, if the blocks are getting finished too fast, the network makes it more difficult to hash. If the amount of time to mine a block is slower than the calculated time it becomes easier to hash.

2 Likes
  1. Because if they are not financially incentivised to make money proving their work the blockchain would not work, all the system would be flawed, because they can change transactions, and be dishonest.

  2. Because all blocks are related to each other, like a chain, if someone wants to change a previously added block, he should change every previous block, and that could take a lot of years, so that would be tecnically imposible.

  3. The network regulates mining difficulty by changing the target, when the network has a lot of miners, the treshold that gives the target becomes lower, so its harder and harder to guess the nonce correctly, an viceversa.

1 Like

Homework on Mining & Proof of Work - Notes & Answers

NOTES:
=======
Mining Intro

  • Mining does the following
    • Secures the network: this means that transactions cannot be censored, there is no double spending, and you cannot alter history of transactions
      • Hashrate = computing power (how strong are all computers that are mining bitcoin? We only care about the power NOT the number of computers in the network)
      • The higher the hash rate the more secure the system
    • Incentives: miners get paid for each block, thus they are incentivized to play by the rules
    • Consensus algorithm of Bitcoin = Proof of Work (PoW)
    • PoW ensures all miners are playing by the rules and thus we reach consensus (only one version of the truth)

Mining PoW & Incentives

  • How does PoW ensure miners play by the rules? (trust in math/physics vs. centralized entity)
    • Make miners spend a lot of electricity
      • All miners trying to append new block compete with each other to solve difficult cryptographic puzzle --> solving this puzzle requires them to do heavy computation and hence spend a lot of money on electricity
  • The miner that solves the puzzle the fastest gets:
    • Block Reward (inflation)
    • TXN fees from all transactions in the block
  • Once the next block is added to the blockchain then this is propagated to the nodes in the network. If for some reason the network finds errors in your block (i.e. Double spending, other rules broken, etc…) then your block will be rejected by the network. If you are rejected then you will not get the rewards and keep in mind that you already paid upfront by using a lot of electricity to “solve” the block.

Block Rewards & Halvenings

  • First transactions of any block is an empty transaction representing the inflation (block reward)
  • Bitcoin reward per block is cut in half every 4 years
  • Although rewards half, miners will still be incentivized to mine blocks because as more users use the network then the amount they earn in transactions fees will increase and make up for the decrease in block rewards

PoW & Integrity

  • Difficulty of puzzle is proportional to the hashrate of the network. Hence the more people are mining the more difficult it is to solve
  • Network will always choose the network with the longest chain (aka chain with most PoW)
  • Link between blocks is based on contents of previous blocks as well as the need one being added. Thus if any transaction is changed in the past then all links after that block are broken. Hence if someone wants to “hack” the bitcoin blockchain they would need to not only redo and resolve the puzzle for every link that was broken but also play catch up and solve the new blocks faster than all the other miners in the network … hence theoretically possible to hack but practically IMPOSSIBLE as it would take hundreds of years and millions of dollars

Math Behind PoW

  • SHA256(Date) = hash
    • Hash is output of hash function like SHA256 (digital fingerprint)
  • The Hash of each block is based on
    1. Hash of previous block
    2. Contents (transactions) of that block
    3. Nonce: random number miners have to guess
  • How miners mathematically “win” and solve the puzzle
    • Miners need to pick a nonce such that the hash we generate (based off the nonce, transactions, and previous hash) is LESS than a target
  • Hence the hash of the current block will change if you change any transactions in that block or transactions in any previous blocks
  • The target is a number based off the difficulty of the Bitcoin network
  • Higher difficulty --> lower target number

ANSWERS:
=========

1) Q: Why is important to make sure that miners spend money (on electricity) while mining?
A: This incentivizes miners to “play by the rules” by requiring them to pay up front at a chance to win the cryptographic puzzle to gain rewards (block rewards + transaction fees).

2) Q: Why would it be very difficult for someone to go back change a previously added block?
A) Blocks are connected thus if they change a block in the past then all links after that are broken and thus the miner needs to solve many puzzles to restore all of those links. This does not even included the new links for the newly appended blocks they must solve.

3) Q: How does the network regulate mining difficulty?
A) Mining difficulty is correlated to the number of miners in the network. The more miners --> the higher the difficulty to solve the puzzle --> the lower the target

1 Like