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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
|
Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194]
helo=mx.sourceforge.net)
by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
(envelope-from <mh.in.england@gmail.com>) id 1X5FLf-000250-Gm
for bitcoin-development@lists.sourceforge.net;
Thu, 10 Jul 2014 14:29:23 +0000
Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of gmail.com
designates 209.85.214.181 as permitted sender)
client-ip=209.85.214.181; envelope-from=mh.in.england@gmail.com;
helo=mail-ob0-f181.google.com;
Received: from mail-ob0-f181.google.com ([209.85.214.181])
by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
(Exim 4.76) id 1X5FLa-0004jT-4V
for bitcoin-development@lists.sourceforge.net;
Thu, 10 Jul 2014 14:29:23 +0000
Received: by mail-ob0-f181.google.com with SMTP id wp4so9595048obc.26
for <bitcoin-development@lists.sourceforge.net>;
Thu, 10 Jul 2014 07:29:12 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.60.63.3 with SMTP id c3mr54592112oes.16.1405002552619; Thu,
10 Jul 2014 07:29:12 -0700 (PDT)
Sender: mh.in.england@gmail.com
Received: by 10.76.35.234 with HTTP; Thu, 10 Jul 2014 07:29:12 -0700 (PDT)
Date: Thu, 10 Jul 2014 16:29:12 +0200
X-Google-Sender-Auth: QrFjhJl1sOsIHQnHQHZSK5w5eCs
Message-ID: <CANEZrP1t3Pz3FOgxkxsj+sSgyQhPxfUTdCGXTC7=yxeZkGt-DQ@mail.gmail.com>
From: Mike Hearn <mike@plan99.net>
To: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Content-Type: multipart/alternative; boundary=001a11c1d2420eb93004fdd7a60a
X-Spam-Score: -0.5 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
See http://spamassassin.org/tag/ for more details.
-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
sender-domain
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(mh.in.england[at]gmail.com)
-0.0 SPF_PASS SPF: sender matches SPF record
1.0 HTML_MESSAGE BODY: HTML included in message
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1X5FLa-0004jT-4V
Subject: [Bitcoin-development] Draft BIP for geutxos message
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Thu, 10 Jul 2014 14:29:23 -0000
--001a11c1d2420eb93004fdd7a60a
Content-Type: text/plain; charset=UTF-8
I opened up a pull req for a draft BIP for getutxo.
https://github.com/bitcoin/bips/pull/88
I include a rendering below for your reading convenience. If you'd like to
comment on design/security/etc then please first familiarise yourself with
the long discussions that were already had here:
https://github.com/bitcoin/bitcoin/pull/4351
BIP: 45
Title: getutxo message
Author: Mike Hearn <hearn@vinumeris.com>
Status: Draft
Type: Standards Track
Created: 2014-06-10
Table of Contents
- Abstract
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Abstract>
- Motivation
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Motivation>
- Specification
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Specification>
- Backward compatibility
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Backward_compatibility>
- Authentication
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Authentication>
- Implementation
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#Implementation>
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#abstract>
Abstract
This document describes a small P2P protocol extension that performs UTXO
lookups given a set of outpoints.
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#motivation>
Motivation
All full Bitcoin nodes maintain a database called the unspent transaction
output set. This set is how double spending is checked for: to be valid a
transaction must identify unspent outputs in this set using an identifier
called an "outpoint", which is merely the hash of the output's containing
transaction plus an index.
The ability to query this can sometimes be useful for a lightweight/SPV
client which does not have the full UTXO set at hand. For example, it can
be useful in applications implementing assurance contracts to do a quick
check when a new pledge becomes visible to test whether that pledge was
already revoked via a double spend. Although this message is not strictly
necessary because e.g. such an app could be implemented by fully
downloading and storing the block chain, it is useful for obtaining
acceptable performance and resolving various UI cases.
Another example of when this data can be useful is for performing floating
fee calculations in an SPV wallet. This use case requires some other
changes to the Bitcoin protocol however, so we will not dwell on it here.
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#specification>
Specification
Two new messages are defined. The "getutxos" message has the following
structure:
Field SizeDescriptionData typeComments1check mempoolboolWhether to apply
mempool transactions during the calculation, thus exposing their UTXOs and
removing outputs that they spend.?outpointsvectorThe list of outpoints to
be queried. Each outpoint is serialized in the same way it is in a tx
message.
The response message "utxos" has the following structure:
Field SizeDescriptionData typeComments4chain heightuint32The height of the
chain at the moment the result was calculated.32chain tip hashuint256Block
hash of the top of the chain at the moment the result was calculated.?hit
bitmapbyte[]An array of bytes encoding one bit for each outpoint queried.
Each bit indicates whether the queried outpoint was found in the UTXO set
or not.?result utxosresult[]A list of result objects (defined below), one
for each outpoint that is unspent (i.e. has a bit set in the bitmap).
The result object is defined as:
Field SizeDescriptionData typeComments4tx versionuint32The version number
of the transaction the UTXO was found in.4heightuint256The height of the
block containing the defining transaction, or 0x7FFFFFFF if the tx is in
the mempool.?outputCTxOutThe output itself, serialized in the same way as
in a tx message.
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#backward-compatibility>Backward
compatibility
Nodes indicate support by advertising a protocol version above 70003 and by
setting a new NODE_GETUTXO flag in their nServices field, which has a value
of 2 (1
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#authentication>
Authentication
The UTXO set is not currently authenticated by anything. There are
proposals to resolve this by introducing a new consensus rule that commits
to a root hash of the UTXO set in blocks, however this feature is not
presently available in the Bitcoin protocol. Once it is, the utxos message
could be upgraded to include Merkle branches showing inclusion of the UTXOs
in the committed sets.
If the requesting client is looking up outputs for a signed transaction
that they have locally, the client can partly verify the returned output by
running the input scripts with it. Currently this verifies only that the
script is correct. A future version of the Bitcoin protocol is likely to
also allow the value to be checked in this way. It does not show that the
output is really unspent or was ever actually created in the block chain
however.
If the requesting client has a mapping of chain heights to block hashes in
the best chain e.g. obtained via getheaders, then they can obtain a proof
that the output did at one point exist by requesting the block and
searching for the output within it. When combined with Bloom filtering this
can be reasonably efficient.
Note that even when the outputs are being checked against something this
protocol has the same security model as Bloom filtering: a remote node can
lie through omission by claiming the requested UTXO does not exist / was
already spent (they are the same, from the perspective of a full node).
Querying multiple nodes and combining their answers can be a partial
solution to this, although as nothing authenticates the Bitcoin P2P network
a man in the middle could still yield incorrect results.
<https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=35c7795#implementation>
Implementation
https://github.com/bitcoin/bitcoin/pull/4351/files
--001a11c1d2420eb93004fdd7a60a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I opened up a pull req for a draft BIP for getutxo.</=
div><div><br></div>=C2=A0 =C2=A0<a href=3D"https://github.com/bitcoin/bips/=
pull/88">https://github.com/bitcoin/bips/pull/88</a><br><div><br></div><div=
>I include a rendering below for your reading convenience. If you'd lik=
e to comment on design/security/etc then please first familiarise yourself =
with the long discussions that were already had here:</div>
<div><br></div><div>=C2=A0 =C2=A0<a href=3D"https://github.com/bitcoin/bitc=
oin/pull/4351">https://github.com/bitcoin/bitcoin/pull/4351</a><br></div><d=
iv><br></div><div><br></div><div><pre style=3D"overflow:auto;font-family:Co=
nsolas,'Liberation Mono',Menlo,Courier,monospace;font-size:13px;mar=
gin:15px auto;border:1px solid rgb(221,221,221);line-height:19px;padding:10=
px 20px;border-top-left-radius:3px;border-top-right-radius:3px;border-botto=
m-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;max-width=
:700px;color:rgb(51,51,51);background-color:rgb(248,248,248)">
BIP: 45
Title: getutxo message
Author: Mike Hearn <<a href=3D"mailto:hearn@vinumeris.com">hearn@vinum=
eris.com</a>>
Status: Draft
Type: Standards Track
Created: 2014-06-10
</pre><p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font=
-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji',=
'Segoe UI Symbol';font-size:16px;line-height:27.200000762939453px">
</p><table summary=3D"Contents" style=3D"border-collapse:collapse;border-sp=
acing:0px;margin:15px auto;width:700px;overflow:auto;display:block;max-widt=
h:700px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans=
-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:16px;li=
ne-height:27.200000762939453px">
<tbody><tr style=3D"border-top-width:1px;border-top-style:solid;border-top-=
color:rgb(204,204,204)"><td style=3D"padding:6px 13px;border:1px solid rgb(=
221,221,221)"><div>Table of Contents</div><ul style=3D"padding:0px 0px 0px =
30px;margin:15px 0px">
<ul style=3D"padding:0px 0px 0px 30px;margin:0px"><li><a href=3D"https://gi=
thub.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?sho=
rt_path=3D35c7795#Abstract" style=3D"color:rgb(65,131,196);text-decoration:=
none;background:transparent">Abstract</a></li>
<li><a href=3D"https://github.com/mikehearn/bips/commit/6058b92f5d9804ee410=
4649f53afc2fa53248c81?short_path=3D35c7795#Motivation" style=3D"color:rgb(6=
5,131,196);text-decoration:none;background:transparent">Motivation</a></li>=
<li>
<a href=3D"https://github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649=
f53afc2fa53248c81?short_path=3D35c7795#Specification" style=3D"color:rgb(65=
,131,196);text-decoration:none;background:transparent">Specification</a></l=
i>
<li><a href=3D"https://github.com/mikehearn/bips/commit/6058b92f5d9804ee410=
4649f53afc2fa53248c81?short_path=3D35c7795#Backward_compatibility" style=3D=
"color:rgb(65,131,196);text-decoration:none;background:transparent">Backwar=
d compatibility</a></li>
<li><a href=3D"https://github.com/mikehearn/bips/commit/6058b92f5d9804ee410=
4649f53afc2fa53248c81?short_path=3D35c7795#Authentication" style=3D"color:r=
gb(65,131,196);text-decoration:none;background:transparent">Authentication<=
/a></li>
<li><a href=3D"https://github.com/mikehearn/bips/commit/6058b92f5d9804ee410=
4649f53afc2fa53248c81?short_path=3D35c7795#Implementation" style=3D"color:r=
gb(65,131,196);text-decoration:none;background:transparent">Implementation<=
/a></li>
</ul></ul></td></tr></tbody></table><h2 style=3D"margin:15px auto;line-heig=
ht:1.7;font-size:2em;padding:0px;border-bottom-width:1px;border-bottom-styl=
e:solid;border-bottom-color:rgb(238,238,238);max-width:700px;color:rgb(51,5=
1,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI E=
moji','Segoe UI Symbol'">
<a name=3D"user-content-abstract" class=3D"" href=3D"https://github.com/mik=
ehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=3D35=
c7795#abstract" style=3D"color:rgb(65,131,196);text-decoration:none;display=
:block;padding-right:6px;padding-left:30px;background:transparent"></a><a n=
ame=3D"user-content-Abstract" style=3D"color:rgb(65,131,196);background:tra=
nsparent">Abstract</a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">This d=
ocument describes a small P2P protocol extension that performs UTXO lookups=
given a set of outpoints.</p>
<h2 style=3D"margin:15px auto;line-height:1.7;font-size:2em;padding:0px;bor=
der-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,=
238,238);max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,fr=
eesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'"=
>
<a name=3D"user-content-motivation" class=3D"" href=3D"https://github.com/m=
ikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=3D=
35c7795#motivation" style=3D"color:rgb(65,131,196);text-decoration:none;dis=
play:block;padding-right:6px;padding-left:30px;background:transparent"></a>=
<a name=3D"user-content-Motivation" style=3D"color:rgb(65,131,196);backgrou=
nd:transparent">Motivation</a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">All fu=
ll Bitcoin nodes maintain a database called the unspent transaction output =
set. This set is how double spending is checked for: to be valid a transact=
ion must identify unspent outputs in this set using an identifier called an=
"outpoint", which is merely the hash of the output's contain=
ing transaction plus an index.</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">The ab=
ility to query this can sometimes be useful for a lightweight/SPV client wh=
ich does not have the full UTXO set at hand. For example, it can be useful =
in applications implementing assurance contracts to do a quick check when a=
new pledge becomes visible to test whether that pledge was already revoked=
via a double spend. Although this message is not strictly necessary becaus=
e e.g. such an app could be implemented by fully downloading and storing th=
e block chain, it is useful for obtaining acceptable performance and resolv=
ing various UI cases.</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">Anothe=
r example of when this data can be useful is for performing floating fee ca=
lculations in an SPV wallet. This use case requires some other changes to t=
he Bitcoin protocol however, so we will not dwell on it here.</p>
<h2 style=3D"margin:15px auto;line-height:1.7;font-size:2em;padding:0px;bor=
der-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,=
238,238);max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,fr=
eesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'"=
>
<a name=3D"user-content-specification" class=3D"" href=3D"https://github.co=
m/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_path=
=3D35c7795#specification" style=3D"color:rgb(65,131,196);text-decoration:no=
ne;display:block;padding-right:6px;padding-left:30px;background:transparent=
"></a><a name=3D"user-content-Specification" style=3D"color:rgb(65,131,196)=
;background:transparent">Specification</a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">Two ne=
w messages are defined. The "getutxos" message has the following =
structure:</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px"></p>
<table style=3D"border-collapse:collapse;border-spacing:0px;margin:15px aut=
o;width:700px;overflow:auto;display:block;max-width:700px;color:rgb(51,51,5=
1);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoj=
i','Segoe UI Symbol';font-size:16px;line-height:27.200000762939=
453px">
<tbody><tr style=3D"border-top-width:1px;border-top-style:solid;border-top-=
color:rgb(204,204,204)"><th style=3D"padding:6px 13px;border:1px solid rgb(=
221,221,221)">Field Size</th><th style=3D"padding:6px 13px;border:1px solid=
rgb(221,221,221)">
Description</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,221,=
221)">Data type</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,=
221,221)">Comments</th></tr><tr style=3D"border-top-width:1px;border-top-st=
yle:solid;border-top-color:rgb(204,204,204);background-color:rgb(248,248,24=
8)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">1</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">check mempool<=
/td><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">bool</=
td>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">Whether to=
apply mempool transactions during the calculation, thus exposing their UTX=
Os and removing outputs that they spend.</td></tr><tr style=3D"border-top-w=
idth:1px;border-top-style:solid;border-top-color:rgb(204,204,204)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">?</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">outpoints</td>=
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">vector</td=
><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">
The list of outpoints to be queried. Each outpoint is serialized in the sam=
e way it is in a tx message.</td></tr></tbody></table><p style=3D"margin:15=
px auto;max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,fre=
esans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';f=
ont-size:16px;line-height:27.200000762939453px">
The response message "utxos" has the following structure:</p><p s=
tyle=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-family:He=
lvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe=
UI Symbol';font-size:16px;line-height:27.200000762939453px">
</p><table style=3D"border-collapse:collapse;border-spacing:0px;margin:15px=
auto;width:700px;overflow:auto;display:block;max-width:700px;color:rgb(51,=
51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI =
Emoji','Segoe UI Symbol';font-size:16px;line-height:27.20000076=
2939453px">
<tbody><tr style=3D"border-top-width:1px;border-top-style:solid;border-top-=
color:rgb(204,204,204)"><th style=3D"padding:6px 13px;border:1px solid rgb(=
221,221,221)">Field Size</th><th style=3D"padding:6px 13px;border:1px solid=
rgb(221,221,221)">
Description</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,221,=
221)">Data type</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,=
221,221)">Comments</th></tr><tr style=3D"border-top-width:1px;border-top-st=
yle:solid;border-top-color:rgb(204,204,204);background-color:rgb(248,248,24=
8)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">4</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">chain height</=
td><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">uint32<=
/td>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">The height=
of the chain at the moment the result was calculated.</td></tr><tr style=
=3D"border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,20=
4,204)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">32</td><td=
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">chain tip has=
h</td><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">uint=
256</td>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">Block hash=
of the top of the chain at the moment the result was calculated.</td></tr>=
<tr style=3D"border-top-width:1px;border-top-style:solid;border-top-color:r=
gb(204,204,204);background-color:rgb(248,248,248)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">?</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">hit bitmap</td=
><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">byte[]</t=
d>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">An array o=
f bytes encoding one bit for each outpoint queried. Each bit indicates whet=
her the queried outpoint was found in the UTXO set or not.</td></tr><tr sty=
le=3D"border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,=
204,204)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">?</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">result utxos</=
td><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">result[=
]</td>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">A list of =
result objects (defined below), one for each outpoint that is unspent (i.e.=
has a bit set in the bitmap).</td></tr></tbody></table><p style=3D"margin:=
15px auto;max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,f=
reesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'=
;font-size:16px;line-height:27.200000762939453px">
The result object is defined as:</p><p style=3D"margin:15px auto;max-width:=
700px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-s=
erif,'Segoe UI Emoji','Segoe UI Symbol';font-size:16px;line=
-height:27.200000762939453px">
</p><table style=3D"border-collapse:collapse;border-spacing:0px;margin:15px=
auto;width:700px;overflow:auto;display:block;max-width:700px;color:rgb(51,=
51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI =
Emoji','Segoe UI Symbol';font-size:16px;line-height:27.20000076=
2939453px">
<tbody><tr style=3D"border-top-width:1px;border-top-style:solid;border-top-=
color:rgb(204,204,204)"><th style=3D"padding:6px 13px;border:1px solid rgb(=
221,221,221)">Field Size</th><th style=3D"padding:6px 13px;border:1px solid=
rgb(221,221,221)">
Description</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,221,=
221)">Data type</th><th style=3D"padding:6px 13px;border:1px solid rgb(221,=
221,221)">Comments</th></tr><tr style=3D"border-top-width:1px;border-top-st=
yle:solid;border-top-color:rgb(204,204,204);background-color:rgb(248,248,24=
8)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">4</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">tx version</td=
><td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">uint32</t=
d>
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">The versio=
n number of the transaction the UTXO was found in.</td></tr><tr style=3D"bo=
rder-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)=
">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">4</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">height</td><td=
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">uint256</td><=
td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">
The height of the block containing the defining transaction, or 0x7FFFFFFF =
if the tx is in the mempool.</td></tr><tr style=3D"border-top-width:1px;bor=
der-top-style:solid;border-top-color:rgb(204,204,204);background-color:rgb(=
248,248,248)">
<td style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">?</td><td =
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">output</td><td=
style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">CTxOut</td><t=
d style=3D"padding:6px 13px;border:1px solid rgb(221,221,221)">
The output itself, serialized in the same way as in a tx message.</td></tr>=
</tbody></table><h2 style=3D"margin:15px auto;line-height:1.7;font-size:2em=
;padding:0px;border-bottom-width:1px;border-bottom-style:solid;border-botto=
m-color:rgb(238,238,238);max-width:700px;color:rgb(51,51,51);font-family:He=
lvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe=
UI Symbol'">
<a name=3D"user-content-backward-compatibility" class=3D"" href=3D"https://=
github.com/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?s=
hort_path=3D35c7795#backward-compatibility" style=3D"color:rgb(65,131,196);=
text-decoration:none;display:block;padding-right:6px;padding-left:30px;back=
ground:transparent"></a><a name=3D"user-content-Backward_compatibility" sty=
le=3D"color:rgb(65,131,196);background:transparent">Backward compatibility<=
/a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">Nodes =
indicate support by advertising a protocol version above 70003 and by setti=
ng a new NODE_GETUTXO flag in their nServices field, which has a value of 2=
(1</p>
<h2 style=3D"margin:15px auto;line-height:1.7;font-size:2em;padding:0px;bor=
der-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,=
238,238);max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,fr=
eesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'"=
>
<a name=3D"user-content-authentication" class=3D"" href=3D"https://github.c=
om/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_pat=
h=3D35c7795#authentication" style=3D"color:rgb(65,131,196);text-decoration:=
none;display:block;padding-right:6px;padding-left:30px;background:transpare=
nt"></a><a name=3D"user-content-Authentication" style=3D"color:rgb(65,131,1=
96);background:transparent">Authentication</a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">The UT=
XO set is not currently authenticated by anything. There are proposals to r=
esolve this by introducing a new consensus rule that commits to a root hash=
of the UTXO set in blocks, however this feature is not presently available=
in the Bitcoin protocol. Once it is, the utxos message could be upgraded t=
o include Merkle branches showing inclusion of the UTXOs in the committed s=
ets.</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">If the=
requesting client is looking up outputs for a signed transaction that they=
have locally, the client can partly verify the returned output by running =
the input scripts with it. Currently this verifies only that the script is =
correct. A future version of the Bitcoin protocol is likely to also allow t=
he value to be checked in this way. It does not show that the output is rea=
lly unspent or was ever actually created in the block chain however.</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">If the=
requesting client has a mapping of chain heights to block hashes in the be=
st chain e.g. obtained via getheaders, then they can obtain a proof that th=
e output did at one point exist by requesting the block and searching for t=
he output within it. When combined with Bloom filtering this can be reasona=
bly efficient.</p>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px">Note t=
hat even when the outputs are being checked against something this protocol=
has the same security model as Bloom filtering: a remote node can lie thro=
ugh omission by claiming the requested UTXO does not exist / was already sp=
ent (they are the same, from the perspective of a full node). Querying mult=
iple nodes and combining their answers can be a partial solution to this, a=
lthough as nothing authenticates the Bitcoin P2P network a man in the middl=
e could still yield incorrect results.</p>
<h2 style=3D"margin:15px auto;line-height:1.7;font-size:2em;padding:0px;bor=
der-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,=
238,238);max-width:700px;color:rgb(51,51,51);font-family:Helvetica,arial,fr=
eesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'"=
>
<a name=3D"user-content-implementation" class=3D"" href=3D"https://github.c=
om/mikehearn/bips/commit/6058b92f5d9804ee4104649f53afc2fa53248c81?short_pat=
h=3D35c7795#implementation" style=3D"color:rgb(65,131,196);text-decoration:=
none;display:block;padding-right:6px;padding-left:30px;background:transpare=
nt"></a><a name=3D"user-content-Implementation" style=3D"color:rgb(65,131,1=
96);background:transparent">Implementation</a></h2>
<p style=3D"margin:15px auto;max-width:700px;color:rgb(51,51,51);font-famil=
y:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','S=
egoe UI Symbol';font-size:16px;line-height:27.200000762939453px"><a hre=
f=3D"https://github.com/bitcoin/bitcoin/pull/4351/files" style=3D"color:rgb=
(65,131,196);text-decoration:none;background:transparent">https://github.co=
m/bitcoin/bitcoin/pull/4351/files</a></p>
</div></div>
--001a11c1d2420eb93004fdd7a60a--
|