Skip to content

fix(realunit): accept registration signatures over a chainId-extended EIP-712 domain#4354

Draft
Blume1977 wants to merge 1 commit into
developfrom
fix/realunit-registration-eip712-chainid
Draft

fix(realunit): accept registration signatures over a chainId-extended EIP-712 domain#4354
Blume1977 wants to merge 1 commit into
developfrom
fix/realunit-registration-eip712-chainid

Conversation

@Blume1977

Copy link
Copy Markdown
Collaborator

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 chainId in 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

resolveSignedRegistrationMessage now accepts signatures over both domain variants:

  • legacy: { name, version } (all existing registrations, software wallets)
  • chainId-extended: { name, version, chainId } with the REALU token chain (Ethereum on PRD, Sepolia on DEV/LOC — same value the app receives as apiConfig.asset.chainId)

Verification loops domains inside the existing UTF-8/ASCII transliteration loop. No DTO or forward-payload change.

Pair PR / merge order

  1. This PR first (backward compatible, safe alone — accepts strictly more).
  2. App PR (RealUnitCH/app): hardware wallets sign with the chainId-extended domain; software wallets stay on the legacy domain to avoid any risk with Aktionariat's re-verification of existing flows.

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

  • accepts a BitBox signature over the chainId-extended domain and forwards the signed ASCII fields (incl. proof that legacy-domain recovery does NOT match → Aktionariat dependency documented)
  • rejects a signature over a foreign chainId
  • all existing signature/transliteration tests unchanged: 332/332 green

… 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).
@github-actions

Copy link
Copy Markdown

⚠️ Unverified Commits (1)

The following commits are not signed/verified:

  • 6fa43cf fix(realunit): accept registration signatures over a chainId-extended EIP-712 domain (Blume1977)
How to sign commits
# SSH signing (recommended)
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true

# Re-sign last commit
git commit --amend -S --no-edit
git push --force-with-lease

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.

1 participant