Skip to content

Commit 0a9018d

Browse files
authored
Merge pull request bitcoin#700 from achow101/bip174-rev
BIP 174 clarifications and move to proposed
2 parents 34dac53 + 0a1574f commit 0a9018d

8 files changed

+1724
-8
lines changed

README.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,13 @@ Those proposing changes should consider that ultimately consent may rest with th
777777
| Pieter Wuille, Greg Maxwell
778778
| Informational
779779
| Final
780-
|-
780+
|- style="background-color: #ffffcf"
781781
| [[bip-0174.mediawiki|174]]
782782
| Applications
783783
| Partially Signed Bitcoin Transaction Format
784784
| Andrew Chow
785785
| Standard
786-
| Draft
786+
| Proposed
787787
|-
788788
| [[bip-0175.mediawiki|175]]
789789
| Applications

bip-0174.mediawiki

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Author: Andrew Chow <[email protected]>
66
Comments-Summary: No comments yet.
77
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0174
8-
Status: Draft
8+
Status: Proposed
99
Type: Standards Track
1010
Created: 2017-07-12
1111
License: BSD-2-Clause
@@ -267,7 +267,9 @@ the key.
267267

268268
Keys within each scope should never be duplicated; all keys in the format are unique. PSBTs containing duplicate keys are invalid. However implementors
269269
will still need to handle events where keys are duplicated when combining transactions with duplicated fields. In this event, the software may choose
270-
whichever value it wishes.
270+
whichever value it wishes.<ref>'''Why can the values be arbitrarily chosen?''' When there are duplicated keys, the values that can be chosen will either be
271+
valid or invalid. If the values are invalid, a signer would simply produce an invalid signature and the final transaction itself would be invalid. If the
272+
values are valid, then it does not matter which is chosen as either way the transaction is still valid.</ref>
271273

272274
==Responsibilities==
273275

@@ -290,7 +292,8 @@ A single entity is likely to be both a Creator and Updater.
290292

291293
The Signer must only accept a PSBT.
292294
The Signer must only use the UTXOs provided in the PSBT to produce signatures for inputs.
293-
Before signing a non-witness output, the Signer must verify that the TXID of the non-witness UTXO matches the TXID specified in the unsigned transaction.
295+
Before signing a non-witness input, the Signer must verify that the TXID of the non-witness UTXO matches the TXID specified in the unsigned transaction.
296+
Before signing a witness input, the Signer must verify that the witnessScript (if provided) matches the hash specified in the UTXO or the redeemScript, and the redeemScript (if provided) matches the hash in the UTXO.
294297
The Signer should not need any additional data sources, as all necessary information is provided in the PSBT format.
295298
The Signer must only add data to a PSBT.
296299
Any signatures created by the Signer must be added as a "Partial Signature" key-value pair for the respective input it relates to.
@@ -313,6 +316,9 @@ For every type that a Combiner understands, it may refuse to combine PSBTs if it
313316

314317
The Combiner does not need to know how to interpret scripts in order to combine PSBTs. It can do so without understanding scripts or the network serialization format.
315318

319+
In general, the result of a Combiner combining two PSBTs from independent participants A and B should be functionally equivalent to a result obtained from processing the original PSBT by A and then B in a sequence.
320+
Or, for participants performing fA(psbt) and fB(psbt): Combine(fA(psbt), fB(psbt)) == fA(fB(psbt)) == fB(fA(psbt))
321+
316322
===Input Finalizer===
317323

318324
The Input Finalizer must only accept a PSBT.
@@ -354,11 +360,11 @@ able to be unserialized by an unserializer for the PSBT format.
354360

355361
===Manual CoinJoin Workflow===
356362

357-
<img src="bip-0174/coinjoin-workflow.png" align="middle"></img>
363+
<img src="bip-0174/coinjoin-workflow.svg" align="middle"></img>
358364

359365
===2-of-3 Multisig Workflow===
360366

361-
<img src="bip-0174/multisig-workflow.png" align="middle"></img>
367+
<img src="bip-0174/multisig-workflow.svg" align="middle"></img>
362368

363369
==Test Vectors==
364370

@@ -500,7 +506,7 @@ The reference implementation of the PSBT format is available at https://github.c
500506
Special thanks to Pieter Wuille for suggesting that such a transaction format should be made
501507
and for coming up with the name and abbreviation of PSBT.
502508

503-
Thanks to Pieter Wuille, Gregory Maxwell, Jonathan Underwood, and Daniel Cousens for additional comments
509+
Thanks to Pieter Wuille, Gregory Maxwell, Jonathan Underwood, Daniel Cousens and those who commented on the bitcoin-dev mailing list for additional comments
504510
and suggestions for improving this proposal.
505511

506512
==Appendix A: Data types and their specifications==

bip-0174/coinjoin-workflow.png

-44.9 KB
Binary file not shown.

bip-0174/coinjoin-workflow.svg

Lines changed: 655 additions & 0 deletions
Loading

bip-0174/coinjoin-workflow.tex

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
% using the PGF/TikZ package with pdflatex
2+
\documentclass{standalone}
3+
\usepackage[utf8]{inputenc}
4+
\usepackage[T1]{fontenc}
5+
%~ \usepackage[english]{babel}
6+
\usepackage[none]{hyphenat}% prevent hyphenation
7+
\usepackage{lmodern}
8+
\renewcommand*\familydefault{\sfdefault}
9+
\usepackage{tikz}
10+
\usetikzlibrary{shapes,arrows}
11+
\tikzset{>=latex}
12+
\begin{document}
13+
% \sffamily{}
14+
\tikzstyle{block_center} =
15+
[rectangle, draw=black, thick, fill=white,
16+
text width=12em, text centered,
17+
minimum height=5em]
18+
\tikzstyle{block_rounded} = [rectangle,
19+
draw=black, thick, fill=white,
20+
text width=8em, text centered,
21+
minimum height=5em,
22+
rounded corners]
23+
\begin{tikzpicture}[auto]
24+
% outlining the flowchart on a grid
25+
\matrix[column sep=3ex,row sep=2ex]{
26+
\node [block_center] (0alice1)
27+
{Alice creates a PSBT with only her inputs
28+
with UTXOs filled in.\\Sends it to Bob.};
29+
&
30+
\node [block_center] (1bob1)
31+
{Bob adds his inputs and fills in his
32+
UTXOs.};
33+
&
34+
\node [block_center] (2carol1)
35+
{Carol adds her inputs, fills in her
36+
UTXOs, adds signatures, and finalizes her inputs.};
37+
\\
38+
\node [block_rounded] (5alice2)
39+
{Alice extracts the network serialized
40+
transaction and broadcasts it.};
41+
&
42+
\node [block_center] (4alice1)
43+
{Alice signs the transaction, adds her
44+
signatures, and finalizes her inputs.};
45+
&
46+
\node [block_center] (3bob2)
47+
{Bob signs the transaction, adds his
48+
signatures, and finalizes his inputs.};
49+
\\
50+
};% end matrix
51+
% connecting nodes with paths
52+
\draw[line width = 1pt, ->]
53+
(0alice1) edge (1bob1)
54+
(1bob1) edge (2carol1)
55+
(2carol1) edge (3bob2)
56+
(3bob2) edge (4alice1)
57+
(4alice1) edge (5alice2);
58+
\end{tikzpicture}
59+
\end{document}

bip-0174/multisig-workflow.png

-74.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)