mirror of
https://github.com/bitcoin/bips.git
synced 2026-10-19 19:29:18 +00:00
bip-138 add string content type
This commit is contained in:
@@ -325,6 +325,7 @@ remaining bytes are `PADDING`. A `PAYLOAD` MUST contain at least one item (see
|
|||||||
| 0x00 | End of content items; padding follows |
|
| 0x00 | End of content items; padding follows |
|
||||||
| 0x01 | BIP Number (big-endian uint16) |
|
| 0x01 | BIP Number (big-endian uint16) |
|
||||||
| 0x02 | Vendor-Specific Opaque Tag |
|
| 0x02 | Vendor-Specific Opaque Tag |
|
||||||
|
| 0x03 | String |
|
||||||
|
|
||||||
`LENGTH`: variable-length integer representing the length of `DATA` in bytes.
|
`LENGTH`: variable-length integer representing the length of `DATA` in bytes.
|
||||||
|
|
||||||
@@ -338,6 +339,8 @@ For `TYPE` values defined above:
|
|||||||
- 0x01: `LENGTH` MUST be omitted and `DATA` is a 2-byte big-endian unsigned integer
|
- 0x01: `LENGTH` MUST be omitted and `DATA` is a 2-byte big-endian unsigned integer
|
||||||
representing the BIP number that defines it.
|
representing the BIP number that defines it.
|
||||||
- 0x02: `DATA` MUST be `LENGTH` bytes of opaque, vendor-specific data.
|
- 0x02: `DATA` MUST be `LENGTH` bytes of opaque, vendor-specific data.
|
||||||
|
- 0x03: `DATA` MUST be empty, and the following `PLAINTEXT` is the string itself,
|
||||||
|
which MUST be valid UTF-8.
|
||||||
|
|
||||||
For all `TYPE` values except `0x01`, parsers MUST reject `CONTENT` if `LENGTH` exceeds
|
For all `TYPE` values except `0x01`, parsers MUST reject `CONTENT` if `LENGTH` exceeds
|
||||||
the remaining payload bytes.
|
the remaining payload bytes.
|
||||||
|
|||||||
Reference in New Issue
Block a user