fix(realunit): accept registration signatures over a chainId-extended EIP-712 domain#4354
Draft
Blume1977 wants to merge 1 commit into
Draft
fix(realunit): accept registration signatures over a chainId-extended EIP-712 domain#4354Blume1977 wants to merge 1 commit into
Blume1977 wants to merge 1 commit into
Conversation
… EIP-712 domain The BitBox02 firmware refuses to sign typed data whose EIP712Domain has no chainId (device error: 'typed data has no chain ID'), so BitBox users cannot complete the RealUnit registration at all. The app-side pair PR makes hardware wallets sign with the chainId-extended domain; this change accepts both domain variants during verification. Legacy signatures (software wallets, older apps) stay valid unchanged. chainId source mirrors what the app receives as apiConfig.asset.chainId (REALU token chain: Ethereum on PRD, Sepolia on DEV).
|
14 tasks
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.
Problem
BitBox users cannot complete the RealUnit registration: on submit, the BitBox02 (Nova) rejects the signing request with "typed data has no chain ID" shown on the device. The firmware requires a
chainIdin the EIP712Domain, but both the app's signing payload and our verification use the chainId-less domain{ name: 'RealUnitUser', version: '1' }. Software wallets sign the payload regardless, which is why this never surfaced before. First affected customer: userData 412822 (23.07.).Change
resolveSignedRegistrationMessagenow accepts signatures over both domain variants:{ name, version }(all existing registrations, software wallets){ name, version, chainId }with the REALU token chain (Ethereum on PRD, Sepolia on DEV/LOC — same value the app receives asapiConfig.asset.chainId)Verification loops domains inside the existing UTF-8/ASCII transliteration loop. No DTO or forward-payload change.
Pair PR / merge order
Open coordination point (blocking for the app rollout, not for this PR)
Aktionariat re-verifies the registration signature against the payload we forward. If their verification is pinned to the legacy domain, chainId-signed (BitBox) registrations will fail on their side as "Invalid signature" at forward time. This must be confirmed with Aktionariat (structured question via Dani) before the app change ships — the new test documents this dependency explicitly.
Tests