summaryrefslogtreecommitdiff
path: root/06/8852465d591da9c02300ea578fc7514787a6ca
blob: e04fd38367decf114cf15477c9f91c42863c07b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Return-Path: <thomashartman1@gmail.com>
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 91DD7C0051
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 19 Aug 2020 21:15:14 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by silver.osuosl.org (Postfix) with ESMTP id 7533B221DC
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 19 Aug 2020 21:15:14 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from silver.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id DpY29hEGl7Vj
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 19 Aug 2020 21:15:13 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com
 [209.85.219.46])
 by silver.osuosl.org (Postfix) with ESMTPS id 741D421FAD
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 19 Aug 2020 21:15:13 +0000 (UTC)
Received: by mail-qv1-f46.google.com with SMTP id b2so4291qvp.9
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 19 Aug 2020 14:15:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:mime-version:subject:date:references:to:in-reply-to:message-id;
 bh=lnSD7rx2aFK61BXtb5A8tY9qDgxDbmPNpnhK2qXrRZs=;
 b=TOeEOUaQAPa0YsQz+o4xNrFe2wzg0HV2HLOUhONtQh1SLfBLLnM3K7MMG1ADZ6lBqe
 z3ob5wdZtDcmAg5S7ofkNFX5SdtIQCJxIZRQVt7ZAfHWviEnSIa5GO8zkXWL1Z64XmNL
 ciwTcd38J9cVSnmFMvY2NR/9ZssVx4zVIA0rF3i28DGx43CjlZdrvDWH/1Tt0nBltRxB
 OK/3x7erGBss3yoL7S/e/nu8dHIMFSDlx3Tg3l2aMO/wIfVt+JifDAhMsSAJ0bowjq+x
 mKrxt1s8sL8e6b1caT/nJ+Kl2EaaPgTNkSJY8RpDewMiVrO3cE8TbgZcPSXS+ct9Suma
 KT7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:mime-version:subject:date:references:to
 :in-reply-to:message-id;
 bh=lnSD7rx2aFK61BXtb5A8tY9qDgxDbmPNpnhK2qXrRZs=;
 b=DBfXm0ZIXuhVTFxxRM7caRxIbVD1X9er9DL1oM+2qie7TsC3fG83rE/0TYQvcHCxI0
 nxXUV4B9iVNyw8J7p3WvZP0elTZ5GMGI3aQLpkYNar1GT6xgNPyVi427RLt0+LzZqSOK
 82NnRzQrBmUsjVHKZJPchBSH/5tCgnH7kCF5vUlWx9LPGS3zVH3Vnj9SHVJBR5LVNaci
 GQUMBcoGQeStPkwmjuOqC6jUplaaW0lwdzlDwWCRBXKD4BTw4MfOMqHRK1ja0+qF2D5h
 dVxvK0X3Nzws/AolmOsiSqSP7dHJPe3Fc49ded/6REYrsZdmMWoXy82VHaC8eWFZATrj
 5FPA==
X-Gm-Message-State: AOAM5314/eEjfeIaYxMW71awonYAxb8zm1jc4wEws45I8BUfVjvZC2kT
 TT1Ahri4UjCKWQ9xv/5i6dxm9tbtweqnkj6Y
X-Google-Smtp-Source: ABdhPJzJBuTcC7L2pvTXjagA6/+1xHWBNiX/S9O+PK/Yaeijg9T4utmlhl7qDYVb7D8lmbAtLhP2ww==
X-Received: by 2002:a0c:a81a:: with SMTP id w26mr175233qva.52.1597871712203;
 Wed, 19 Aug 2020 14:15:12 -0700 (PDT)
Received: from [192.168.43.187] ([172.58.4.14])
 by smtp.gmail.com with ESMTPSA id j15sm24673555qkl.63.2020.08.19.14.15.10
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 19 Aug 2020 14:15:11 -0700 (PDT)
From: Thomas Hartman <thomashartman1@gmail.com>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_98632C2A-C28D-43EB-92CD-68981432E9AA"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Wed, 19 Aug 2020 17:15:08 -0400
References: <CAHAXnDXhAFQHiBCJ=H=1ZGHdHWhgLh1rG3pCPR5o48ziZzV+zQ@mail.gmail.com>
 <CAE-z3OVCcAL2x39TswA8zrZ+yjSqdx4hccTWn9Ug8MQ5=k-Pgg@mail.gmail.com>
