Skip to content

Commit

Permalink
Resolve conflicts in the specification of memo fields by deferring to…
Browse files Browse the repository at this point in the history
… ZIP 302.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
  • Loading branch information
daira committed Feb 13, 2020
1 parent 35d3496 commit 2e26bb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
29 changes: 17 additions & 12 deletions protocol/protocol.tex
Expand Up @@ -8017,24 +8017,22 @@

\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}.
Expand Down Expand Up @@ -10262,6 +10260,13 @@
\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}
Expand Down
9 changes: 9 additions & 0 deletions protocol/zcash.bib
Expand Up @@ -920,6 +920,15 @@ @misc{ZIP-243
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},
Expand Down

0 comments on commit 2e26bb0

Please sign in to comment.