Skip to content

Add Zcash signing batch/result UR types - #131

Merged
soralit merged 2 commits into
KeystoneHQ:masterfrom
valargroup:adam/zcash-batch-registry
Jun 24, 2026
Merged

Add Zcash signing batch/result UR types#131
soralit merged 2 commits into
KeystoneHQ:masterfrom
valargroup:adam/zcash-batch-registry

Conversation

@czarcas7ic

Copy link
Copy Markdown
Contributor

Adds zcash-sign-batch and zcash-sign-result registry models, CBOR encode/decode support, type/tag wiring, and parser/encoder roundtrip coverage for Zcash batch signing payloads.

This layer validates registry shape only. It rejects malformed CBOR, duplicate map keys, missing required fields, and trailing data, while leaving version, network, kind/status, digest, uniqueness, and request/result correlation policy to firmware callers.

Existing zcash-accounts export compatibility is preserved. The decoder accepts optional device version metadata and FFI includes it when present, but the encoder continues emitting the prior two-field account map.

Validation:

  • cargo +nightly-2025-07-01 test -p ur-registry zcash_sign --locked -- --nocapture
  • cargo +nightly-2025-07-01 test -p ur-parse-lib --locked zcash -- --nocapture
  • cargo +nightly-2025-07-01 test -p ur-registry-ffi zcash_accounts --locked -- --nocapture

@czarcas7ic
czarcas7ic marked this pull request as ready for review June 20, 2026 05:44
@czarcas7ic
czarcas7ic force-pushed the adam/zcash-batch-registry branch from 630b7cd to 21e39c5 Compare June 20, 2026 05:45
@czarcas7ic
czarcas7ic marked this pull request as draft June 20, 2026 05:45
@czarcas7ic
czarcas7ic marked this pull request as ready for review June 20, 2026 05:46
Preparatory commit ahead of the batch/result signing types. Extracts shared
cbor_helpers (reject_duplicate_key, require_key), converts zcash-accounts and
zcash-unified-full-viewing-key off the impl_cbor_bytes! macro to explicit
TryFrom/TryInto, and hardens the decoders to reject duplicate map keys, missing
required fields, unexpected nested registry tags, and trailing data. Adds URType
variants and registry roundtrip tests for the existing types; the zcash-accounts
encoder keeps its two-field shape with device_version decode-only. No new wire types.
@czarcas7ic
czarcas7ic force-pushed the adam/zcash-batch-registry branch from 21e39c5 to dd6bdeb Compare June 21, 2026 01:10
@soralit
soralit merged commit 0884de4 into KeystoneHQ:master Jun 24, 2026
2 checks passed
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.

2 participants