Skip to content

Expose spend-auth signing and verification accessors - #193

Closed
schell wants to merge 1 commit into
mainfrom
expose-spend-auth-signing-accessors
Closed

Expose spend-auth signing and verification accessors#193
schell wants to merge 1 commit into
mainfrom
expose-spend-auth-signing-accessors

Conversation

@schell

@schell schell commented Aug 13, 2026

Copy link
Copy Markdown

Motivation

Downstream consumers (notably zcash_keys in librustzcash) need to sign and verify non-transaction messages with spend-authorizing keys. For example, the proposed UFVK binding signature in zcash_keys signs a UFVK's canonical encoding with the account's UnifiedSpendingKey to 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 randomize path, 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::sign signs a message with the unrandomized spend-authorizing key, delegating to the inner redjubjub::SigningKey.
  • SpendValidatingKey::to_verification_key returns the unrandomized redjubjub::VerificationKey, enabling verification of non-spend signatures.

Both are pure delegation methods with no new logic. The existing randomize path is unchanged.

COR-1649

Co-Authored-By: Claude noreply@anthropic.com

Add two 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 redjubjub::SigningKey.
- SpendValidatingKey::to_verification_key returns the unrandomized
  redjubjub::VerificationKey, enabling verification of non-spend signatures.

Also moves the rand_core::{CryptoRng, RngCore} import from a cfg(test) gate
to unconditional, since the new sign method needs it in production code.

Co-Authored-By: Claude <noreply@anthropic.com>
@schell

schell commented Aug 19, 2026

Copy link
Copy Markdown
Author

Won't do.

@schell schell closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant