Author: Dmitry Petukhov 2019-07-31 16:19:48
Published on: 2019-07-31T16:19:48+00:00
In an email to Bitcoin-dev, Andrew Chow proposes the reservation of certain types for private use in PSBTs. These types would be used by organizations or individuals who require additional data that is not useful or available to the general public. To distinguish between different private formats, Chow suggests that private types should start with a prefix and that the size of the prefix should be indicated at the beginning. Organizations can choose any prefix they like or no prefix if they are fine with possible conflicts with other empty-prefix private types.Chow also proposes a canonical method for multibyte types. He suggests designating a specific type, 0xFF, to indicate that the type is multiple bytes. When parsers see this value, they read the next byte as being part of the type. Two-byte types will be of the form 0xFFXX, three-byte types will be of the form 0xFFFFXX, four-byte types 0xFFFFFFXX, and so on. The proposed system allows for a prefix match to quickly identify the type being used. Finally, Chow suggests encoding the types as 'compact size unsigned integer' to avoid adding complexity to parsing, as it is already used in the BIP for other fields.
Updated on: 2023-06-13T20:36:21.961804+00:00