summaryrefslogtreecommitdiff
path: root/1f/004cc05fbc3ae418fa231a2fca60f7e50b67d6
blob: 2de4757b3fed7f91b6c94dc6eafb1ca2f26feb1c (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
Return-Path: <pete@petertodd.org>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 4ACF1279
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue,  9 Aug 2016 00:46:47 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from outmail149080.authsmtp.com (outmail149080.authsmtp.com
	[62.13.149.80])
	by smtp1.linuxfoundation.org (Postfix) with ESMTP id 73180FB
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue,  9 Aug 2016 00:46:46 +0000 (UTC)
Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232])
	by punt21.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u790kgie099941;
	Tue, 9 Aug 2016 01:46:42 +0100 (BST)
Received: from petertodd.org (ec2-52-5-185-120.compute-1.amazonaws.com
	[52.5.185.120]) (authenticated bits=0)
	by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u790kegO046464
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 9 Aug 2016 01:46:41 +0100 (BST)
Received: from [127.0.0.1] (localhost [127.0.0.1])
	by petertodd.org (Postfix) with ESMTPSA id D156E40104;
	Tue,  9 Aug 2016 00:43:44 +0000 (UTC)
Received: by localhost (Postfix, from userid 1000)
	id 2E84B2054D; Mon,  8 Aug 2016 17:46:33 -0700 (PDT)
Date: Mon, 8 Aug 2016 17:46:33 -0700
From: Peter Todd <pete@petertodd.org>
To: Luke Dashjr <luke@dashjr.org>
Message-ID: <20160809004633.GA1653@fedora-21-dvm>
References: <CAKazn3mKUMMz0wyqTsgbkd4mBLgvG2PXziXhgRTi4hX_ApbPhg@mail.gmail.com>
	<20160720054654.GA1420@fedora-21-dvm>
	<201607200617.40917.luke@dashjr.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE"
Content-Disposition: inline
In-Reply-To: <201607200617.40917.luke@dashjr.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Server-Quench: bd04d5f2-5dca-11e6-829e-00151795d556
X-AuthReport-Spam: If SPAM / abuse - report it at:
	http://www.authsmtp.com/abuse
X-AuthRoute: OCd2Yg0TA1ZNQRgX IjsJECJaVQIpKltL GxAVKBZePFsRUQkR
	aQdMdgsUGUATAgsB AmAbW1VeVFt7XWI7 bghPaBtcak9QXgdq
	T0pMXVMcUQJhAUdU UWEeVh92cQEIcHdy ZwgwCnBfCEEsd1t4
	Fh0FCGwHMGF9YGIW BV1YdwJRcQRDe0tA b1YxNiYHcQ5VPz4z
	GA41ejw8IwAXAgVt Cg0XJFwOEw4rIhoX DwwYFDM0FEYZRiI1 NHQA
X-Authentic-SMTP: 61633532353630.1037:706
X-AuthFastPath: 0 (Was 255)
X-AuthSMTP-Origin: 52.5.185.120/25
X-AuthVirus-Status: No virus detected - but ensure you scan with your own
	anti-virus system.
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,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
Cc: bitcoin-dev@lists.linuxfoundation.org
Subject: Re: [bitcoin-dev] BIP draft: HTLC transactions
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: Tue, 09 Aug 2016 00:46:47 -0000


--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 20, 2016 at 06:17:39AM +0000, Luke Dashjr wrote:
> On Wednesday, July 20, 2016 5:46:54 AM Peter Todd via bitcoin-dev wrote:
> > On Tue, Jul 19, 2016 at 10:35:39PM -0600, Sean Bowe via bitcoin-dev wro=
te:
> > > I'm requesting feedback for Hash Time-Locked Contract (HTLC) transact=
ions
> > > in Bitcoin.
> > >=20
> > > HTLC transactions allow you to pay for the preimage of a hash. CSV/CL=
TV
> > > can be used to recover your funds if the other party is not cooperati=
ve.
> > > These
> > >=20
> > > scripts take the following general form:
> > >     [HASHOP] <digest> OP_EQUAL
> > >     OP_IF
> > >    =20
> > >         <seller pubkey>
> > >    =20
> > >     OP_ELSE
> > >    =20
> > >         <num> [TIMEOUTOP] OP_DROP <buyer pubkey>
> > >    =20
> > >     OP_ENDIF
> > >     OP_CHECKSIG
> >=20
> > Note that because you're hashing the top item on the stack regardless
> > scriptSig's that satisfy HTLC's are malleable: that top stack item can =
be
> > changed anything in the digest-not-provided case and the script still
> > passes.
>=20
> OP_SIZE
> OP_IF
>   [HASHOP] <digest> OP_EQUALVERIFY
>   <seller pubkey>
> OP_ELSE
>   <num> [TIMEOUTOP]
>   <buyer pubkey>
> OP_ENDIF
> OP_CHECKSIG

Ha! That's brilliant; good job.

--=20
https://petertodd.org 'peter'[:-1]@petertodd.org

--Kj7319i9nmIyA2yE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJXqSfmAAoJEGOZARBE6K+yNcYH+gNEXPMrL9wxg2LVDPsk8hyS
VIgHUB2SOoJ7jyNADBqPy8CAwOBe/SZ/ziLjQuFXKACk7ZMkNL5zu4nTtwK4mKhQ
m7iRI8njopN4uh1iOvZ5wQIYwV2qeb4XdjR8GfBFBGT2tGzL0u5Ihy1YC/hx8cW/
RKMNp1vHFnBAXU1Y8GFw6odAbKSZd7S4tScqfTfFjZZ+uv9CGDeYyfFZsLJr1tLb
ps5gX7Y85kroRgaTCJZHFi9aW043lRKBwGUZP3yQUu1R+2i7cj0yHnLJHsokAHG6
rh/6ZNz2SA6m8d3SkYh6SnaFtmSGt7C7kRMTGzxNRuHxcok82Haatqhj/TCxkF4=
=j1Jk
-----END PGP SIGNATURE-----

--Kj7319i9nmIyA2yE--