Skip to content

Wallet connect multi chain support - #4359

Open
Tomasvrba wants to merge 11 commits into
BitBoxSwiss:masterfrom
Tomasvrba:wc-update-2
Open

Wallet connect multi chain support#4359
Tomasvrba wants to merge 11 commits into
BitBoxSwiss:masterfrom
Tomasvrba:wc-update-2

Conversation

@Tomasvrba

@Tomasvrba Tomasvrba commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR adds WalletConnect support for multiple EVM networks:

  • Ethereum
  • optimism
  • BNB Smart Chain
  • Gnosis
  • Polygon
  • HyperEVM
  • Base
  • Arbitrum
  • Ethereum Sepolia

The BitBoxApp now:

  • Handles required and optional permissions requested by dApps.
  • Shows the requested networks with their names and icons.
  • Supports read-only WalletConnect sessions.
  • Rejects connection requests that require unsupported features.
  • Uses the correct network when preparing, signing, and broadcasting
    transactions.
  • Keeps pending transactions from different networks separate.

This depends on #4267 but would be nice to get into the next release. Only the top 3 commits are for this PR.

Update WalletKit to the final Apache-2.0 release and align Core,
Types, and Utils with its 2.21.7 dependency set.

Declare directly imported packages and remove the unused direct
jsonrpc-types dependency.

Override viem's exact ws 8.18.2 dependency with 8.21.0 to include
the fixes for GHSA-58qx-3vcg-4xpx and GHSA-96hv-2xvq-fx4p.
Keep the override until the pinned WalletConnect graph provides a
fixed ws release.
Display unexpected pairing errors using the correct message field.

Remove the unused malformed connection status so the type reflects
the states the pairing flow can actually enter.
Require an explicit non-zero request chain ID, forward it unchanged for typed-data signing,
and reject conflicting transaction chain IDs or unsupported input aliases.
This prevents omitted values from becoming chain zero and keeps the authorized request chain
authoritative before signing.
Validate WalletConnect chains, methods, approved accounts, and method-specific
parameters before opening the signing dialog, returning one protocol-correct JSON-RPC
response on every path. Use the authorized request chain for backend signing so malformed
or unauthorized requests cannot reach the signer.
Track one active request, block duplicate actions and replacement requests,
and make the dialog non-dismissible during device confirmation.
Clean up delayed success state on unmount so each request has one stable UI lifecycle and one response.
Build approved namespaces from shared WalletConnect capabilities.
Handle unsupported proposals and rejection failures safely.
WalletConnect advertises several EVM networks, but the backend
previously accepted transactions only on the account's native network.
This caused requests for networks such as Optimism, Base, and Arbitrum
to fail.

Use the network requested by WalletConnect when getting transaction
data, signing, and broadcasting. Keep pending transactions from
different networks separate to prevent incorrect nonce selection.

Reuse the normal Ethereum signing path instead of maintaining a
separate WalletConnect signer. Keep the underlying transaction code
independent of WalletConnect so it can also support native multichain
features later.
- Centralize metadata for the ten EVM networks supported by the backend.
- Derive WalletConnect chain entries from numeric IDs.
- Render the registry's SVG assets in pairing and signing requests.
@Tomasvrba
Tomasvrba requested review from benma and thisconnect August 25, 2026 20:53
@Tomasvrba
Tomasvrba requested a review from a team as a code owner August 25, 2026 20:53
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