Commit Graph
91 Commits
Author SHA1 Message Date
kallewoof e032df5720 Merge pull request #1198 from kallerosenbaum/patch-2
BIP 0174: Fix typo in PSBT_OUT_BIP32_DERIVATION
2021-09-30 08:10:19 +09:00
Kalle Rosenbaum 8918753df9 Fix typo in PSBT_OUT_BIP32_DERIVATION 2021-09-29 11:40:11 +02:00
Kalle Rosenbaum 33efbb2125 Correct format of PSBT_GLOBAL_TX_MODIFIABLE
The descriptions for this field differ between bip370 and bip174. I suppose the correct format of PSBT_GLOBAL_TX_MODIFIABLE is the one in BIP370.
2021-09-29 11:37:48 +02:00
azuchi 5943de4fa4 [BIP174] Fix broken link to psbt2 2021-08-15 15:49:43 +09:00
Andrew Chow c583f4dcbe Specify BIP 371 Taproot Fields for PSBT
Add bip-0371.mediawiki, update readme, and update BIP 174 with
new field types.
2021-07-20 15:03:38 -04:00
Andrew Chow 70e37e025d psbt2: Fix field number counting
PSBT_OUT_SCRIPT should be 0x04, not 0x03.
2021-06-21 17:09:14 -04:00
t-bast 4a1077d40e BIP 174: clarify key uniqueness
The description of keytype incorrectly said it had to be unique: it's the
whole key that must be unique, not the keytype (since we can for instance
have multiple xpubs in the global map).
2021-05-11 16:17:40 +02:00
Luke Dashjr 375f11a30c Merge pull request #1099 from achow101/more-psbt-tests
BIP 174: Add test vectors for additional unsigned tx serialization
2021-04-22 22:51:05 +00:00
Andrew Chow 754b77a915 BIP 174: Add test vectors for additional unsigned tx serialization
There are some edge cases with unsigned tx serialization, so this adds
test vectors for them. Specifically, an unsigned tx with witness
serialization is invalid, a transaction with 0 inputs and 0 outputs is
valid, and a transaction with 0 inputs and non-0 outputs is valid.
2021-04-08 13:34:18 -04:00
kiminuo f45d7c5784 Update bip-0174.mediawiki
I, personally, find this easier to read.
2021-03-31 10:22:39 +02:00
Luke Dashjr cd3885c0fb Merge pull request #1078 from dr-orlovsky/patch-5
Fixing Simple Signer Algorithm
2021-03-15 20:17:23 +00:00
Luke Dashjr d7cc27613e Merge BIP 370 2021-03-15 20:16:33 +00:00
Andrew Chow eaaf376099 174: Change PSBT unknown fields test to use higher numbers
Previously these tests were using 0x0f as the unknown field number. As
these have now been defined, change them to use 0xf0 instead as it is
unlikely we will use those anything soon.
2021-03-04 16:14:45 -05:00
Dr. Maxim Orlovsky 6db1e16486 Fixing Simple Signer Algorithm
Simple Signer Algorithm was lacking an index argument (last one) on all function calls
2021-03-02 20:26:59 +01:00
Andrew Chow b3d224f384 Specify BIP 370 PSBTv2 2021-02-12 16:09:35 -05:00
Luke Dashjr 518fd3fe07 Merge remote-tracking branch 'origin-pull/1036/head' 2021-02-04 00:56:42 +00:00
Luke Dashjr cf13cfa250 Merge pull request #988 from dr-orlovsky/patch-1
BIP 174: require creator to initialize empty output fields
2021-02-03 22:47:20 +00:00
Luke Dashjr f70132e58b BIP 174: Revert title change to fit length limit
This partially reverts c0991047e2.
2021-02-03 22:33:18 +00:00
Andrew Chow 88fb205264 Combine Appendix with field listing tables 2021-01-25 17:13:57 -05:00
Andrew Chow c27d5e8b96 Mark BIP 174 as final 2021-01-25 17:13:57 -05:00
Andrew Chow 80df41818e Include PSBT versions that can or must include field 2021-01-15 13:01:24 -05:00
Andrew Chow a4fb1b9de0 Specify procedure for new fields and versions 2021-01-15 13:01:24 -05:00
Andrew Chow c0991047e2 Explicitly specify PSBTv0 2021-01-15 13:01:19 -05:00
Andrew Chow 50fdf5435e Reformat BIP 174 2021-01-14 12:50:27 -05:00
Rusty Russell 6057fede05 BIP 174: clarify format of proprietary extensions.
"Variable length string identifier" is not defined anywhere, and the suggestion
to use "0x00" is also deeply unclear.  I assumed it meant a nul-terminated
string!

