From de694d4509c0652714f6976458394918438479ff Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 19 Mar 2021 11:28:50 +1300 Subject: [PATCH] Final changes to remove undecided parts of the draft --- zip-0302.rst | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/zip-0302.rst b/zip-0302.rst index 183f3d4d..0be9d67b 100644 --- a/zip-0302.rst +++ b/zip-0302.rst @@ -44,27 +44,14 @@ contents of a memo. It does not define consensus requirements. + strip any trailing zero bytes + decode it as a UTF-8 string (if decoding fails then report an error). -+ If the first byte has a value of 0xF5, then the reader MUST: - + Interpret the next few bytes (1 to 9 of them) as a 64-bit unsigned variable-length - integer [#Bitcoin-CompactSize]_, and use it as an arbitrary application-defined - "type" field. - + Interpret the next 1 or 2 bytes as a CompactSize value constrained to the range 0..510, and use - the resulting value as the length of the remaining data. - + If 1 + the number bytes used for the type field + the number of bytes used for the - length field + the length > 512 then report an error. - + Inspect the padding after the end of the indicated length, and if it - contains anything other than bytes of value 0x00 then report an error. - + Return to the caller a 3-tuple of the following data: - + the type — an integer in :math:`[0...2^{64})` - + the length — an integer in :math:`[0...510)` - + a byte string of that length that contains the payload ++ If the first byte has a value of 0xF6, and the remaining 511 bytes are 0x00, then the user + supplied no memo, and the encrypted memo field is to be treated as empty. -+ If the first byte has a value of 0xF6, then the user supplied no memo, and the encrypted - memo field is to be treated as empty. - -+ If the first byte has a value between 0xF7 and 0xFE inclusive, then this memo is from - the future, because first byte values of 0xF7–0xFE are reserved for future - specifications of this protocol. ++ If the memo matches any of these patterns, then this memo is from the future, because + these ranges are reserved for future updates to this specification: + - The first byte has a value of 0xF5. + - The first byte has a value between 0xF7 and 0xFE inclusive. + - The first byte has a value of 0xF6, and the remaining 511 bytes are not all 0x00. + If the first byte has a value of 0xFF then the reader should not make any other assumption about the memo. In order to put data into a memo field that does not use the