Skip to content

Add encodings for viewing keys, which should include a_pk#117

Merged
daira merged 11 commits intomasterfrom
zips101.viewing-key-format.1
Dec 18, 2017
Merged

Add encodings for viewing keys, which should include a_pk#117
daira merged 11 commits intomasterfrom
zips101.viewing-key-format.1

Conversation

@daira
Copy link
Copy Markdown
Collaborator

@daira daira commented Feb 21, 2017

fixes #101. refs zcash/zcash#1997

@zmanian
Copy link
Copy Markdown

zmanian commented Feb 21, 2017

Yay. Updating the offline address generator for encodings!

Copy link
Copy Markdown
Collaborator

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK but see comments.

Comment thread protocol/protocol.tex Outdated
@@ -1026,7 +1033,8 @@

A \keyTuple $(\AuthPrivate, \TransmitPrivate, \PaymentAddress)$ is
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the viewing key be included in the key tuple?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We mentioned key tuples in only two places, so I've simplified the spec (in my local copy) by removing that concept and just referring to the key components.

Comment thread protocol/protocol.tex
instead.)
\item 256 bits specifying $\AuthPublic$.
\item 256 bits specifying $\TransmitPrivate$, using the normal encoding
of a Curve25519 private key \cite{Bern2006}.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might pay to clarify that this is a clamped Curve25519 private key, to avoid implementation divergence. Although zcashd could work around this inconsistency, it would be good to avoid it in the first place, as the Base58 encoding means that the viewing key would look significantly different with and without clamping, which could confuse users.

Copy link
Copy Markdown
Collaborator Author

@daira daira Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Should we reject keys that are not clamped (and less than the group order)? That seems the simplest way to avoid divergence.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A counter-argument I've heard to clamping is that when multiplying the private key by some scalar mod p (e.g. for blinding), the clamping is not preserved if it overflows (that would only the case mod l). But I can't see a way in which blinding might want to be applied to sk_enc, that would be affected by requiring clamping here. So I think it's fine to just require clamping.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FiloSottile pushed a commit to FiloSottile/zcash-mini that referenced this pull request Feb 23, 2017
@daira daira force-pushed the zips101.viewing-key-format.1 branch from c5fc148 to c2a4d14 Compare February 23, 2017 20:37
@daira
Copy link
Copy Markdown
Collaborator Author

daira commented Feb 23, 2017

@str4d's comments have been addressed.

@str4d
Copy link
Copy Markdown
Collaborator

str4d commented Mar 1, 2017

@daira do you want to rebase this before or after I re-review?

str4d added a commit to str4d/zcash that referenced this pull request Mar 2, 2017
@daira
Copy link
Copy Markdown
Collaborator Author

daira commented Mar 7, 2017

@str4d After; you can rereview now.

Copy link
Copy Markdown
Collaborator

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

Comment thread protocol/protocol.tex
instead.)
\item 256 bits specifying $\AuthPublic$.
\item 256 bits specifying $\TransmitPrivate$, using the normal encoding
of a Curve25519 private key \cite{Bern2006}.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A counter-argument I've heard to clamping is that when multiplying the private key by some scalar mod p (e.g. for blinding), the clamping is not preserved if it overflows (that would only the case mod l). But I can't see a way in which blinding might want to be applied to sk_enc, that would be affected by requiring clamping here. So I think it's fine to just require clamping.

Comment thread protocol/protocol.tex
instead.)
\item 256 bits specifying $\AuthPublic$.
\item 256 bits specifying $\TransmitPrivate$, using the normal encoding
of a Curve25519 private key \cite{Bern2006}.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daira daira self-assigned this Jul 10, 2017
str4d added a commit to str4d/zcash that referenced this pull request Dec 4, 2017
@arielgabizon
Copy link
Copy Markdown
Contributor

The rendered protocol pdf suddenly has the old key diagram

Also fix a minor error in the specification of note decryption.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
@daira daira force-pushed the zips101.viewing-key-format.1 branch from c2a4d14 to d4e2da7 Compare December 17, 2017 00:47
@daira daira merged commit d4e2da7 into master Dec 18, 2017
@daira daira deleted the zips101.viewing-key-format.1 branch April 21, 2018 13:28
daira pushed a commit to daira/zips that referenced this pull request Jul 16, 2025
This PR makes updates to ZIP 246 (aka the V6 SIGHASH algorithm) based on
the changes being made as a part of zcash#1048. A minor broken link is
also fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protocol spec: Define a serialization format for viewing keys

4 participants