Be explicit: you mean it must be a compact siz1\e unsigned int length, followed
by that many identifier bytes, followed by a compact size unsigned int subtype,
followed by optional keydata.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-01-13 16:55:42 -05:00
Ferdinando M. Ametrano 456c8c5088 fixed input test case description as per output test case description 2020-11-16 21:58:41 +01:00
fametrano c12af49c17 fixed typos 2020-11-15 09:53:06 +01:00
Luke Dashjr 1b7bf8e6aa Merge pull request #981 from apoelstra/2020-08-rename-hash-preimages
BIP174: add `_IN_` to names of new hash preimage fields
2020-10-05 16:31:18 +00:00
Luke Dashjr 602f4971ee Merge pull request #990 from dr-orlovsky/patch-3
BIp 174: fixing typo in rationale reference with closed tag
2020-10-05 16:19:38 +00:00
Dr. Maxim Orlovsky 6b3b636490 BIp 174: fixing typo in rationale reference with closed tag 2020-09-08 15:00:07 +02:00
Dr. Maxim Orlovsky d509aa2110 BIP 174: removing extra "fields" word 2020-09-07 18:38:23 +02:00
Dr. Maxim Orlovsky a159cca11f BIP 174: rename responsibilities->roles to match Bitcoin Core
[Bitcoin Core uses "roles" instead of "responsibilities"](https://github.com/bitcoin/bitcoin/blob/master/src/psbt.h#L559) and it makes semantical sense (plus less verbose).
2020-09-07 13:17:44 +02:00
Dr. Maxim Orlovsky 3d297861eb Require creator to initialize empty output fields
The current version of the spec requires creator role to initialize empty input fields, but says nothing about output field initialization. At the same time, the following role, updater, "should also add redeemScripts, witnessScripts, and BIP 32 derivation paths to the input and output data if it knows them.", which does not make any sense if the fields were uninitialized. The [current Bitcoin Core implementation does this](https://github.com/bitcoin/bitcoin/blob/a24806c25d7a81a9c436de58eb5778d93abab16b/src/psbt.cpp#L12), and [other PSBT implementations, like rust-bitcoin, follow this practice](https://github.com/rust-bitcoin/rust-bitcoin/blob/master/src/util/psbt/mod.rs#L59)
2020-09-07 13:06:43 +02:00
Andrew Poelstra 983b9840b3 bip 174: add new hash preimage fields to Appendix A 2020-08-27 15:02:44 +00:00
Andrew Poelstra e30d465a6a bip174: add _IN_ to new hash preimage fields 2020-08-26 13:49:42 +00:00
Luke Dashjr 76c3ced4b0 Merge pull request #964 from sanket1729/master
BIP 174: Fix formatting changes
2020-08-20 22:17:04 +00:00
Luke Dashjr f6e11640e7 Merge pull request #955 from apoelstra/2020-07-hash-preimages-to-174
BIP174: add hash preimage fields to inputs
2020-08-20 22:16:52 +00:00
Andrew Poelstra 277be22357 BIP174: add hash preimage fields to inputs 2020-08-11 17:31:16 +00:00
Sanket Kanjalkar 8d3b41936f Fix formatting changes 2020-08-04 13:27:31 -05:00
Andrew Chow 5ac2cb5b93 BIP174: Clarify that both UTXO types are allowed 2020-07-21 18:27:20 -04:00
Mike Schmidt 3dbd4866b7 bip-0174: Input Finalizer finalized fields clarifications 2020-06-09 14:40:19 -05:00
Luke Dashjr 24eddbb48a Merge pull request #869 from benthecarman/patch-2
BIP 174: Specify that separator only appears at end of the map
2020-01-03 04:31:58 +00:00
Dmitry Petukhov 8faf97e720 BIP-174: add missing types to Appendix A; fix proprietary type names
PSBT_INPUT_PROPRIETARY -> PSBT_IN_PROPRIETARY

PSBT_OUTPUT_PROPRIETARY -> PSBT_OUT_PROPRIETARY

to be consistent with other in/out type names that use shortened `IN` and `OUT`
2019-12-14 20:39:40 +05:00
Luke Dashjr 0a388fac46 Merge pull request #860 from azuchi/fix-wrong-description-bip174
BIP174: Fix wrong description about Proprietary Use Type
2019-12-13 16:07:25 +00:00
Luke Dashjr 56fe789358 Merge pull request #866 from dgpv/patch-6
BIP174: remove 'first byte is the type' comment for key data
2019-12-13 16:06:41 +00:00
Luke Dashjr feb5395fe0 Merge pull request #867 from dgpv/patch-7
BIP-174: test data: fix value length
2019-12-13 16:06:26 +00:00
Ben Carman e097b1d38a BIP 174: Specify that separator only appears at end of the map 2019-12-11 15:53:06 -06:00
Dmitry Petukhov 65f0b3dd62 BIP-174: test data: fix value length
In the test case "Case: PSBT With invalid output witnessScript typed key", after PSBT_OUT_WITNESS_SCRIPT key with garbage data (which ends with `...478ef51309d`, follows value `2b` which would denote the length of the data value of the key. But the length of actual remaining data is only 7 bytes. Thus, an implementation that reads key-value pairs and checks for validity of the key data after it has read the current key-value pair, will not be able to hit the exact condition intended for this test case: extra data within the key itself. This is because such implementation will hit serialization error when it will try to read the data of the value and will get the short read.

Reading full key-value pair and then checking key format afterwards is fairly normal thing to do, as the format of the keys with all their meaning is an abstraction of higher level than just the simple key-value serialization format.

The proposed change is to replace byte `2b` after the key data to `06` and thus make the value length in the key-value pair valid (not going beyond the end of the data).

base64 encoding has been changed accordingly.
2019-12-09 17:30:47 +05:00
Ben Carman c7191c935e Specify 32 bit itns as unsigned and their endianess 2019-12-09 01:44:43 -06:00
Dmitry Petukhov 267c02a4b5 BIP174: remove 'first byte is the type' comment for key data
As the key type is now defined as compact size integer, `At the beginning of each key is a compact size unsigned integer representing the type`, the comment in the first table in the document, about first byte of the key being the key type is no longer accurate.

As the structure of the key data is described further in the text after the table, and the comment that it starts with the compact size integer seems a bit long to be in that table, I think it is better to just remove the comment about the key data structure from the table, and leave the explanation to the text after the table.
2019-12-09 12:21:09 +05:00