Author

Topic: How is difficulty agreed upon? (Read 1309 times)

jr. member
Activity: 42
Merit: 1
May 23, 2011, 06:09:35 PM
#4
In other words, all clients have it hardcoded in them that every 2016 blocks, they need to figure out by what percentage the actual timespan for creating those blocks varied from two weeks. The current difficulty is then multiplied by that percentage to get the new difficulty. All the clients will then only accept new blocks that meet the new difficulty requirement.

Usually, everyone knows about the length of the block chain at the same time, so everyone does the same calculation to know the next difficulty. If one client were to try to "cheat", and not raise the difficulty when it should be raised, it would make no difference to the network at large. They would all simply reject blocks that that client would generate if they didn't meet the difficulty that had been calculated by the rest of the network.
k
sr. member
Activity: 451
Merit: 250
May 23, 2011, 04:50:23 PM
#3
 i think it's something like this.

expected time for 2016 blocks = 14 days
actual time= 10 days say

difficulty increase = 14/10 = 1.4

new difficulty = old difficulty x difficulty increase

for the previous difficulty change the numbers were something like


9.02751 days for 2016 blocks
difficulty before last change 157,426

new difficulty = 157,426 * (14/9.0275) = 244,139

legendary
Activity: 1072
Merit: 1181
May 23, 2011, 04:43:24 PM
#2
The difficulty is calculated through a formula that is based purely on information in the block chain, and is only valid within a particular branch of the block chain. Since everybody has this information, everybody just calculates it and verifies it for each incoming block. So the answer is: everyone.
member
Activity: 75
Merit: 10
May 23, 2011, 04:37:12 PM
#1

After 2016 blocks, what is the process? Does the miner calculate the difficulty? How is it trusted?

Jump to: