Skip to content

feat(zcash): add device_version to ZcashAccounts#127

Open
czarcas7ic wants to merge 1 commit intoKeystoneHQ:masterfrom
valargroup:adam/zcash-accounts-device-version
Open

feat(zcash): add device_version to ZcashAccounts#127
czarcas7ic wants to merge 1 commit intoKeystoneHQ:masterfrom
valargroup:adam/zcash-accounts-device-version

Conversation

@czarcas7ic
Copy link
Copy Markdown

@czarcas7ic czarcas7ic commented Apr 12, 2026

Closes KeystoneHQ/keystone3-firmware#2147

Summary

  • Add optional device_version field to ZcashAccounts CBOR encoding
  • Mirrors CryptoMultiAccounts.device_version which other chains already use
  • Backwards compatible: old firmware omits the field (decoded as None), old wallets ignore unknown CBOR map keys
  • Includes tests for encode/decode with and without the field

Changes

  • ur-registry: Replace impl_template_struct! macro with manual struct definition to support optional fields. Add CBOR key 3 for device_version. ZcashAccounts stays in impl_cbor_bytes! for TryFrom/TryInto (matches CryptoMultiAccounts pattern).
  • ur-registry-ffi: Pass device_version through JSON FFI layer

Merge order

We merge this PR first, then KeystoneHQ/keystone3-firmware#2138 and KeystoneHQ/keystone-sdk-ios#39 can update their references to the new tag

Testing

Using all three device version PRs I have opened

#127
KeystoneHQ/keystone-sdk-ios#39
KeystoneHQ/keystone3-firmware#2138

I tested against a zodl app that prints a debug line when connecting the keystone. We see that the keystone version is correctly communicated when connecting the hardware wallet:

debug-show-version-when-connected.mp4

Docs

I wrote up a short doc on how we will use QR pairing and data added when responding with the signed PCZT in order to achieve version negotiation for the upcoming quantum recoverability feature in zcash

https://hackmd.io/@valargroup/H1pGeaFh-l

Add an optional device_version field to the ZcashAccounts CBOR
encoding, mirroring what CryptoMultiAccounts already provides for
other chains (MetaMask, OKX, Bitget, etc.). This lets wallets learn
the Keystone firmware version at connection time.

Backwards compatible: old firmware omits the field (decoded as None),
new firmware includes it. Old wallets ignore unknown CBOR map keys.
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.

feat(zcash): surface firmware version in ZcashAccounts pairing QR

1 participant