feat(zcash): add device_version to ZcashAccounts#127
Open
czarcas7ic wants to merge 1 commit intoKeystoneHQ:masterfrom
Open
feat(zcash): add device_version to ZcashAccounts#127czarcas7ic wants to merge 1 commit intoKeystoneHQ:masterfrom
czarcas7ic wants to merge 1 commit intoKeystoneHQ:masterfrom
Conversation
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.
283817d to
5e10683
Compare
This was referenced Apr 12, 2026
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.
Closes KeystoneHQ/keystone3-firmware#2147
Summary
device_versionfield toZcashAccountsCBOR encodingCryptoMultiAccounts.device_versionwhich other chains already useNone), old wallets ignore unknown CBOR map keysChanges
ur-registry: Replaceimpl_template_struct!macro with manual struct definition to support optional fields. Add CBOR key3fordevice_version.ZcashAccountsstays inimpl_cbor_bytes!forTryFrom/TryInto(matchesCryptoMultiAccountspattern).ur-registry-ffi: Passdevice_versionthrough JSON FFI layerMerge 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