diff --git a/README.mediawiki b/README.mediawiki index a052fb4a..e99c8567 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -777,13 +777,13 @@ Those proposing changes should consider that ultimately consent may rest with th | Pieter Wuille, Greg Maxwell | Informational | Final -|- +|- style="background-color: #ffffcf" | [[bip-0174.mediawiki|174]] | Applications | Partially Signed Bitcoin Transaction Format | Andrew Chow | Standard -| Draft +| Proposed |- | [[bip-0175.mediawiki|175]] | Applications diff --git a/bip-0174.mediawiki b/bip-0174.mediawiki index 4b686dba..35971418 100644 --- a/bip-0174.mediawiki +++ b/bip-0174.mediawiki @@ -5,7 +5,7 @@ Author: Andrew Chow Comments-Summary: No comments yet. Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0174 - Status: Draft + Status: Proposed Type: Standards Track Created: 2017-07-12 License: BSD-2-Clause @@ -267,7 +267,9 @@ the key. Keys within each scope should never be duplicated; all keys in the format are unique. PSBTs containing duplicate keys are invalid. However implementors will still need to handle events where keys are duplicated when combining transactions with duplicated fields. In this event, the software may choose -whichever value it wishes. +whichever value it wishes.'''Why can the values be arbitrarily chosen?''' When there are duplicated keys, the values that can be chosen will either be +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 +values are valid, then it does not matter which is chosen as either way the transaction is still valid. ==Responsibilities== @@ -290,7 +292,8 @@ A single entity is likely to be both a Creator and Updater. The Signer must only accept a PSBT. The Signer must only use the UTXOs provided in the PSBT to produce signatures for inputs. -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. +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. +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. The Signer should not need any additional data sources, as all necessary information is provided in the PSBT format. The Signer must only add data to a PSBT. 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 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. +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. +Or, for participants performing fA(psbt) and fB(psbt): Combine(fA(psbt), fB(psbt)) == fA(fB(psbt)) == fB(fA(psbt)) + ===Input Finalizer=== The Input Finalizer must only accept a PSBT. @@ -354,11 +360,11 @@ able to be unserialized by an unserializer for the PSBT format. ===Manual CoinJoin Workflow=== - + ===2-of-3 Multisig Workflow=== - + ==Test Vectors== @@ -500,7 +506,7 @@ The reference implementation of the PSBT format is available at https://github.c Special thanks to Pieter Wuille for suggesting that such a transaction format should be made and for coming up with the name and abbreviation of PSBT. -Thanks to Pieter Wuille, Gregory Maxwell, Jonathan Underwood, and Daniel Cousens for additional comments +Thanks to Pieter Wuille, Gregory Maxwell, Jonathan Underwood, Daniel Cousens and those who commented on the bitcoin-dev mailing list for additional comments and suggestions for improving this proposal. ==Appendix A: Data types and their specifications== diff --git a/bip-0174/coinjoin-workflow.png b/bip-0174/coinjoin-workflow.png deleted file mode 100644 index 0909c1db..00000000 Binary files a/bip-0174/coinjoin-workflow.png and /dev/null differ diff --git a/bip-0174/coinjoin-workflow.svg b/bip-0174/coinjoin-workflow.svg new file mode 100644 index 00000000..67a0aadd --- /dev/null +++ b/bip-0174/coinjoin-workflow.svg @@ -0,0 +1,655 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bip-0174/coinjoin-workflow.tex b/bip-0174/coinjoin-workflow.tex new file mode 100644 index 00000000..e0516ffe --- /dev/null +++ b/bip-0174/coinjoin-workflow.tex @@ -0,0 +1,59 @@ +% using the PGF/TikZ package with pdflatex +\documentclass{standalone} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +%~ \usepackage[english]{babel} +\usepackage[none]{hyphenat}% prevent hyphenation +\usepackage{lmodern} +\renewcommand*\familydefault{\sfdefault} +\usepackage{tikz} +\usetikzlibrary{shapes,arrows} +\tikzset{>=latex} +\begin{document} +% \sffamily{} + \tikzstyle{block_center} = + [rectangle, draw=black, thick, fill=white, + text width=12em, text centered, + minimum height=5em] + \tikzstyle{block_rounded} = [rectangle, + draw=black, thick, fill=white, + text width=8em, text centered, + minimum height=5em, + rounded corners] + \begin{tikzpicture}[auto] + % outlining the flowchart on a grid + \matrix[column sep=3ex,row sep=2ex]{ + \node [block_center] (0alice1) + {Alice creates a PSBT with only her inputs + with UTXOs filled in.\\Sends it to Bob.}; + & + \node [block_center] (1bob1) + {Bob adds his inputs and fills in his + UTXOs.}; + & + \node [block_center] (2carol1) + {Carol adds her inputs, fills in her + UTXOs, adds signatures, and finalizes her inputs.}; + \\ + \node [block_rounded] (5alice2) + {Alice extracts the network serialized + transaction and broadcasts it.}; + & + \node [block_center] (4alice1) + {Alice signs the transaction, adds her + signatures, and finalizes her inputs.}; + & + \node [block_center] (3bob2) + {Bob signs the transaction, adds his + signatures, and finalizes his inputs.}; + \\ + };% end matrix + % connecting nodes with paths + \draw[line width = 1pt, ->] + (0alice1) edge (1bob1) + (1bob1) edge (2carol1) + (2carol1) edge (3bob2) + (3bob2) edge (4alice1) + (4alice1) edge (5alice2); + \end{tikzpicture} +\end{document} diff --git a/bip-0174/multisig-workflow.png b/bip-0174/multisig-workflow.png deleted file mode 100644 index 0e752c51..00000000 Binary files a/bip-0174/multisig-workflow.png and /dev/null differ diff --git a/bip-0174/multisig-workflow.svg b/bip-0174/multisig-workflow.svg new file mode 100644 index 00000000..951b49e8 --- /dev/null +++ b/bip-0174/multisig-workflow.svg @@ -0,0 +1,894 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bip-0174/multisig-workflow.tex b/bip-0174/multisig-workflow.tex new file mode 100644 index 00000000..2b8744d3 --- /dev/null +++ b/bip-0174/multisig-workflow.tex @@ -0,0 +1,102 @@ +% using the PGF/TikZ package with pdflatex +\documentclass{standalone} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +%~ \usepackage[english]{babel} +\usepackage[none]{hyphenat}% prevent hyphenation +\usepackage{lmodern} +\renewcommand*\familydefault{\sfdefault} +\usepackage{tikz} +\usetikzlibrary{shapes,arrows} +\tikzset{>=latex} +%\pgfdeclarelayer{bg} % declare background layer +%\pgfsetlayers{bg,main} % set order of layers +\newcommand{\h}{\hspace{1em}} +\begin{document} +% \sffamily{} + \tikzstyle{block_center} = + [rectangle, draw=black, thick, fill=white, + text width=10.5em, text centered, + minimum height=1em] + \tikzstyle{block_rounded} = [rectangle, + draw=black, thick, fill=white, + text width=8em, text centered, + minimum height=5em, + rounded corners] + \begin{tikzpicture}[auto] + % outlining the flowchart on a grid + \matrix[column sep=3ex,row sep=2.5ex]{ + \h & + \node [block_center] (R1) + {Alice, Bob and Carol + wish to spend from a + 2-of-3 Multisig.}; + & \h \\ + \h & + \node [block_center] (R2) + {Alice uses a full node + to create a PSBT with + all input UTXOs filled in.}; + & \h \\ + \h & + \node [block_center] (R3) + {PSBT distributed.}; + & \h \\ + \node [block_center] (R4C1) + {Alice signs the + PSBT with her wallet.}; + & + \node [block_center] (R4C2) + {Bob signs the PSBT + with his SPV wallet.}; + & + \node [block_center] (R4C3) + {Carol signs the PSBT + with a completely + offline signing machine.}; + \\ + %~ \h & \node (blind) & \h \\ + \h & + \node [block_center] (R5) + {PSBTs are returned + to Alice.}; + & \h \\ + \h & + \node [block_center] (R6) + {Alices combines the + PSBTs. All inputs now + have 3 signatures.}; + & \h \\ + \h & + \node [block_center] (R7) + {Alice finalizes the PSBT + by creating each input's + final scriptSig. One signature + for each input is dropped.}; + & \h \\ + \h & + \node [block_rounded] (stop) + {Alice extracts the network + serialized transaction and + broadcasts it to the network.}; + & \h \\ + };% end matrix + % connecting nodes with paths +% \begin{pgfonlayer}{bg} + \draw[line width = 1pt, ->] + (R1) edge (R2) + (R2) edge (R3) + (R3) -| (R4C1) + (R3) edge (R4C2) + (R5) edge (R6) + (R6) edge (R7) + (R7) edge (stop); + % circumvent missing arrow + \draw[line width = 1pt, ->] + (R4C1) |-+(0,-2.2em)-| (R5) + (R4C2) edge (R5) + (R4C3) |-+(0,-2.2em)-| (R5) + (R3) -| (R4C3); +% \end{pgfonlayer} + \end{tikzpicture} +\end{document}