summaryrefslogtreecommitdiff
path: root/53/7ca38cb1e4fe790699fd290fc27c193490c0b7
blob: 3253e55c806893ad788e399d045e42b969e7306f (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
Return-Path: <natanael.l@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 2E0DCCD4
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 24 May 2019 08:36:35 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-io1-f47.google.com (mail-io1-f47.google.com
	[209.85.166.47])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B754FF4
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 24 May 2019 08:36:34 +0000 (UTC)
Received: by mail-io1-f47.google.com with SMTP id u2so7146059ioc.4
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 24 May 2019 01:36:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:references:in-reply-to:from:date:message-id:subject:to
	:cc; bh=AfVMDJ6dUyi28gF4pUYumEDoih6vc3ZX2v1qunVHU1Q=;
	b=h1gIeB9QLgdMhi9BBhHLSfhcvdwg1s0KxAh5VQ5Kk/5S9IyLt0JjAbaHq63RLoJqo8
	YBAck/mQzzpJluJ9KUhICTZeQo6suNcV3nMLqqvkO6on7wtasyxzDJyfRbV1NTOHmLZ+
	H9KVLn6s+kRn+CnXDV3U/98OiaP4ejMQjI1HAHNYuKkkcdGKpOLWwW5lb4IylSm+Y6Rx
	jsayzOCXspvAtQ6/X+uAkY+KCnk8QzOhpgVB0r8rWGjp1nNN+/1lR1+5wZo2sSAsu/Gy
	bVVqYiDblpX44HZ9gWLIkxNN4A97QvN8xlixjoorE9vlaMm5OsVUXmmTG9uBgBXx8rEG
	YG6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:cc;
	bh=AfVMDJ6dUyi28gF4pUYumEDoih6vc3ZX2v1qunVHU1Q=;
	b=GBFo5R/14saa5X+6rpMq1hSC3FbGGyDWSw0yrZuTXRyIeVBgwvhAwIW2y/n/WdTeAz
	PxcKeW9Ik3ejSFW24VuPqsclw7EvK41Jir4snXbmARMZmj7I6eGfCcs9r5jJee2Q6iys
	eN4KuJMFRkBXwB1AxjDee8QPcWa2+ppsytT5j6SNKvtx2M+1d4OotoI361Ok8g7WoCAC
	551U/dztm+z1u9MmHLa2dHu/c26RCZDi3HVxZNGQ3BtUqhbteq1bO6oMm/Pgu76+tujN
	3B84w3FdW53Y/dMdkcu2/JAK2tKA7b0ara07kBkiM1XreYfC1ANimTvs0Yt8/btgqUyQ
	VFXw==
X-Gm-Message-State: APjAAAW98DMO6CJzUzzM0yYCcHfMjV3ihytuEBWLQw5jfkRz+3faPQjU
	XkxHc7VFtmVe7jiOo3W7ZoonROmE6hGopTPJwfA=
X-Google-Smtp-Source: APXvYqyQcPlok3D4CneITNEFrBjfzZQ1Jo0P2pCzY4EmHZjSxhxxRru99IIbmzE50DUslunIUVb9R+LrO5XERt5+hmY=
X-Received: by 2002:a05:6602:218f:: with SMTP id
	b15mr1051157iob.233.1558686993889; 
	Fri, 24 May 2019 01:36:33 -0700 (PDT)
MIME-Version: 1.0
References: <CAD5xwhgHyR5qdd09ikvA_vgepj4o+Aqb0JA_T6FuqX56ZNe1RQ@mail.gmail.com>
	<42F53D61-BAAE-464F-BB0D-4D0CDC554D9A@gmail.com>
	<CAPg+sBged=ivVLj9tAM6zZdvWdYnG5pj4gozac5EupFPLtwyfA@mail.gmail.com>
In-Reply-To: <CAPg+sBged=ivVLj9tAM6zZdvWdYnG5pj4gozac5EupFPLtwyfA@mail.gmail.com>
From: Natanael <natanael.l@gmail.com>
Date: Fri, 24 May 2019 10:36:14 +0200
Message-ID: <CAAt2M1_PKnJ5tR3VHgUg-=ibNVVp-Yocqa9KeUQhVj0X2PstGA@mail.gmail.com>
To: Pieter Wuille <pieter.wuille@gmail.com>, 
	Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="000000000000963cfd05899e181c"
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE 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: Fri, 24 May 2019 14:39:19 +0000
Subject: Re: [bitcoin-dev] OP_DIFFICULTY to enable difficulty hedges (bets)
 without an oracle and 3rd party.
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
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: Fri, 24 May 2019 08:36:35 -0000

--000000000000963cfd05899e181c
Content-Type: text/plain; charset="UTF-8"

On Thu, May 23, 2019 at 9:58 PM Pieter Wuille via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> If the difficulty can be directly observed by the script language, you
> would need to re-evaluate all scripts in unconfirmed transactions
> whenever the difficulty changes. This complicates implementation of
> mempools, but it also makes reasoning about validity of (chains of)
> unconfirmed transactions harder, as an unconfirmed predecessor may
> have conditions that change over time.


To deal with potentially wildly varying difficulty, could the value exposed
be the sum of accumulated PoW, or in other words the sum of each block's
difficulty value in the entire chain? This should be a value that will only
rise unless a reorg happens after a difficulty drop happens (only likely to
be the result of users manually blacklisting an otherwise valid block that
is several blocks back in the chain).

This mimics the effect of the block number which only grows. So if you're
starting at time A with difficulty X, then you'd estimate what you think
the accumulated PoW ought to be at time B with expected difficulty Y (as
compared to the current value at time A), and put that value into the
script.

--000000000000963cfd05899e181c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Thu, May 23, 2019 at 9:58 PM Pieter Wu=
ille via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundatio=
n.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><div c=
lass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If t=
he difficulty can be directly observed by the script language, you<br>
would need to re-evaluate all scripts in unconfirmed transactions<br>
whenever the difficulty changes. This complicates implementation of<br>
mempools, but it also makes reasoning about validity of (chains of)<br>
unconfirmed transactions harder, as an unconfirmed predecessor may<br>
have conditions that change over time.</blockquote><div><br></div><div>To d=
eal with potentially wildly varying difficulty, could the value exposed be =
the sum of accumulated PoW, or in other words the sum of each block&#39;s d=
ifficulty value in the entire chain? This should be a value that will only =
rise unless a reorg happens after a difficulty drop happens (only likely to=
 be the result of users manually blacklisting an otherwise valid block that=
 is several blocks back in the chain).</div><div><br></div><div>This mimics=
 the effect of the block number which only grows. So if you&#39;re starting=
 at time A with difficulty X, then you&#39;d estimate what you think the ac=
cumulated PoW ought to be at time B with expected difficulty Y (as compared=
 to the current value at time A), and put that value into the script.</div>=
</div></div>

--000000000000963cfd05899e181c--