From 0b1b0b2676538d04455d3ea0fad62d04b258fcbb Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Fri, 1 Jul 2022 19:20:09 +1200 Subject: [PATCH 1/5] PSET: docs: Document PSBT fields that are conditionally mandatory in PSET --- doc/pset.mediawiki | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/pset.mediawiki b/doc/pset.mediawiki index 54428fc83d..5674d2160b 100644 --- a/doc/pset.mediawiki +++ b/doc/pset.mediawiki @@ -24,14 +24,21 @@ This BIP is licensed under the 2-clause BSD license. ==Specification== -The Partially Signed Elements Transaction (PSET) format is identical to the BIP 370 PSBT format. -The changes are new proprietary type fields, a new magic sequence, and new roles. +The Partially Signed Elements Transaction (PSET) format extends the BIP 370 PSBT format. +The changes are new proprietary type fields, a new magic sequence, new roles, and changes +to make some PSBT fields conditionally mandatory. + The fields added for PSET are only allowed when the PSBT version is 2. For elements, the identifier prefix string is pset. Note that previous implementations of PSET used a different prefix string and had different fields. The use of a new identifier prefix is to avoid conflicts with the previous implementations. +The following PSBT fields are made conditionally mandatory: + +# PSBT_OUT_AMOUNT is not mandatory once a transaction output is blinded +# PSBT_OUT_SCRIPT is not mandatory for L-BTC fee outputs + The currently defined elements global proprietary types are as follows: {| From e7d994008ebfc8504973b1aed2ea67eac7071abe Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Fri, 1 Jul 2022 19:30:38 +1200 Subject: [PATCH 2/5] PSET: docs: Fix reference to non-existent PSBT_OUT_VALUE field --- doc/pset.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/pset.mediawiki b/doc/pset.mediawiki index 5674d2160b..0dac790636 100644 --- a/doc/pset.mediawiki +++ b/doc/pset.mediawiki @@ -275,7 +275,7 @@ The currently defined elements per-output proprietary types are as follows: | None | No key data | <33 byte commitment> -| The 33 byte Value Commitment for this output. If provided, either PSBT_OUT_VALUE must be removed or PSBT_ELEMENTS_OUT_BLIND_VALUE_PROOF must be provided too. +| The 33 byte Value Commitment for this output. If provided, either PSBT_OUT_AMOUNT must be removed or PSBT_ELEMENTS_OUT_BLIND_VALUE_PROOF must be provided too. | | 0 | 2 From bb20a6c373839214276afff62ea141bfaf68c816 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Fri, 1 Jul 2022 20:05:22 +1200 Subject: [PATCH 3/5] PSET: docs: Mark PSBT_ELEMENTS_GLOBAL_TX_MODIFIABLE bit 0 as reserved/unused Elements does not set or process this bit or this field currently. --- doc/pset.mediawiki | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/pset.mediawiki b/doc/pset.mediawiki index 0dac790636..9c39a0b570 100644 --- a/doc/pset.mediawiki +++ b/doc/pset.mediawiki @@ -67,7 +67,7 @@ The currently defined elements global proprietary types are as follows: | None | No key data | <8-bit uint> -| An 8 bit little endian unsigned integer as a bitfield for various elements specific transaction modification flags. Bit 0 is the PSET Blinded flag and it is set to 1 to indicate that the PSET has not been blinded yet. Once all confidential values, rangeproofs, and asset surjection proofs have been attached to the PSET, it must be set to 0. +| An 8 bit unsigned integer as a bitfield for various elements specific transaction modification flags. Bit 0 is reserved and should not be used. If it is set when reading a PSET, it should be ignored. This field defaults to 0 and should not be output if its value is 0. | | 0 | 2 @@ -390,7 +390,6 @@ For any output which is going to be blinded, the Creator must add the blinding p If any input is blinded, at least one of the outputs must also be blinded, i.e. it must have a PSBT_ELEMENTS_OUT_BLINDING_PUBKEY. Such an output can be a 0 value OP_RETURN output. -Because blinding must occur, the Creator must set Bit 0 of PSBT_ELEMENTS_GLOBAL_TX_MODIFIABLE to indicate that blinding must be done prior to signing. The Creator decides whether and which inputs are issuance inputs. For those inputs, the fields PSBT_ELEMENTS_IN_ISSUANCE_BLINDING_NONCE and PSBT_ELEMENTS_IN_ISSUANCE_ASSET_ENTROPY are set. From 7ef6c4422534d90dd36ee35466ddf8f4d6d71352 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Fri, 1 Jul 2022 20:10:42 +1200 Subject: [PATCH 4/5] PSET: docs: Fix the data type of PSBT_ELEMENTS_IN_PEG_IN_WITNESS --- doc/pset.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/pset.mediawiki b/doc/pset.mediawiki index 9c39a0b570..efb131bd91 100644 --- a/doc/pset.mediawiki +++ b/doc/pset.mediawiki @@ -180,7 +180,7 @@ The currently defined elements per-input proprietary types are as follows: | PSBT_ELEMENTS_IN_PEG_IN_WITNESS = 0x09 | None | No key data -|