Expose spend-auth signing and verification accessors - #543
Open
schell wants to merge 1 commit into
Open
Conversation
Add three public methods needed for non-transaction signatures (such as UFVK binding signatures in zcash_keys): - SpendAuthorizingKey::sign signs a message with the unrandomized key, delegating to the inner redpallas::SigningKey. - SpendValidatingKey::to_verification_key returns the unrandomized redpallas::VerificationKey, enabling verification of non-spend signatures. - FullViewingKey::ak exposes the spend validating key, which was previously private with no public accessor. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Downstream consumers (notably
zcash_keysin librustzcash) need to sign and verify non-transaction messages with spend-authorizing keys. For example, the proposed UFVK binding signature inzcash_keyssigns a UFVK's canonical encoding with the account'sUnifiedSpendingKeyto detect tampering of the stored UFVK in a wallet database (audit finding COR-1649).Currently, the signing and verification primitives are only accessible through the
randomizepath, which applies a per-spend randomizer. For non-transaction signatures, no randomizer is needed, but there is no public way to sign with the unrandomized key or to obtain the unrandomized verification key.Changes
SpendAuthorizingKey::signsigns a message with the unrandomized spend-authorizing key, delegating to the innerredpallas::SigningKey.SpendValidatingKey::to_verification_keyreturns the unrandomizedredpallas::VerificationKey, enabling verification of non-spend signatures.FullViewingKey::akexposes the spend validating key, which was previously private with no public accessor. (Sapling'sFullViewingKey.vk.akis already public; this aligns the two crates.)All three are pure delegation methods with no new logic. The existing
randomizepath is unchanged.COR-1649
Co-Authored-By: Claude noreply@anthropic.com