{"type":"rich","version":"1.0","author_name":"npub164d4d9z50r3uzguvlmvwdsevs5t7w6y5hjfz72wkafp0wn72nvfq5znx9p","author_url":"https://nostr.ae/npub164d4d9z50r3uzguvlmvwdsevs5t7w6y5hjfz72wkafp0wn72nvfq5znx9p","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2017-11-02\n📝 Original message:Bitcoin cash will hard fork on Nov 13 to implement a new difficulty\nalgorithm.  Bitcoin itself might need to hard fork to employ a similar\nalgorithm. It's about as good as they come because it followed the\n\"simplest is best\" route. Their averaging window is probably\nsignificantly too long (N=144). It's:\n\nnext_D = sum (past 144 D's) * T / sum(past 144 solvetimes)\n\nThey correctly did not use max(timestamp) - min(timestamp) in the\ndenominator like others do.\n\nThey've written the code and they're about to use it live, so Bitcoin\nwill have a clear, simple, and tested path if it suddenly needs to\nhard fork due to having 20x delays for the next 2000 blocks (taking it\na year to get unstuck).\n\nDetails on it and the decision process:\nhttps://www.bitcoinabc.org/november\n\nIt uses a nice median of 3 for the beginning and end of the window to\nhelp alleviate bad timestamp problems. It's nice, helps a little, but\nwill also slow its response by 1 block.  They also have 2x and 1/2\nlimits on the adjustment per block, which is a lot more than they will\never need.\n\nI recommend bitcoin consider using it and making it N=50 instead of 144.\n\nI have seen that any attempts to modify the above with things like a\nlow pass filter, starting the window at MTP, or preventing negative\ntimestamps will only reduce its effectiveness. Bitcoin's +12 and -6\nlimits on the timestamps are sufficient and well chosen, although\nsomething a bit smaller than the +12 might have been better.\n\nOne of the contenders to the above is new and actually better, devised\nby Degnr8 and they call it D622 or wt-144.It's a little better than\nthey realize. It's the only real improvement in difficulty algorithms\nsince the rolling average.  It gives a linearly higher weight to the\nmore recent timestamps. Otherwise it is the same. Others have probably\ncome across it, but there is too much noise in difficulty algorithms\nto find the good ones.\n\n# Degnr8's D622 difficulty algorithm\n# T=TargetTime, S=Solvetime\n# modified by zawy\nfor i = 1 to N  (from oldest to most recent block)\n    t += T[i] / D[i] * i\n    j += i\nnext i\nnext_D = j / t * T\n\nI believe any modification to the above strict mathematical weighted\naverage will reduce it's effectiveness. It does not oscillate anymore\nthan regular algos and rises faster and drops faster, when needed."}
