mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge ElementsProject/elements#1122: PSET spec updates
28c3836b5cPSET: docs: Fix constant names to match those actually used (Jon Griffiths)7ef6c44225PSET: docs: Fix the data type of PSBT_ELEMENTS_IN_PEG_IN_WITNESS (Jon Griffiths)bb20a6c373PSET: docs: Mark PSBT_ELEMENTS_GLOBAL_TX_MODIFIABLE bit 0 as reserved/unused (Jon Griffiths)e7d994008ePSET: docs: Fix reference to non-existent PSBT_OUT_VALUE field (Jon Griffiths)0b1b0b2676PSET: docs: Document PSBT fields that are conditionally mandatory in PSET (Jon Griffiths) Pull request description: Following discussion with achow101 ACKs for top commit: apoelstra: utACK28c3836b5cTree-SHA512: 72d4399a749bfb95042d7375e780a0992e1ca850af049de7710e48b8bcdb4cd7703f92882d83ba3131398b8f0aef01ae450721c9dd960bb7c700497a4a7be6fb
This commit is contained in:
commit
c80e926d6e
1 changed files with 18 additions and 12 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue