Skip to content

AarenWang/switch-wallet-plugin

Repository files navigation

DevMultiWallet (Switch Wallet Plugin)

A developer-first browser extension wallet for blockchain testing with multiple seed phrases and multiple derived accounts in one plugin.

1. Mission and Scope

This project is designed for engineering teams testing blockchain products across multiple roles, seed phrases, and addresses.

  • Problem: switching between different extension wallets or re-importing different seed phrases is slow and error-prone.
  • Core value: manage multiple seed phrases and multiple derived addresses in one wallet to improve test efficiency.
  • Data principle: the project does not collect seed phrases or private keys.
  • Local recovery principle: seed phrases/private keys can be recovered locally for debugging and environment rebuild.
  • Usage boundary: this wallet is for testing/validation only, not for managing production assets.

2. Current Feature Set

Multi-role and multi-address wallet model

  • Import multiple independent mnemonic roles.
  • Derive multiple accounts per mnemonic using incremental index (#0, #1, #2, ...).
  • Derivation path follows m/44'/60'/0'/0/x (BIP-44 EVM standard).
  • One-click switch between roles and derived accounts.

Main wallet tabs

  • Accounts:
    • Role list with collapse/expand.
    • Per-role account list with index, address, balance, and active marker.
    • + Derive to create the next account index.
  • Assets:
    • Native ETH balance card.
    • Send entry for transfer flow.
  • Activity:
    • Unified activity timeline with filters (All, Tx, Sign).
    • Shows outgoing and incoming records.
  • Networks:
    • Add/edit custom RPC networks.
    • Health status checks for configured networks.
    • Watchlist token management moved into Edit Network.
    • Danger zone: clear all local sensitive data.
  • Security:
    • Session lock (password + timeout + lock now/disable lock).
    • Allowed origin management (add/remove/revoke all).

Send flow and confirmation UX

  • Two-step flow: Form -> Preview/Confirm -> Broadcast.
  • Confirmation panel includes:
    • Transaction Type
    • Network Fee
    • Wallet Account
    • Recipient Address
    • Amount
    • Advanced section: Nonce (optional), Data, Gas Limit

dApp compatibility and permissions

  • EIP-1193 provider behavior and request pipeline.
  • EIP-6963 multi-provider discovery support.
  • Origin-based authorization and permission revoke support.
  • Structured provider errors (code/message/data).

History sync coverage

  • Outgoing ETH/ERC20 transfers.
  • Incoming ETH transfers (block scan).
  • Incoming ERC20 transfers (Transfer log scan).
  • Signature records (eth_sign, personal_sign, eth_signTypedData*).

Safe signing compatibility

  • Compatible with Safe typed-data signing format used by the main signing-service.
  • Includes test coverage for Safe EIP-712 typed-data signature recovery and normalized v value.

3. Security Notes

  • Test wallet only. Do not import production seed phrases or private keys.
  • Wallet data is stored locally in chrome.storage.local.
  • Mnemonic storage uses reversible local encoding for testing/debug convenience, not production-grade custody encryption.
  • Use the built-in local data wipe capability after testing.

4. Tech Stack

  • React + TypeScript
  • Vite + CRXJS (Manifest V3)
  • Viem
  • Tailwind CSS
  • Chrome Extension APIs (storage, runtime, content script + background)

5. Quick Start

Requirements

  • Node.js 18+
  • pnpm

Install dependencies

cd switch-wallet-plugin
pnpm install

Build extension

pnpm build

Load in Chrome

  1. Open chrome://extensions/.
  2. Enable Developer mode.
  3. Click Load unpacked.
  4. Select switch-wallet-plugin/dist.

6. Development Commands

cd switch-wallet-plugin
pnpm dev
pnpm build
pnpm test

7. Project Structure

switch-wallet-plugin/
  src/
    background/      # provider request handling, signing, permissions
    content/         # page bridge, approval, request policy
    popup/           # extension popup UI
    utils/           # storage, wallet derivation, security helpers
    types/           # shared types and provider error model
  tests/             # node:test suites (permissions, multi-address, safe signing)
  docs/              # PRD, review notes, UI workflow

8. Limitations

  • This is not a production wallet and does not target institutional custody/security standards.
  • No E2E browser automation suite is included yet.
  • Some advanced wallet ecosystem features are intentionally out of scope for the testing-first objective.

About

manage multiple seed phrases and multiple derived addresses in one wallet to improve test efficiency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors