ZIP 302: Structured memos#638
Conversation
|
In ZIP Sync today, we decided that:
|
ef5529a to
2824c4b
Compare
|
I've replaced the old contents of this PR (which just reverted the prior content that was removed from the original ZIP 302 PR) with an initial draft following what was decided in ZIP Sync almost 2 years ago. |
2824c4b to
ff9b60e
Compare
The base branch was changed.
Also switches to using a table for the part types registry
b1c32ef to
369dba1
Compare
| - Read the next ``partLength`` bytes to obtain ``partValue``. If ``partLength`` would | ||
| require the reader to read past the end of the memo bytes, return an error. | ||
| - Store ``(partType, partVersion, partValue)`` and continue parsing. | ||
|
|
||
| If an error occurs, readers MUST treat the entire memo as invalid (ignoring any | ||
| ``MemoPart`` that was successfully parsed prior to the error). | ||
|
|
||
| Defined memo part types | ||
| ``````````````````````` | ||
|
|
||
| The following memo part types (and corresponding versioned value encodings) are defined: | ||
|
|
||
| +--------------+-----------------+-------------------------------------------------------------------------------------+ | ||
| | ``partType`` | ``partVersion`` | ``partValue`` encoding | | ||
| +==============+=================+=====================================================================================+ | ||
| | 160 | 0 | A UTF-8 string. | | ||
| | | | If decoding fails then return an error; readers MUST NOT replace invalid sequences. | | ||
| +--------------+-----------------+-------------------------------------------------------------------------------------+ | ||
| | 255 | 0 | Unconstrained data, for private use (like ``0xFF`` outside structured memos). | | ||
| | | | Readers should not make any assumptions about the encoding or content of this data. | | ||
| +--------------+-----------------+-------------------------------------------------------------------------------------+ | ||
| | 10000-19999 | Currently unassigned range for "assigned private use". | | ||
| +--------------+-----------------+-------------------------------------------------------------------------------------+ | ||
| | 65530-65535 | For temporary experimentation. | | ||
| +--------------+-----------------+-------------------------------------------------------------------------------------+ |
There was a problem hiding this comment.
In ZIP Sync, we decided to require that the parser default to "unknown-reject": if a partType is unknown, error and do not return any understood part types to the wallet. We will then define that any partType in the range 30000-65535 is "optional" and can be stored in an Unknown handler (and then move the "assigned private use" section to the start of this range).
|
This is pending resolution of @str4d's #638 (comment), so moving to draft. |
Closes #1208.
Closes COR-1074.