From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1C508CC9 for ; Wed, 9 Mar 2016 01:27:44 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-vk0-f42.google.com (mail-vk0-f42.google.com [209.85.213.42]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id F17B413F for ; Wed, 9 Mar 2016 01:27:42 +0000 (UTC) Received: by mail-vk0-f42.google.com with SMTP id e6so39078915vkh.2 for ; Tue, 08 Mar 2016 17:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZqkccuGYVGpN4YXAGZHLZsvE5FmnGAgSO+S87WZDmqQ=; b=JGXsjbMYt1SEVZizGFetVOdj1GFDoRGAr7sQGVdh0mmCGwi65x3Kmn2eC7U9NndI6D ToMeD7SHPxWTKfeq8lxPLahpC4b/H2y+cCNeKJYKFN7YJ8inOBfBXcHXEMiZJxH2RxQl VTqhAMRA3ImLrGWuaasT4NRxQ39dOx3+SltjeTEBgjeArn+T4wVuzoy1HtlpuS/kkWJI TLkpv1JmkUIQTDkAcaSmaXRpTY/WF/WZfudsVHpxmW6ZTdj2pd1iSUhG+lPmPs1cqlRs r7tQR9DpvgrFRva8x20P3zkZulZ2/zfnc3BIq9lt7SduUxehCyCs63mrcBfQr1chwtos 1uOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ZqkccuGYVGpN4YXAGZHLZsvE5FmnGAgSO+S87WZDmqQ=; b=J8wj8rekFNqzC65CXWsA5DGV6k4tcTIydOGcOoM9cNYrcHKIQvRO7BNhWHgR5RJS55 4NdPZ/mL5cTi1ilphhVSKpAE7MhCucfvqrb2fh2LYNTYdJJpfUb3tZ9eVl/fVToJ1NEs ljmuTpK3enE+xf1Ywa/5ceY2CW+ZsQ/d007rQ3KSessajPx9t7Fp/HPK+SceArT6LIXT P9H8KGvvqQ+asSlAF902sdtY+l+V4QUhFfpBo4OvPe6g6W04EFFzx8QvAJ9JJMzQmHW4 l+XwQ/+HfvZ282G64Q8RlqKqQLzQCXyNnuVWb8NL05/goclez+kRxdCHw5rZYTdcyMnu h34A== X-Gm-Message-State: AD7BkJKIhoOD4Hyn7JMfEtIai/gY8X+dlwLHOFj+vzNRkYl2ZTkGLMqa3O3StnJOiLyEsuyQvPhry984Ck2XFw== X-Received: by 10.31.133.7 with SMTP id h7mr28826366vkd.32.1457486862027; Tue, 08 Mar 2016 17:27:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.106.65 with HTTP; Tue, 8 Mar 2016 17:27:22 -0800 (PST) In-Reply-To: References: From: Daniele Pinna Date: Wed, 9 Mar 2016 02:27:22 +0100 Message-ID: To: Bitcoin Dev Content-Type: multipart/alternative; boundary=001a114123c6ad12b9052d939ae2 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Wed, 09 Mar 2016 05:44:06 +0000 Subject: Re: [bitcoin-dev] bitcoin-dev Digest, Vol 10, Issue 13 X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 01:27:44 -0000 --001a114123c6ad12b9052d939ae2 Content-Type: text/plain; charset=UTF-8 This seems unnecessarily complicated ("don't use cannon to kill mosquito" kind of thing). If the community were interested in a realtime hashrate rebalancing proposal one could simply adjust difficulty at each new block using the current method. If faster relaxation in case of adversity is required, it suspect that it would suffice to perform a weighted average of the previous 2016 blocks instead of the standard averaging that is currently done. It should be possible to find an optimal weighting based on historical interblock timing data. I look into it over the next couple of days. dpinna > ------------------------------ > > Message: 3 > Date: Tue, 8 Mar 2016 22:05:07 +0000 > From: Bob McElrath > To: Dave Hudson > Cc: bitcoin-dev@lists.linuxfoundation.org > Subject: Re: [bitcoin-dev] Hardfork to fix difficulty drop algorithm > Message-ID: <20160308220507.GA4388@mcelrath.org> > Content-Type: text/plain; charset=us-ascii > > Dave Hudson via bitcoin-dev [bitcoin-dev@lists.linuxfoundation.org] wrote: > > I think the biggest question here would be how would the difficulty > > retargeting be changed? Without seeing the algorithm proposal it's > difficult > > to assess the impact that it would have, but my intuition is that this is > > likely to be problematic. > > I have no comment on whether this will be *needed* but there's a simple > algorithm that I haven't seen any coin adopt, that I think needs to be: the > critically damped harmonic oscillator: > > http://mathworld.wolfram.com/CriticallyDampedSimpleHarmonicMotion.html > > In dynamical systems one does a derivative expansion. Here we want to > find the > first and second derivatives (in time) of the hashrate. These can be > determined > by a method of finite differences, or fancier algorithms which use a > quadratic > or quartic polynomial approximation. Two derivatives are generally all > that is > needed, and the resulting dynamical system is a damped harmonic oscillator. > > A damped harmonic oscillator is basically how your car's shock absorbers > work. > The relevant differential equation has two parameters: the oscillation > frequency > and damping factor. The maximum oscillation frequency is the block rate. > Any > oscillation faster than the block rate cannot be measured by block times. > The > damping rate is an exponential decay and for critical damping is twice the > oscillation frequency. > > So, this is a zero parameter, optimal damping solution for a varying > hashrate. > This is inherently a numeric approximation solution to a differential > equation, > so questions of approximations for the hashrate enter, but that's all. > Weak > block proposals will be able to get better approximations to the hashrate. > > If solving this problem is deemed desirable, I can put some time into > this, or > direct others as to how to go about it. > > -- > Cheers, Bob McElrath > > "For every complex problem, there is a solution that is simple, neat, and > wrong." > -- H. L. Mencken > > --001a114123c6ad12b9052d939ae2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This seems unnecessarily complicated ("don't use cannon to kill m= osquito" kind of thing). If the community were interested in a realtim= e hashrate rebalancing proposal one could simply adjust difficulty at each = new block using the current method.

If faster relaxation in case of= adversity is required, it suspect that it would suffice to perform a weigh= ted average of the previous 2016 blocks instead of the standard averaging t= hat is currently done. It should be possible to find an optimal weighting b= ased on historical interblock timing data. I look into it over the next cou= ple of days.

dpinna

<= br>
=C2=A0
------------------------------

Message: 3
Date: Tue, 8 Mar 2016 22:05:07 +0000
From: Bob McElrath <bob_bitc= oin@mcelrath.org>
To: Dave Hudson <dave@hashingit.co= m>
Cc: bitcoin-dev@li= sts.linuxfoundation.org
Subject: Re: [bitcoin-dev] Hardfork to fix difficulty drop algorithm
Message-ID: <20160= 308220507.GA4388@mcelrath.org>
Content-Type: text/plain; charset=3Dus-ascii

Dave Hudson via bitcoin-dev [bitcoin-dev@lists.linuxfoundation.org] wrote:
> I think the biggest question here would be how would the difficulty > retargeting be changed?=C2=A0 Without seeing the algorithm proposal it= 's difficult
> to assess the impact that it would have, but my intuition is that this= is
> likely to be problematic.

I have no comment on whether this will be *needed* but there's a simple=
algorithm that I haven't seen any coin adopt, that I think needs to be:= the
critically damped harmonic oscillator:

=C2=A0 =C2=A0 http://mathworld= .wolfram.com/CriticallyDampedSimpleHarmonicMotion.html

In dynamical systems one does a derivative expansion.=C2=A0 Here we want to= find the
first and second derivatives (in time) of the hashrate.=C2=A0 These can be = determined
by a method of finite differences, or fancier algorithms which use a quadra= tic
or quartic polynomial approximation.=C2=A0 Two derivatives are generally al= l that is
needed, and the resulting dynamical system is a damped harmonic oscillator.=

A damped harmonic oscillator is basically how your car's shock absorber= s work.
The relevant differential equation has two parameters: the oscillation freq= uency
and damping factor.=C2=A0 The maximum oscillation frequency is the block ra= te.=C2=A0 Any
oscillation faster than the block rate cannot be measured by block times.= =C2=A0 The
damping rate is an exponential decay and for critical damping is twice the<= br> oscillation frequency.

So, this is a zero parameter, optimal damping solution for a varying hashra= te.
This is inherently a numeric approximation solution to a differential equat= ion,
so questions of approximations for the hashrate enter, but that's all.= =C2=A0 Weak
block proposals will be able to get better approximations to the hashrate.<= br>
If solving this problem is deemed desirable, I can put some time into this,= or
direct others as to how to go about it.

--
Cheers, Bob McElrath

"For every complex problem, there is a solution that is simple, neat, = and wrong."
=C2=A0 =C2=A0 -- H. L. Mencken

--001a114123c6ad12b9052d939ae2--