Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8F1D882 for ; Fri, 3 Nov 2017 01:59:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D302C44D for ; Fri, 3 Nov 2017 01:59:49 +0000 (UTC) Received: by mail-wm0-f48.google.com with SMTP id r196so2264648wmf.2 for ; Thu, 02 Nov 2017 18:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4t5iubq+Tq3a9e5TSa2GrktelL9h0kGqeTuQbzGpAWA=; b=Z5l4rODxu7th5mStd2uzUW7nqP1OryTYFfo5FL9J+vxtMrB1o31ftmM7bbTxfRNm35 xSzb30eceE8CQodynxgufxCU96gVcnP79v8h2otBRyVUDuIuTplNTKD0fepnnppRuCEb Rv0u5yffyGh66aCs8UcucB+r0rXR+I6j1U8rj+wzY9jkJZjK/spi+IYHragiqpjfoM5i IV9ADDkM0RZY0gY+WkTS6bqDecqB1DjDGeZ9lnRxcBqRT8pu00rYyf0epklpPlQEwPHW OohTrH81tH0doai9fxbablNmX3/nX4uk9zcnJXl2H9iojkcNROJOACkfcUoR/ykyc7mw JQ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4t5iubq+Tq3a9e5TSa2GrktelL9h0kGqeTuQbzGpAWA=; b=oswFr4QzvwJa1+XQNkMZYo43yx6zV38tAmxzAERJrVsaQzZVA2bJLqjjFn8F6q5S51 mcqphRuuDgC3lUhEfXiNtpa02auvOiF7mS9bp6iOCY5Ib0irZxfMKZCmK8AYI8gQzxu6 4JS4XvALViPMW9Yo7A17HeeGTgAbWgRd7mcg39gud1VXcOlYIZ2E/Cq8NV2pBk08FxtR 3GUEUYTFGNAarc7x++PDEc8cg3TekJQj7bw+tApOknHgX+GoJTiViJjyn6ftM/R0wwxU sxesDcU+wOGg678EYfj3guQF/9dQRLNpB9/VPXakVFkiV6bslq7u7cJAeZN9Er4Cut7J dAqQ== X-Gm-Message-State: AMCzsaXmu2Ueg6ZtfVZrWz8QWijo35hqnBRRmFW2gP3I9ARau8YJlHd4 TS2t7v35pG2Yqt8hzmsS9V9wFGvLliLmXj0rgjI= X-Google-Smtp-Source: ABhQp+TPpkPm+LuNKO2HCwJnYl3nwqK1eILyBIBFzjz1+zGhZn0xkSyoRdjHRTukuQpWK5mM8XISo/W/fz5+QI+ziHA= X-Received: by 10.80.218.72 with SMTP id a8mr6685494edk.221.1509674388326; Thu, 02 Nov 2017 18:59:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.173.10 with HTTP; Thu, 2 Nov 2017 18:59:47 -0700 (PDT) In-Reply-To: References: From: Scott Roberts Date: Thu, 2 Nov 2017 21:59:47 -0400 Message-ID: To: CryptAxe Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Fri, 03 Nov 2017 12:23:50 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] Bitcoin Cash's new difficulty algorithm X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2017 01:59:50 -0000 The current DA is only sufficient if the coin has the highest hashpower. It's also just really slow. If miners somehow stick with SegWit2x despite the higher rewards in defecting back to bitcoin, then bitcoin will have long block delays. High transaction fees will probably help them defect back to us. But if SegWit2x manages to be more comparable in price than BCH (despite the futures), hashpower could very well oscillate back and forth between the two coins, causing delays in both of them. The first one to hard fork to fix the difficulty problem will have a large advantage, as evidenced by what happens in alts. In any event someday BTC may not be the biggest kid on the block and will need a difficulty algorithm that alts would find acceptable. Few alts use anything like BTC's because they are not able to survive the resulting long delays. I am recommending BTC developers watch what happens as BCH goes live with a much better algorithm, in case BTC needs to hard fork for the same reason and needs a similar fix. Ignore the trolls. On Thu, Nov 2, 2017 at 7:39 PM, CryptAxe wrote: > Is there an issue with the current difficulty adjustment algorithm? It's > worked very well as far as I can tell. Introducing a new one seems pretty > risky, what would the benefit be? > > On Nov 2, 2017 4:34 PM, "Scott Roberts via bitcoin-dev" > wrote: >> >> Bitcoin cash will hard fork on Nov 13 to implement a new difficulty >> algorithm. Bitcoin itself might need to hard fork to employ a similar >> algorithm. It's about as good as they come because it followed the >> "simplest is best" route. Their averaging window is probably >> significantly too long (N=144). It's: >> >> next_D = sum (past 144 D's) * T / sum(past 144 solvetimes) >> >> They correctly did not use max(timestamp) - min(timestamp) in the >> denominator like others do. >> >> They've written the code and they're about to use it live, so Bitcoin >> will have a clear, simple, and tested path if it suddenly needs to >> hard fork due to having 20x delays for the next 2000 blocks (taking it >> a year to get unstuck). >> >> Details on it and the decision process: >> https://www.bitcoinabc.org/november >> >> It uses a nice median of 3 for the beginning and end of the window to >> help alleviate bad timestamp problems. It's nice, helps a little, but >> will also slow its response by 1 block. They also have 2x and 1/2 >> limits on the adjustment per block, which is a lot more than they will >> ever need. >> >> I recommend bitcoin consider using it and making it N=50 instead of 144. >> >> I have seen that any attempts to modify the above with things like a >> low pass filter, starting the window at MTP, or preventing negative >> timestamps will only reduce its effectiveness. Bitcoin's +12 and -6 >> limits on the timestamps are sufficient and well chosen, although >> something a bit smaller than the +12 might have been better. >> >> One of the contenders to the above is new and actually better, devised >> by Degnr8 and they call it D622 or wt-144.It's a little better than >> they realize. It's the only real improvement in difficulty algorithms >> since the rolling average. It gives a linearly higher weight to the >> more recent timestamps. Otherwise it is the same. Others have probably >> come across it, but there is too much noise in difficulty algorithms >> to find the good ones. >> >> # Degnr8's D622 difficulty algorithm >> # T=TargetTime, S=Solvetime >> # modified by zawy >> for i = 1 to N (from oldest to most recent block) >> t += T[i] / D[i] * i >> j += i >> next i >> next_D = j / t * T >> >> I believe any modification to the above strict mathematical weighted >> average will reduce it's effectiveness. It does not oscillate anymore >> than regular algos and rises faster and drops faster, when needed. >> _______________________________________________ >> bitcoin-dev mailing list >> bitcoin-dev@lists.linuxfoundation.org >> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev