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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
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 E821C258
for <bitcoin-dev@lists.linuxfoundation.org>;
Wed, 24 Aug 2016 01:46:40 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from outmail149115.authsmtp.co.uk (outmail149115.authsmtp.co.uk
[62.13.149.115])
by smtp1.linuxfoundation.org (Postfix) with ESMTP id 0374E1AB
for <bitcoin-dev@lists.linuxfoundation.org>;
Wed, 24 Aug 2016 01:46:39 +0000 (UTC)
Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232])
by punt22.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u7O1kbBI078340;
Wed, 24 Aug 2016 02:46:37 +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 u7O1kZZN016922
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
Wed, 24 Aug 2016 02:46:36 +0100 (BST)
Received: from [127.0.0.1] (localhost [127.0.0.1])
by petertodd.org (Postfix) with ESMTPSA id 41BCB400DB;
Wed, 24 Aug 2016 01:43:23 +0000 (UTC)
Received: by localhost (Postfix, from userid 1000)
id 407D220532; Wed, 24 Aug 2016 01:46:34 +0000 (UTC)
Date: Wed, 24 Aug 2016 01:46:34 +0000
From: Peter Todd <pete@petertodd.org>
To: bitcoin-dev@lists.linuxfoundation.org
Message-ID: <20160824014634.GA19905@fedora-21-dvm>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr"
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Server-Quench: 981ed305-699c-11e6-829e-00151795d556
X-AuthReport-Spam: If SPAM / abuse - report it at:
http://www.authsmtp.com/abuse
X-AuthRoute: OCd2Yg0TA1ZNQRgX IjsJECJaVQIpKltL GxAVKBZePFsRUQkR
aAdMdAYUGUATAgsB AmAbW1ZeVFt7WmU7 bghPaBtcak9QXgdq
T0pMXVMcUQIXAEdr bGAeUx97dQcIeX14 bUIsV3haCRB5dUNg
REddRnAHZDJmdWgd WRVFdwNVdQJNdxoR b1V5GgBcITxDNyZw
MgE9PjswMDNDYARS RAwcNVUOWg4UWXZ2 fBsFBz4vEEFNaiwp
MxxsYnIbAUwVP14q PF0tWFQXUVcqEApC EkpRAShfTwAA
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: Jeff Coleman <jeff@ledgerlabs.io>
Subject: [bitcoin-dev] Capital Efficient Honeypots w/ "Scorched Earth"
Doublespending Protection
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: Wed, 24 Aug 2016 01:46:41 -0000
--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Bitcoin-based honeypots incentivise intruders into revealing the fact they =
have
broken into a server by allowing them to claim a reward based on secret
information obtained during the intrusion. Spending a bitcoin can only be d=
one
by publishing data to a public place - the Bitcoin blockchain - allowing
detection of the intrusion.
The simplest way to achieve this is with one private key per server, with e=
ach
server associated with one transaction output spendable by that key. However
this isn't capital efficient if you have multiple servers to protect: if we
have N servers and P bitcoins that we can afford to lose in the compromise,=
one
key per server gives the intruder only N/P incentive.
Previously Piete Wuille proposed(1) tree signatures for honeypots, with a
single txout protected by a 1-N tree of keys, with each server assigned a
specific key. Unfortunately though, tree signatures aren't yet implemented =
in
the Bitcoin protocol.
However with a 2-of-2 multisig and the SIGHASH_SINGLE feature we can implem=
ent
this functionality with the existing Bitcoin protocol using the following
script:
2 <honeypot-pubkey> <distriminator-pubkey> 2 CHECKMULTISIG
The honeypot secret key is shared among all N servers, and left on them. The
distriminator secret key meanwhile is kept secret, however for each server a
unique signature is created with SIGHASH_SINGLE, paying a token amount to a
notification address. For each individual server a pre-signed signature cre=
ated
with the distriminator secret key is then left on the associated server alo=
ng
with the honeypot secret key.
Recall the SIGHASH_SINGLE flag means that the signature only signs a single
transaction input and transaction output; the transaction is allowed to have
additional inputs and outputs added. This allows the thief to use the honey=
pot
key to construct a claim transaction with an additional output added that p=
ays
an address that they own with the rest of the funds.
Equally, we could also use SIGHASH_NONE, with the per-server discriminator
being the K value used in the pre-signed transaction.
Note that Jeff Coleman deserves credit as co-inventor of all the above.
Censorship Resistance
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
A potential disadvantage of using non-standard SIGHASH flags is that the
transactions involved are somewhat unusual, and may be flagged by
risk analysis at exchanges and the like, a threat to the fungibility of the
reward.
We can improve on the above concept from Todd/Coleman by using a pre-signed
standard transaction instead. The pre-signed transaction spends the honeypot
txout to two addresses, a per-server canary address, and a change address. =
The
private key associated with the change addres is also left on the server, a=
nd
the intruder can then spend that change output to finally collect their rew=
ard.
To any external observer the result looks like two normal transactions crea=
ted
in the process of someone with a standard wallet sending a small amount of
funds to an address, followed by sending a larger amount.
Doublespending
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
A subtlety in the the two transactions concept is that the intruder doesn't
have the necessary private keys to modify the first transaction, which means
that the honeypot owner can respond to the compromise by doublespending that
transaction, potentially recovering the honeypot while still learning about=
the
compromise. While this is possible with all honeypots, if the first transac=
tion
is signed with the opt-in RBF flags, and CPFP-aware transaction replacement=
is
not implemented by miners, the mechanics are particularly disadvantageous to
the intruder, as the honeypot owner only needs to increase the first
transaction's fee slightly to have a high chance of recovering their funds.
With CPFP-aware transaction replacement the intruder could in-turn respond =
with
a high-fee CPFP second transaction, but currently no such implementation is
known.
Scorched Earth
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
We can use the "scorched earth" concept to improve the credibility of the
honeypot reward by making it costly for the honeypot owner to doublespend. =
Here
a second version of the honeypot pre-signed transaction would also be provi=
ded
which sepnds the entirety of the honeypot output to fees, and additionally
spends a second output to fees. An economically rational intruder will publ=
ish
the first version, which maximizes the funds they get out of the honeypot. =
If
the owner tries to dishonestly doublespend, they can respond by publishing =
the
"scorched earth" transaction, encouraging the honeypot owner's honesty and
making CPFP-aware transaction replacement irrelevant.
Of course, miner centralization adds complexity to the above: in many insta=
nces
honeypot owners and/or intruders will be able to recover funds from altruis=
tic
miners. Equally, the additional complexity may discourage intruders from ma=
king
use of the honeypot entirely.
Note that as an implementation consideration CHECKSEQUENCEVERIFY can be use=
d to
ensure the honeypot output can only be spent with transaction replacement
enabled, as CSV requires nSequence to be set in specific ways in any transa=
tion
spending the output.
References
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1) https://blockstream.com/2015/08/24/treesignatures/
--=20
https://petertodd.org 'peter'[:-1]@petertodd.org
--PNTmBPCT7hxwcZjr
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
-----BEGIN PGP SIGNATURE-----
iQEcBAEBCAAGBQJXvPx3AAoJEGOZARBE6K+yIB0H/3UqL0sxRyHU2aBTd2S5phrb
VRqcK8+gGDrzs2a3/UIyAJ75JBe5ALSdRV97P8+cbD3IFgtLW4Q36Y5yqri6LZyc
z/rOC1zt3ojyEIDcOxd+aNIOt/j0rlKY9BnImqvjmpd84jJqVf3pVkveD4NL/RKE
0js9nlFwbAGhEDYjPrRcpy5MyMTQyQIH8YX7/cugPZC8AerwZc29CBsbevG2GO36
j5zuays72QX2MJdaddw7IWFxXRGP7bRkmC5ZFIdZzuRE74BZ2xRKngriVWq07KKe
2TUWA+RuHRreyZ0cqcf5CapkF4B9mtgLZBmu7PFpinnhqEctEPLRO9QwR0lRyqU=
=hbTm
-----END PGP SIGNATURE-----
--PNTmBPCT7hxwcZjr--
|