From 20fdf77a2bcb04886b2b1d4d1b20b0135388ac4b Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 1 Aug 2019 14:36:25 -0400 Subject: [PATCH] Specify that types are compact size unsigned ints to allow for multi-byte types --- bip-0174.mediawiki | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bip-0174.mediawiki b/bip-0174.mediawiki index bbc0fc65..d30b05d8 100644 --- a/bip-0174.mediawiki +++ b/bip-0174.mediawiki @@ -106,8 +106,10 @@ The format of each key-value map is as follows: | Must be 0x00. |} -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.