Skip to content

feat: add minimal EIP-1193 browser bridge scaffold - #56

Merged
hellno merged 3 commits into
hellno:mainfrom
0xpantera:refactor/browser-bridge-out-of-mcp
Jun 15, 2026
Merged

feat: add minimal EIP-1193 browser bridge scaffold#56
hellno merged 3 commits into
hellno:mainfrom
0xpantera:refactor/browser-bridge-out-of-mcp

Conversation

@0xpantera

Copy link
Copy Markdown
Collaborator

Summary

  • Move the EIP-1193 browser bridge out of deckard-mcp into a standalone deckard-browser-bridge crate.
  • Add deckard-wallet-client for shared signer client access, chain id config, wallet address lookup, and common failure mapping.
  • Keep MCP focused on the MCP/agent interface while the browser bridge owns loopback HTTP, EIP-1193 request handling, in-memory sessions, and dev/mock account mode.
  • Update docs and repo map to describe MCP and browser bridge as sibling interfaces over shared wallet capabilities.

Why

MCP is an agent interface; the browser bridge is a dapp/browser interface. The spike lived under deckard-mcp because it reused the existing local sidecar/API surface, but keeping HTTP/EIP-1193/browser-extension logic there would make MCP a generic local API server. This refactor gives the browser bridge its own boundary without expanding its API.

How to run

Browser bridge:

cargo run -p deckard-browser-bridge -- --bind 127.0.0.1:8765

Dev/mock mode:

cargo run -p deckard-browser-bridge -- \
  --bind 127.0.0.1:8765 \
  --dev-mock-account 0xdeC0ded0000000000000000000000000000001193

Test dapp:

python3 -m http.server 8777 --directory examples/browser-bridge-dapp

Intentionally experimental / unchanged

  • Extension remains keyless.
  • Sessions remain local/dev/in-memory.
  • No signing methods added.
  • No Kohaku, hardware wallet, or native messaging expansion.
  • Unsupported methods still fail cleanly with EIP-1193-style 4200 errors.

Follow-up cleanup ideas

  • Harden browser transport/origin model.
  • Add explicit approval UI.
  • Add persisted permission registry.
  • Add EIP-6963 provider discovery.
  • Add an integration test for the /rpc HTTP boundary.

Verification

cargo fmt --all --check
just check
cargo test --workspace

All passed locally.

@0xpantera 0xpantera changed the title refactor: move browser bridge out of deckard-mcp feat: add minimal EIP-1193 browser bridge scaffold Jun 15, 2026
@0xpantera 0xpantera self-assigned this Jun 15, 2026
@0xpantera
0xpantera requested a review from hellno June 15, 2026 10:39
@hellno
hellno merged commit 2a4c35d into hellno:main Jun 15, 2026
5 checks passed
hellno added a commit that referenced this pull request Jun 16, 2026
Resolved one conflict in crates/deckard-mcp/src/sidecar.rs: main refactored the sidecar to
delegate chain-probing + the low-level socket request to the new deckard-wallet-client crate
(PR #56 browser-bridge-out-of-mcp). Took main's structure (self.wallet.ensure_chain() + the
trimmed deckard_contract imports), keeping ProposalOrigin since shield()/execute() still tag
their proposes Agent-origin (the #60 feed shows those as "Atlas").

Carried this branch's additive wire change (SignerRequest::Propose gained an `origin` field)
into the merged-in deckard-wallet-client: its connect-time chain probe now passes
`origin: ProposalOrigin::Agent` (was failing to compile without it).

Verified green on the merged tree: cargo fmt --check, clippy -D warnings (default + tray),
full workspace tests, shellcheck.
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.

2 participants