Merge c80e926d6e into merged_master (Elements PR ElementsProject/elements#1122)

This commit is contained in:
Glenn Willen 2023-03-01 00:44:02 -08:00
commit bc0b708508

View file

@ -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 <tt>pset</tt>.
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:
# <tt>PSBT_OUT_AMOUNT</tt> is not mandatory once a transaction output is blinded
# <tt>PSBT_OUT_SCRIPT</tt> is not mandatory for L-BTC fee outputs
The currently defined elements global proprietary types are as follows:
{|
@ -60,7 +67,7 @@ The currently defined elements global proprietary types are as follows:
| None
| No key data
| <tt><8-bit uint></tt>
| 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
@ -110,7 +117,7 @@ The currently defined elements per-input proprietary types are as follows:
| 2
|-
| Issuance Inflation Keys Rangeproof
| <tt>PSBT_ELEMENTS_IN_ISSUANCE_KEYS_RANGEPROOF = 0x03</tt>
| <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_RANGEPROOF = 0x03</tt>
| None
| No key data
| <tt><rangeproof></tt>
@ -140,7 +147,7 @@ The currently defined elements per-input proprietary types are as follows:
| 2
|-
| Peg-in Genesis Hash
| <tt>PSBT_ELEMENTS_IN_PEG_IN_GENESIS = 0x06</tt>
| <tt>PSBT_ELEMENTS_IN_PEG_IN_GENESIS_HASH = 0x06</tt>
| None
| No key data
| <tt><hash></tt>
@ -173,14 +180,14 @@ The currently defined elements per-input proprietary types are as follows:
| <tt>PSBT_ELEMENTS_IN_PEG_IN_WITNESS = 0x09</tt>
| None
| No key data
| <tt><script></tt>
| <tt><scriptWitness></tt>
| The Peg-in witness for the Peg-in Transaction.
|
| 0
| 2
|-
| Issuance Inflation Keys Amount
| <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS = 0x0a</tt>
| <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_AMOUNT = 0x0a</tt>
| None
| No key data
| <tt><64-bit int></tt>
@ -194,7 +201,7 @@ The currently defined elements per-input proprietary types are as follows:
| None
| No key data
| <tt><33 byte commitment></tt>
| The 33 byte commitment to the inflation keys output value in this issuance. If provided, either <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS</tt> must be removed or <tt>PSBT_ELEMENTS_IN_ISSUANCE_BLIND_INFLATION_KEYS_PROOF</tt> must be provided too.
| The 33 byte commitment to the inflation keys output value in this issuance. If provided, either <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_AMOUNT</tt> must be removed or <tt>PSBT_ELEMENTS_IN_ISSUANCE_BLIND_INFLATION_KEYS_PROOF</tt> must be provided too.
|
| 0
| 2
@ -244,7 +251,7 @@ The currently defined elements per-input proprietary types are as follows:
| None
| No key data
| <tt><rangeproof></tt>
| An explicit value rangeproof that proves that the value commitment in <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_COMMITMENT</tt> matches the explicit value in <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS</tt>. If provided, <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_COMMITMENT</tt> must be provided too.
| An explicit value rangeproof that proves that the value commitment in <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_COMMITMENT</tt> matches the explicit value in <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_AMOUNT</tt>. If provided, <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_COMMITMENT</tt> must be provided too.
|
| 0
| 2
@ -268,7 +275,7 @@ The currently defined elements per-output proprietary types are as follows:
| None
| No key data
| <tt><33 byte commitment></tt>
| The 33 byte Value Commitment for this output. If provided, either <tt>PSBT_OUT_VALUE</tt> must be removed or <tt>PSBT_ELEMENTS_OUT_BLIND_VALUE_PROOF</tt> must be provided too.
| The 33 byte Value Commitment for this output. If provided, either <tt>PSBT_OUT_AMOUNT</tt> must be removed or <tt>PSBT_ELEMENTS_OUT_BLIND_VALUE_PROOF</tt> must be provided too.
|
| 0
| 2
@ -383,12 +390,11 @@ 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 <tt>PSBT_ELEMENTS_OUT_BLINDING_PUBKEY</tt>.
Such an output can be a 0 value OP_RETURN output.
Because blinding must occur, the Creator must set Bit 0 of <tt>PSBT_ELEMENTS_GLOBAL_TX_MODIFIABLE</tt> 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 <tt>PSBT_ELEMENTS_IN_ISSUANCE_BLINDING_NONCE</tt> and <tt>PSBT_ELEMENTS_IN_ISSUANCE_ASSET_ENTROPY</tt> are set.
Such inputs must also have the issuance flag set in the outpoint of the input.
The amount is added to the PSET input as <tt>PSBT_ELEMENTS_IN_ISSUANCE_VALUE</tt> and the amount for the issuance inflation keys output as <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS</tt>.
The amount is added to the PSET input as <tt>PSBT_ELEMENTS_IN_ISSUANCE_VALUE</tt> and the amount for the issuance inflation keys output as <tt>PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_AMOUNT</tt>.
The Creator decides whether and which inputs are Peg-in inputs.
Peg-in inputs must have the Peg-in flag set in their outpoints.