Choose lead bytes.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-12-22 23:58:55 +00:00
parent 84d2cf08bc
commit ef9ca8c023
1 changed files with 15 additions and 12 deletions

View File

@ -19,6 +19,8 @@
\newcommand{\PrivateAddress}{\mathsf{addr_{sk}}} \newcommand{\PrivateAddress}{\mathsf{addr_{sk}}}
\newcommand{\PublicAddressName}{\emph{protected address}} \newcommand{\PublicAddressName}{\emph{protected address}}
\newcommand{\PrivateAddressName}{\emph{protected address secret}} \newcommand{\PrivateAddressName}{\emph{protected address secret}}
\newcommand{\PublicAddressLeadByte}{\mathbf{0x92}}
\newcommand{\PrivateAddressLeadByte}{\mathbf{0x93}}
\newcommand{\SpendAuthorityPublic}{\mathsf{a_{pk}}} \newcommand{\SpendAuthorityPublic}{\mathsf{a_{pk}}}
\newcommand{\SpendAuthorityPrivate}{\mathsf{a_{sk}}} \newcommand{\SpendAuthorityPrivate}{\mathsf{a_{sk}}}
\newcommand{\SpendAuthorityName}{\emph{spend authority}} \newcommand{\SpendAuthorityName}{\emph{spend authority}}
@ -35,6 +37,7 @@
\newcommand{\BucketPlaintextName}{\emph{transmitted bucket plaintext}} \newcommand{\BucketPlaintextName}{\emph{transmitted bucket plaintext}}
\newcommand{\BucketCiphertextName}{\emph{transmitted bucket ciphertext}} \newcommand{\BucketCiphertextName}{\emph{transmitted bucket ciphertext}}
\newcommand{\BucketCommitmentName}{\emph{bucket commitment}} \newcommand{\BucketCommitmentName}{\emph{bucket commitment}}
\newcommand{\BucketPlaintextVersionByte}{\mathbf{0x00}}
\newcommand{\CRH}{\mathbf{CRH}} \newcommand{\CRH}{\mathbf{CRH}}
\newcommand{\PRF}[2]{\mathbf{PRF_{#1}^{#2}}} \newcommand{\PRF}[2]{\mathbf{PRF_{#1}^{#2}}}
\newcommand{\PRFaddr}[1]{\PRF{#1}{addr}} \newcommand{\PRFaddr}[1]{\PRF{#1}{addr}}
@ -396,15 +399,15 @@ The raw encoding of a protected address consists of:
\begin{equation*} \begin{equation*}
\begin{bytefield}[bitwidth=0.07em]{520} \begin{bytefield}[bitwidth=0.07em]{520}
\bitbox{80}{0x??} & \bitbox{80}{$\PublicAddressLeadByte$} &
\bitbox{256}{$\SpendAuthorityPublic$ (32 bytes)} & \bitbox{256}{$\SpendAuthorityPublic$ (32 bytes)} &
\bitbox{256}{A 33-byte encoding of $\TransmitPublic$} \bitbox{256}{A 33-byte encoding of $\TransmitPublic$}
\end{bytefield} \end{bytefield}
\end{equation*} \end{equation*}
\begin{itemize} \begin{itemize}
\item A byte, 0x??, indicating this version of the raw encoding of a \Zcash \item A byte, $\PublicAddressLeadByte$, indicating this version of the
public address. raw encoding of a \Zcash public address.
\item 32 bytes specifying $\SpendAuthorityPublic$. \item 32 bytes specifying $\SpendAuthorityPublic$.
\item An encoding of $\TransmitPublic$: The byte 0x01, followed by 32 bytes \item An encoding of $\TransmitPublic$: The byte 0x01, followed by 32 bytes
representing the x coordinate of the elliptic curve point according to representing the x coordinate of the elliptic curve point according to
@ -415,8 +418,8 @@ The raw encoding of a protected address consists of:
5.5.6.3 of IEEE Std 1363a-2004.] 5.5.6.3 of IEEE Std 1363a-2004.]
\end{itemize} \end{itemize}
\textbf{TODO: pick a version byte distinct from other Bitcoin stuff, and that \textbf{TODO: check that this lead byte is distinct from other Bitcoin stuff,
produces the correct Base58 leading character} and produces `z' as the Base58Check leading character.}
\textbf{TODO: what about the network version byte?} \textbf{TODO: what about the network version byte?}
@ -433,21 +436,21 @@ The raw encoding of a protected address secret consists of, in order:
\begin{equation*} \begin{equation*}
\begin{bytefield}[bitwidth=0.07em]{520} \begin{bytefield}[bitwidth=0.07em]{520}
\bitbox{80}{0x??} & \bitbox{80}{$\PrivateAddressLeadByte$} &
\bitbox{256}{$\SpendAuthorityPrivate$ (32 bytes)} & \bitbox{256}{$\SpendAuthorityPrivate$ (32 bytes)} &
\bitbox{256}{$\TransmitPrivate$ (32 bytes)} \bitbox{256}{$\TransmitPrivate$ (32 bytes)}
\end{bytefield} \end{bytefield}
\end{equation*} \end{equation*}
\begin{itemize} \begin{itemize}
\item A byte 0x?? indicating this version of the raw encoding of a Zcash \item A byte $\PrivateAddressLeadByte$ indicating this version of the
private key. raw encoding of a \Zcash private key.
\item 32 bytes specifying $\SpendAuthorityPrivate$. \item 32 bytes specifying $\SpendAuthorityPrivate$.
\item 32 bytes specifying a big-endian encoding of $\TransmitPrivate$. \item 32 bytes specifying a big-endian encoding of $\TransmitPrivate$.
\end{itemize} \end{itemize}
\textbf{TODO: pick a version byte distinct from other Bitcoin stuff, and that \textbf{TODO: check that this lead byte is distinct from other Bitcoin stuff,
produces the correct Base58 leading character} and produces `z' as the Base58Check leading character.}
\textbf{TODO: what about the network version byte?} \textbf{TODO: what about the network version byte?}
@ -477,7 +480,7 @@ The raw encoding of a \BucketPlaintextName consists of, in order:
\begin{equation*} \begin{equation*}
\begin{bytefield}[bitwidth=0.05em]{200} \begin{bytefield}[bitwidth=0.05em]{200}
\bitbox{80}{0x??} & \bitbox{80}{$\BucketPlaintextVersionByte$} &
\bitbox{230}{$\Value$ (8 bytes, big endian)} & \bitbox{230}{$\Value$ (8 bytes, big endian)} &
\bitbox{230}{$\BucketAddressRand$ (32 bytes)} & \bitbox{230}{$\BucketAddressRand$ (32 bytes)} &
\bitbox{230}{$\BucketRand$ (32 bytes)} & \bitbox{230}{$\BucketRand$ (32 bytes)} &
@ -485,7 +488,7 @@ The raw encoding of a \BucketPlaintextName consists of, in order:
\end{equation*} \end{equation*}
\begin{itemize} \begin{itemize}
\item A byte 0x?? indicating this version of the raw encoding of a \BucketPlaintextName. \item A byte $\BucketPlaintextVersionByte$ indicating this version of the raw encoding of a \BucketPlaintextName.
\item 8 bytes specifying a big-endian encoding of $\Value$. \item 8 bytes specifying a big-endian encoding of $\Value$.
\item 32 bytes specifying $\BucketAddressRand$. \item 32 bytes specifying $\BucketAddressRand$.
\item 32 bytes specifying $\BucketRand$. \item 32 bytes specifying $\BucketRand$.