1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-12 12:03:29 +00:00

Merge pull request #1115 from Sjors/2021/04/compact_size

bip174: link to 'compact size' definition, document version 0 handling of > 0xFD
This commit is contained in:
Luke Dashjr 2022-01-15 23:27:41 +00:00 committed by GitHub
commit 5847bddd7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ be used as a separator and allow for easier unserializer implementation.</ref>.
Where:
;<tt><keytype></tt>
: 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. There can be multiple entries with the same <tt><keytype></tt> within a specific <tt><map></tt>, but the <tt><key></tt> must be unique.
: A [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer 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. There can be multiple entries with the same <tt><keytype></tt> within a specific <tt><map></tt>, but the <tt><key></tt> must be unique.
;<tt><keylen></tt>
: The compact size unsigned integer containing the combined length of <tt><keytype></tt> and <tt><keydata></tt>
;<tt><valuelen></tt>
@ -819,6 +819,9 @@ If an updater is updating a PSBT and needs to add a field that is only available
New fields should first be proposed on the bitcoin-dev mailing list.
If a field requires significant description as to its usage, it should be accompanied by a separate BIP.
The field must be added to the field listing tables in the Specification section.
Although some PSBT version 0 implementations encode types as uint8_t rather than compact size,
it is still safe to add >0xFD fields to PSBT 0, because these old parsers ignore
unknown fields, and <keytype> is prefixed by its length.
===Procedure For New Versions===