# Sepolia WalletConnect demo

The page deliberately contains two independent roles:

| Panel | Protocol role | Implementation |
| --- | --- | --- |
| Lan Wallet pairing desk | Wallet | Reown `@reown/walletkit`; receives a `wc:` URI, reviews proposals/requests, and responds on behalf of the local account |
| Sepolia test dapp | Dapp | Wagmi's `walletConnect` connector; creates the QR/URI and requests signing/transactions |

Adding Wagmi's connector alone would not create a wallet. WalletKit is the wallet-side protocol client; the Rust bridge remains the signing boundary.

## Setup

1. Create a public project ID in the [Reown Dashboard](https://dashboard.reown.com/).
2. Copy `demo/.env.example` to ignored `demo/.env.local`, then set `VITE_REOWN_PROJECT_ID`. `VITE_SEPOLIA_RPC_URL` is optional and must point to Ethereum Sepolia (chain ID `11155111`).
3. Start the Rust bridge with a Sepolia RPC and `--allowed-origin http://127.0.0.1:5173`.
4. Run `pnpm install --frozen-lockfile && pnpm run dev` in `demo/`.
5. Authorize the bridge in the wallet panel. Start a WalletConnect connection in the dapp panel, then scan or paste the URI on the wallet side.
6. Review the dapp identity, verification status, requested namespaces, chains, methods, and events. Approving builds the namespace with only `eip155:11155111`, the active account, `personal_sign`, `eth_signTypedData_v4`, `eth_sendTransaction`, `accountsChanged`, and `chainChanged`.
7. A request must be approved in the wallet view and again at the Rust CLI. Either rejection returns `4001` to the dapp.

The camera scanner uses the browser camera permission and recognizes WalletConnect `wc:` QR values. Paste-URI remains available for browsers without camera access and same-desktop testing.

## Demonstrated flows

- Connect/disconnect and inspect account/network.
- Read the Sepolia balance through Wagmi's configured public transport.
- Request `personal_sign` through the WalletConnect session and local bridge.
- Request a small Sepolia-only self-transfer. This is clearly marked as a live write, targets only the connected account, and has no automatic submission path.

The demo does not support mainnet, arbitrary recipient input, raw transaction signing, raw hash signing, chain addition, or chain switching.

## Upstream references

- [Reown WalletKit package usage](https://github.com/reown-com/reown-walletkit-js/tree/main/packages/walletkit)
- [Reown wallet-side web usage](https://github.com/WalletConnect/walletconnect-docs/blob/main/docs/walletkit/web/usage.mdx)
- [Wagmi WalletConnect connector](https://wagmi.sh/react/api/connectors/walletConnect)
- [Wagmi connect-wallet guide](https://wagmi.sh/react/guides/connect-wallet)
