ZIP: 302 Title: Standardized Memo Field Format Owners: Jack Grigg <firstname.lastname@example.org> Original-Authors: Jay Graber Status: Draft Category: Standards / RPC / Wallet Created: 2017-02-08 Discussions-To: <https://github.com/zcash/zips/issues/366> Pull-Request: <https://github.com/zcash/zips/pull/105>
This ZIP describes a proposed specification for a standardized format for clients who wish to transmit or receive content within the encrypted memo field of shielded transactions.
A well-defined standard for formatting content within the encrypted memo field will help expand its use within the Zcash ecosystem by providing a commonly recognized format for memo values carrying different types of data. Users and third-party services benefit from standardized formatting rules that define the type and length of the data contained within.
Section 5.5 of the Zcash protocol specification 1 defines three cases for the encoding of a memo field:
0xF6followed by 511
0x00bytes, indicating "no memo"; or
0xF5or greater (which is therefore not a valid UTF-8 string), as specified in ZIP 302.
This ZIP refines the specification of the third case.
The following specification constrains a party, called the "reader", that interprets the contents of a memo. It does not define consensus requirements.
The new protocol specification is an improvement over the current memo field content specification that was in the protocol spec up to version 2020.1.0, which stated:
The usage of the memo field is by agreement between the sender and recipient of the note. The memo field SHOULD be encoded either as:
- a UTF-8 human-readable string [Unicode], padded by appending zero bytes; or
- an arbitrary sequence of 512 bytes starting with a byte value of 0xF5 or greater, which is therefore not a valid UTF-8 string.
In the former case, wallet software is expected to strip any trailing zero bytes and then display the resulting UTF-8 string to the recipient user, where applicable. Incorrect UTF-8-encoded byte sequences should be displayed as replacement characters (U+FFFD).
In the latter case, the contents of the memo field SHOULD NOT be displayed. A start byte of 0xF5 is reserved for use by automated software by private agreement. A start byte of 0xF6 or greater is reserved for use in future Zcash protocol extensions.
See issue #1849 for further discussion.
Encrypted memo field contents sent without the standardized format proposed here will be interpreted according to the specification set out in older versions of the protocol spec.
|1||Zcash Protocol Specification, Version 2021.1.19|
|2||UTF-8, a transformation format of ISO 10646|
|3||Variable length integer. Bitcoin Wiki|