Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 039E7C0051 for ; Wed, 19 Aug 2020 23:32:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E064686DDB for ; Wed, 19 Aug 2020 23:32:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L6ixLsEvuqYc for ; Wed, 19 Aug 2020 23:32:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by hemlock.osuosl.org (Postfix) with ESMTPS id 50E7F86DA5 for ; Wed, 19 Aug 2020 23:32:30 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id j187so79502qke.11 for ; Wed, 19 Aug 2020 16:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=9u7IB6Ku/hJ34yOYXO9Z83r/W8Iw8oJERHOH1K12JTw=; b=e5ooVu4e0UhMfBfFZr2p1/0im18eHfwauO9X56zGO944Pb4kIkz/UG5rEK+V/v8TvJ a7rBWG7QB4ka6HztnwiIMcxfuz5WJT5OwlNlrIrqduZrkZErDpEepUjW2N3YywJNIoDB +1L3yuQ8GkjpXRL/hXYMMB9DXn60qSd3Oet7evymCQzzIG52puLbt8BRtu44cMtFS4fE Uo0qEwkH+AXMJx/c9iBo5fPE2WumIKOMaAo/YjP7xxozbAGhjvhIg2QtwNcXgAtdcwF8 osr+P+fOVbYH4NSDKeUl1IA/Xyqf5cmFkIqV93DXH2vYpkbBddzgOnnFLqOYdVNX6yfi EpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=9u7IB6Ku/hJ34yOYXO9Z83r/W8Iw8oJERHOH1K12JTw=; b=YnpSZkUJSMThBRkhVVmnnk2AxMd07P7FVHyMvPs079hTHehNt+eF1gBL3cYaIXwPxR 2Y2YvAgOZxIrWalIqgnkAKhXEMUdi2HoWfSaTt/YT9OGdbTP0E6eiP+oHMdsJwIWmquU 8B5l6VOB/AGWto8ktPZMXN+qIt58oa3RX/qre+Urpa6cOd9R8VivOz+UUK2K9UGSBv/v y4DP2et4+5dRHChNaGjMCjbNupoMxQlQbT4WS9f4DVCVXGNAIfOsPAzEKxLiLinvorKl usnnKMOlvPTNxyGn9SKmlWx8CG0+GMjYE+F9QbE8FCcbTeITGW3bTAh3f88fDE415W4Z bXIQ== X-Gm-Message-State: AOAM532t5ivZ9kYNOpqJbSmP/uqGCXEbPLgSKo7LWbcRzfnLEKNwN/NN uB32K4CGoWSAeyz7G3M2lKg= X-Google-Smtp-Source: ABdhPJyU3nshkwsvXnr5Yg4D9zoSbTNiU2wYpc412CEQm0g5C3Bgo8JSzMTmXyCwYCOPsc6TMKD6uw== X-Received: by 2002:a05:620a:1315:: with SMTP id o21mr356341qkj.227.1597879949182; Wed, 19 Aug 2020 16:32:29 -0700 (PDT) Received: from [192.168.43.187] ([172.58.4.204]) by smtp.gmail.com with ESMTPSA id v2sm754824qte.25.2020.08.19.16.32.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2020 16:32:28 -0700 (PDT) From: Thomas Hartman Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Date: Wed, 19 Aug 2020 19:32:25 -0400 References: To: Tier Nolan , Bitcoin Protocol Discussion In-Reply-To: Message-Id: <1EE02345-9A45-427F-AE13-6E96FD25B55E@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) X-Mailman-Approved-At: Thu, 20 Aug 2020 00:05:46 +0000 Subject: Re: [bitcoin-dev] reviving op_difficulty X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 23:32:31 -0000 >=20 > So perhaps the way op_diff should work is take 2 packed targets, 1 = known and 1 unknown at time of contract, and return the ratio.=20 On second thought, I don=E2=80=99t think this is a good idea. The 32-bit = packed difficulty target is equivalent to difficulty, and this is = probably what should get pushed onto the stack. No division is needed, = just the arithmetic less than operator, which is already live in script, = using the tick strategy described by Tier. So it seems to me these = contracts could truly be done with the addition of the single op_diff = opcode. It=E2=80=99s probably less human readable to be using difficulty = target instead of difficulty, but no one reads script anyway.=20 It was also bothering me that difficulty was a floating point number (I = have floating point phobia), so it is great not to have to think about = floats anymore!