Skip to content

Commit 6057fed

Browse files
rustyrussellachow101
authored andcommitted
BIP 174: clarify format of proprietary extensions.
"Variable length string identifier" is not defined anywhere, and the suggestion to use "0x00" is also deeply unclear. I assumed it meant a nul-terminated string! Be explicit: you mean it must be a compact siz1\e unsigned int length, followed by that many identifier bytes, followed by a compact size unsigned int subtype, followed by optional keydata. Signed-off-by: Rusty Russell <[email protected]>
1 parent cf0b529 commit 6057fed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

bip-0174.mediawiki

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ The currently defined global types are as follows:
133133
*** <tt>{32-bit uint}</tt>
134134
135135
* Type: Proprietary Use Type <tt>PSBT_GLOBAL_PROPRIETARY = 0xFC</tt>
136-
** Key: Variable length identifier prefix, followed by a subtype, followed by the key data itself.
137-
*** <tt>{0xFC}|<prefix>|{subtype}|{key data}</tt>
136+
** Key: Compact size unsigned integer, followed by identifier prefix of that length, followed by a subtype, followed by the key data itself.
137+
*** <tt>{0xFC}|{prefixlen}|<prefix>|{subtype}|{key data}</tt>
138138
** Value: Any value data as defined by the proprietary type user.
139139
*** <tt><data></tt>
140140
@@ -225,8 +225,8 @@ The currently defined per-input types are defined as follows:
225225
*** <tt>{preimage}</tt>
226226
227227
* Type: Proprietary Use Type <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
228-
** Key: Variable length identifier prefix, followed by a subtype, followed by the key data itself.
229-
*** <tt>{0xFC}|<prefix>|{subtype}|{key data}</tt>
228+
** Key: Compact size unsigned integer, followed by identifier prefix of that length, followed by a subtype, followed by the key data itself.
229+
*** <tt>{0xFC}|{prefixlen}|<prefix>|{subtype}|{key data}</tt>
230230
** Value: Any value data as defined by the proprietary type user.
231231
*** <tt><data></tt>
232232
@@ -253,8 +253,8 @@ determine which outputs are change outputs and verify that the change is returni
253253
*** <tt>{master key fingerprint}|{32-bit uint}|...|{32-bit uint}</tt>
254254
255255
* Type: Proprietary Use Type <tt>PSBT_OUT_PROPRIETARY = 0xFC</tt>
256-
** Key: Variable length identifier prefix, followed by a subtype, followed by the key data itself.
257-
*** <tt>{0xFC}|<prefix>|{subtype}|{key data}</tt>
256+
** Key: Compact size unsigned integer, followed by identifier prefix of that length, followed by a subtype, followed by the key data itself.
257+
*** <tt>{0xFC}|{prefixlen}|<prefix>|{subtype}|{key data}</tt>
258258
** Value: Any value data as defined by the proprietary type user.
259259
*** <tt><data></tt>
260260
@@ -336,10 +336,10 @@ values are valid, then it does not matter which is chosen as either way the tran
336336
===Proprietary Use Type===
337337

338338
For all global, per-input, and per-output maps, the types <tt>0xFC</tt> is reserved for proprietary use.
339-
The proprietary use type requires keys that follow the type with a variable length string identifer, then a subtype.
339+
The proprietary use type requires keys that follow the type with a compact size unsigned integer representing the length of the string identifer, followed by the string identifier, then a subtype, and finally any key data.
340340

341341
The identifier can be any variable length string that software can use to identify whether the particular data in the proprietary type can be used by it.
342-
It can also be the empty string and just be a single <tt>0x00</tt> byte although this is not recommended.
342+
It can also be the empty string although this is not recommended.
343343

344344
The subtype is defined by the proprietary type user and can mean whatever they want it to mean.
345345
The subtype must also be a compact size unsigned integer in the same form as the normal types.

0 commit comments

Comments
 (0)