Skip to content

Commit 503f35a

Browse files
committed
Add Version type
1 parent 32b496a commit 503f35a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bip-0174.mediawiki

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ The currently defined global types are as follows:
124124
** Value: The master key fingerprint as defined by BIP 32 concatenated with the derivation path of the public key. The derivation path is represented as 32 bit unsigned integer indexes concatenated with each other. The number of 32 bit unsigned integer indexes must match the depth provided in the extended public key.
125125
*** <tt>{master key fingerprint}|{32-bit int}|...|{32-bit int}</tt>
126126
127+
* Type: Version Number <tt>PSBT_GLOBAL_VERSION = 0xFB</tt>
128+
** Key: None. The key must only contain the 1 byte type.
129+
*** <tt>{0xFB}</tt>
130+
** Value: The 32-bit little endian unsigned integer representing the version number of this PSBT. If ommitted, the version number is 0.
131+
*** <tt>{32-bit int}</tt>
132+
127133
The currently defined per-input types are defined as follows:
128134

129135
* Type: Non-Witness UTXO <tt>PSBT_IN_NON_WITNESS_UTXO = 0x00</tt>
@@ -432,6 +438,17 @@ types will be ignored and passed-through by signers which do not know about them
432438

433439
If one byte type fields were to ever run out, new extensions can still be added by defining multi-byte types where the first byte signals that the next byte indicates the type and so on.
434440

441+
===Version Numbers===
442+
443+
The Version number field exists only as a safeguard in the event that a backwards incompatible change is introduced to PSBT.
444+
If a parser encounters a version number it does not recognize, it should exit immediately as this indicates that the PSBT will contain types that it does not know about and cannot be ignored.
445+
Current PSBTs are Version 0. Any PSBT that does not have the version field is version 0.
446+
It is not expected that any backwards incompatible change will be introduced to PSBT, so it is not expected that the version field will ever actually be seen.
447+
448+
Updaters and combiners that need to add a version number to a PSBT should use the highest version number required.
449+
For example, if a combiner sees two PSBTs for the same transaction, one with version 0, and the other with version 1, then it should combine them and produce a PSBT with version 1.
450+
If an updater is updating a PSBT and needs to add a field that is only available in version 1, then it should set the PSBT version number to 1 unless a version higher than that is already specified.
451+
435452
==Compatibility==
436453

437454
This transaction format is designed so that it is unable to be properly unserialized

0 commit comments

Comments
 (0)