Skip to content

Use PCZT-owned Zcash batch messages in UR types - #132

Merged
soralit merged 6 commits into
KeystoneHQ:masterfrom
valargroup:adam/zcash-batch-sig-result-upstream
Jul 13, 2026
Merged

Use PCZT-owned Zcash batch messages in UR types#132
soralit merged 6 commits into
KeystoneHQ:masterfrom
valargroup:adam/zcash-batch-sig-result-upstream

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adds the zcash-batch-sig-result registry type and updates zcash-sign-batch so both carry the PCZT crate’s versioned serialized BatchSignRequest or BatchSignResponse as a single data payload plus an outer request ID. The PCZT-owned encoding remains free of transport correlation fields, while the registry request ID lets applications correlate a signing request with the device response; strict outer CBOR validation and UR round-trip coverage are retained.

Adds `zcash-batch-sig-result` (registry tag 49207), a compact device
response to a Zcash signing batch. Instead of echoing full redacted
PCZTs back (as `zcash-sign-result` does), the device returns only the
produced 64-byte spend-authorization signatures, correlated to each
request message by id and to each spend by pool and action index. The
wallet re-applies them to the PCZTs it already holds, cutting the
response to roughly an eighth of the redacted-PCZT size on the wire.

Like the sibling Zcash registry types this is an egress-only container:
decode enforces CBOR shape (definite-length maps/arrays only), required
fields, duplicate CBOR map keys, and trailing data, then preserves
values for the caller to police (version support, id correlation, pool
validity, action-index bounds, signature length).

Tests cover the encode/decode round trip, a byte-exact golden wire
vector, empty results, unknown-field skipping, indefinite-length and
duplicate-key rejection at every map level, missing-required-key
rejection, and a full UR-level probe_encode/probe_decode round trip,
matching the test matrix of the adjacent zcash-sign-result and
zcash-sign-batch types.
@czarcas7ic
czarcas7ic marked this pull request as ready for review July 3, 2026 04:24
@czarcas7ic
czarcas7ic marked this pull request as draft July 9, 2026 23:40
@czarcas7ic czarcas7ic changed the title Add Zcash compact batch signature result UR type Add Zcash PCZT batch signature result UR type Jul 10, 2026
@czarcas7ic czarcas7ic changed the title Add Zcash PCZT batch signature result UR type Use PCZT-owned Zcash batch messages in UR types Jul 10, 2026
@czarcas7ic
czarcas7ic marked this pull request as ready for review July 10, 2026 12:50
@soralit
soralit merged commit e35a95c into KeystoneHQ:master Jul 13, 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