summaryrefslogtreecommitdiff
path: root/97/2731bccc64e466b2e98d871674e1a91acd2df9
blob: 12b64dd2436c0ec40c3ab515021e728050f413e1 (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
Return-Path: <ZmnSCPxj@protonmail.com>
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 92A0FC07FF
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 17 Aug 2020 05:04:57 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by silver.osuosl.org (Postfix) with ESMTP id 7541820494
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 17 Aug 2020 05:04:57 +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 YO3f3aYTCTzz
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 17 Aug 2020 05:04:55 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail4.protonmail.ch (mail4.protonmail.ch [185.70.40.27])
 by silver.osuosl.org (Postfix) with ESMTPS id F4222204B2
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 17 Aug 2020 05:04:54 +0000 (UTC)
Date: Mon, 17 Aug 2020 05:04:42 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1597640692;
 bh=kr4jljk0qKtKjRo8Y7LgKs7BEUrmva+G9kLH/9XuZuM=;
 h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From;
 b=Gl1wqljOCHF6wSeC9t+rvIvm9T4iZ2k5ZL80lb8D2+y2SsljAos2aPT8lJ4VO+a5P
 roevmcffFxU1dBKcqri53FBe/YcvkXD/OGvZgrbhY2wvVHb4wjONps++NgLbwgGV1D
 VvGcAyd6uZ/Wm1DU/NGWnjdym2xVESnZ53BF1+vY=
To: Tier Nolan <tier.nolan@gmail.com>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
From: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Reply-To: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Message-ID: <Y9rFseQ13QJ0TspORM_a542mUib8lJV2IiDe8GXS5SrxkvXbVI13MfbgGqVoSVftumcYNBBKut6Fz840ehS5VfvF2AsO_qNTyzvs6tTCpBk=@protonmail.com>
In-Reply-To: <CAE-z3OVCcAL2x39TswA8zrZ+yjSqdx4hccTWn9Ug8MQ5=k-Pgg@mail.gmail.com>
References: <CAHAXnDXhAFQHiBCJ=H=1ZGHdHWhgLh1rG3pCPR5o48ziZzV+zQ@mail.gmail.com>
 <CAE-z3OVCcAL2x39TswA8zrZ+yjSqdx4hccTWn9Ug8MQ5=k-Pgg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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: Mon, 17 Aug 2020 05:04:57 -0000

Good morning Tier, Thomas, and aj,

> On Sun, Aug 16, 2020 at 4:50 PM Thomas Hartman via bitcoin-dev <bitcoin-d=
ev@lists.linuxfoundation.org> wrote:
>
> > My understanding is that adding a single op_difficulty operation as
> > proposed would enable not true difficulty futures but binary options
> > on difficulty.
> >
> > https://en.wikipedia.org/wiki/Binary_option
>
> Any kind of opcode is a binary option.=C2=A0 Either the output can be spe=
nt or it can't.
>
> You could get a pseudo-continuous future by having lots of outputs with d=
ifferent thresholds.
>
> Alice and Bob create a transaction with 100 outputs and each having 1% of=
 the future's value.
>
> Output 0:=C2=A0 Pay Alice if diff < 1.00 trillion else Bob
> Output 1:=C2=A0 Pay Alice if diff < 1.01 trillion else Bob
> ....
> Output 98:=C2=A0 Pay Alice if diff < 1.98 trillion else Bob
> Output 99:=C2=A0 Pay Alice if diff < 1.99 trillion else Bob
>
> If the difficulty is 1.25 trillion, then Alice gets outputs 0-24 and Bob =
gets outputs 25-99.=C2=A0 The future has a tick size of 1%.=C2=A0 It isn't =
very efficient though

Taproot MAST to the rescue.

* Alice and Bob agree on the number of ticks N and payout schedule.
* Alice and Bob generate N fresh keypairs and share them.
* Alice and Bob generate tapleaf scripts of the form:
  * script[i] =3D Alice[i] && Bob[i] && diff < 1.00 trillion + i * tick_siz=
e && CLTV(deadline)
* Alice and Bob generate the taproot MAST for the above scripts.
* Alice and Bob generate, but do ***NOT*** sign, a funding transaction payi=
ng out to the generated taproot MAST.
* Bob generates partial signatures for N payout transactions, with lower-di=
fficulty-targets paying out less to Alice and more to Bob, and higher-diffi=
culty-targets paying out more to Alice and less to Bob.
  * This requires spending the [i]th tapleaf script with the appropriate di=
fficulty target.
* Alice saves all the Bob signatures.
* At deadline, Alice rationally selects the highest-paying version that is =
still acceptable, based on the actual difficulty target at the time.

This requires publishing only O(log N) data (the merkle path to the selecte=
d tapleaf).
This translates to the 100-tick example requiring only one TXO, 1 scripthas=
h, and 7 or so Merkle-tree-path hashes, compared to the above example which=
 requires 100 TXOs and 100 script hashes.

The same scheme can be used with `OP_CTV` and without keypairs being involv=
ed, but basically anything `OP_CTV` can do, signing keypairs with pre-gener=
ated signatures from all participants can do just as well, with higher stor=
age and setup costs.

Regards,
ZmnSCPxj