Resolve conflicts in the specification of memo fields by deferring to ZIP 302.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-02-07 11:07:13 +00:00
parent 35d34967ee
commit 2e26bb072d
2 changed files with 26 additions and 12 deletions

View File

@ -8017,24 +8017,22 @@ Each \Sapling \notePlaintext (denoted $\NotePlaintext{}$) consists of:
\introlist
The usage of the \memo is by agreement between the sender and recipient of the
\note. The \memo{} \SHOULD be encoded either as:
\note. The \memo{} \SHOULD be encoded as one of:
\begin{itemize}
\item a UTF-8 human-readable string \cite{Unicode}, padded by appending zero bytes; or
\item an arbitrary sequence of $\MemoByteLength$ bytes starting with a byte value of $\hexint{F5}$
or greater, which is therefore not a valid UTF-8 string.
\item the byte $\hexint{F6}$ followed by $511$ $\hexint{00}$ bytes, indicating ``no memo''; or
\item any other sequence of $\MemoByteLength$ bytes starting with a byte value $\hexint{F5}$
or greater (which is therefore not a valid UTF-8 string), as specified in \cite{ZIP-302}.
\end{itemize}
In the former case, wallet software is expected to strip any trailing zero bytes
and then display the resulting \mbox{UTF-8} string to the recipient user, where applicable.
Incorrect UTF-8-encoded byte sequences \SHOULD be displayed as replacement characters
(\ReplacementCharacter).
When the first byte value is less than $\hexint{F5}$, wallet software is expected to strip any
trailing zero bytes and then display the resulting \mbox{UTF-8} string to the recipient user,
where applicable. Incorrect UTF-8-encoded byte sequences \SHOULD be displayed as replacement
characters (\ReplacementCharacter).
In the latter case, the contents of the \memo{} \SHOULDNOT be displayed. A start byte
of $\hexint{F5}$ is reserved for use by automated software by private agreement.
A start byte of $\hexint{F6}$ followed by $511$ $\hexint{00}$ bytes means ``no memo''.
A start byte of $\hexint{F6}$ followed by anything else, or a start byte of $\hexint{F7}$
or greater, are reserved for use in future \Zcash protocol extensions.
In other cases, the contents of the \memo{} \SHOULDNOT be displayed unless otherwise specified
by \cite{ZIP-302}.
}
Other fields are as defined in \crossref{notes}.
@ -10262,6 +10260,13 @@ Peter Newell's illustration of the Jubjub bird, from \cite{Carroll1902}.
\intropart
\lsection{Change History}{changehistory}
\historyentry{2020.1.1}{2020-02-13}
\begin{itemize}
\item Resolve conflicts in the specification of \memos by deferring to \cite{ZIP-302}.
\end{itemize}
\historyentry{2020.1.0}{2020-02-06}
\begin{itemize}

View File

@ -920,6 +920,15 @@ Last revised February~5, 2018.}
urldate={2019-08-28}
}
@misc{ZIP-302,
presort={ZIP-0302},
author={Jay Graber and Jack Grigg},
title={Standardized Memo Field Format},
howpublished={Zcash Improvement Proposal 302 (in progress).},
url={https://github.com/zcash/zips/pull/105},
urldate={2020-02-13}
}
@misc{DigiByte-PoW,
presort={DigiByte-PoW},
author={DigiByte Core Developers},