To: Tier Nolan <tier.nolan@gmail.com>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
In-Reply-To: <CAE-z3OVCcAL2x39TswA8zrZ+yjSqdx4hccTWn9Ug8MQ5=k-Pgg@mail.gmail.com>
Message-Id: <C4A9F1FC-8BD9-4A03-806B-5091375090B5@gmail.com>
X-Mailer: Apple Mail (2.3445.9.1)
X-Mailman-Approved-At: Wed, 19 Aug 2020 21:21:34 +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 <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Aug 2020 21:15:14 -0000


--Apple-Mail=_98632C2A-C28D-43EB-92CD-68981432E9AA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On Aug 16, 2020, at 2:59 PM, Tier Nolan via bitcoin-dev =
<bitcoin-dev@lists.linuxfoundation.org> wrote:
>=20
> Output 0:  Pay Alice if diff < 1.00 trillion else Bob

What is included in blocks is a packed representation of the difficulty =
target, not the difficulty per se as typically reported on blockchain =
explorer.=20

https://en.bitcoin.it/wiki/Difficulty =
<https://en.bitcoin.it/wiki/Difficulty>

Perhaps what is best for speculation contracts is not the difficulty per =
se, but the ratio between some unknown future difficulty and the current =
difficulty. That is easily obtained from the packed representations =
already included in blocks. IE

Current difficulty / last difficulty =3D 1 / ( current target / last =
target )

To give a worked example, current difficulty is 16.94T, and last =
difficulty was 16.84T.=20
Current packed target is 0x17109bac, last packed target is  0x1710b4f8=09=

16.94 / 16.84 is same as 1 / ( 0x109ba / 0x10b4f8  )  (the 17 is an =
exponent in both cases so leaving it out for clarity).=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

The contract could then work as previously described, except using the =
ratio for ticks instead of the difficulty.=

--Apple-Mail=_98632C2A-C28D-43EB-92CD-68981432E9AA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Aug 16, 2020, at 2:59 PM, Tier Nolan via bitcoin-dev =
&lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" =
class=3D"">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">Output 0:&nbsp; Pay Alice if =
diff &lt; 1.00 trillion else Bob</span></div></blockquote></div><br =
class=3D""><div class=3D""><div class=3D"">What is included in blocks is =
a packed representation of the difficulty target, not the difficulty per =
se as typically reported on blockchain explorer.&nbsp;</div><div =
class=3D""><br class=3D""></div><div class=3D""><a =
href=3D"https://en.bitcoin.it/wiki/Difficulty" =
class=3D"">https://en.bitcoin.it/wiki/Difficulty</a></div><div =
class=3D""><br class=3D""></div><div class=3D"">Perhaps what is best for =
speculation contracts is not the difficulty per se, but the ratio =
between some unknown future difficulty and the current difficulty. That =
is easily obtained from the packed representations already included in =
blocks. IE</div><div class=3D""><br class=3D""></div><div =
class=3D"">Current difficulty / last difficulty =3D 1 / ( current target =
/ last target )</div><div class=3D""><br class=3D""></div><div =
class=3D"">To give a worked example, current difficulty is 16.94T, and =
last difficulty was 16.84T.&nbsp;</div><div class=3D"">Current packed =
target is 0x17109bac, last packed target is &nbsp;0x1710b4f8<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span></div><div class=3D"">16.94 / 16.84 is same as 1 / ( 0x109ba / =
0x10b4f8 &nbsp;) &nbsp;(the 17 is an exponent in both cases so leaving =
it out for clarity).&nbsp;</div><div class=3D""><br class=3D""></div><div =
class=3D"">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.&nbsp;</div><div class=3D""><br class=3D""></div><div class=3D"">The=
 contract could then work as previously described, except using the =
ratio for ticks instead of the difficulty.</div></div></body></html>=

--Apple-Mail=_98632C2A-C28D-43EB-92CD-68981432E9AA--