Specify that types are compact size unsigned ints to allow for multi-byte types

This commit is contained in:
Andrew Chow 2019-08-01 14:36:25 -04:00
parent 503f35a9a0
commit 20fdf77a2b

View File

@ -106,8 +106,10 @@ The format of each key-value map is as follows:
| Must be <tt>0x00</tt>.
|}
The first byte of each key specifies the type of the key-value pair. There are global types,
per-input types, and per-output types.
At the beginning of each key is a compact size unsigned integer representing the type.
This compact size unsigned integer must be minimally encoded, i.e. if the value can be represented using one byte, it must be represented as one byte.
For convenience, this BIP will specify types using their full serialization, so a multi-byte type will have it's full prefix and zero padding as necessary.
There are global types, per-input types, and per-output types.
The currently defined global types are as follows:
@ -436,8 +438,6 @@ The Partially Signed Transaction format can be extended in the future by adding
new types for key-value pairs. Backwards compatibilty will still be maintained as those new
types will be ignored and passed-through by signers which do not know about them.
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.
===Version Numbers===
The Version number field exists only as a safeguard in the event that a backwards incompatible change is introduced to PSBT.