---
eip: 7846
label: ERC-7846
title: Wallet Connection API
status: Draft
type: Standards Track
category: ERC
created: 2024-12-15
official: https://eips.ethereum.org/EIPS/eip-7846
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7846.md
canonical: https://eips.huatuo.xyz/eip-7846/
lang: en
tldr: Adds a wallet_connect JSON-RPC method that connects accounts and returns extra capabilities, such as a Sign-In with Ethereum signature, in one wallet interaction.
tags: [wallet, json-rpc, siwe, connection, ux]
---

# ERC-7846: Wallet Connection API

> Adds JSON-RPC method for requesting wallet connection with modular capabilities.

**TL;DR:** Adds a wallet_connect JSON-RPC method that connects accounts and returns extra capabilities, such as a Sign-In with Ethereum signature, in one wallet interaction.

## What problem does it solve?

Logging into a dapp with a wallet usually takes two prompts: `eth_requestAccounts` to connect, then `personal_sign` to sign a Sign-In with Ethereum message. Neither method is extensible, so there is no clean way to ask for more during connection (authentication, profile data, permissions).

ERC-7846 introduces `wallet_connect`, a connection method built around **capabilities**, the same modular idea used by [ERC-5792](/eip-5792/). Connecting and authenticating become a single interaction.

## How it works

**`wallet_connect`** takes one object:

- `version`: the method version (e.g. `"1"`).
- `capabilities` (optional): a map of capability name to parameters.

It returns `accounts`, an array of `{ address, capabilities }`, where each account carries the results of the capabilities granted for it. Returning several accounts keeps it compatible with `eth_requestAccounts`; most apps will use the first.

**`wallet_disconnect`** asks the wallet to drop the connection. The wallet should revoke access to the accounts and to any capabilities granted through `wallet_connect`.

The ERC defines one capability up front, **`signInWithEthereum`**, based on [ERC-4361](/eip-4361/):

- Request fields are the SIWE fields in camelCase: `nonce` and `chainId` are required; `domain`, `uri`, `issuedAt`, `version` and others are optional and default sensibly.
- The wallet returns the formatted SIWE `message` and a `signature` over its [EIP-191](/eip-191/) `personal_sign` hash.
- The address in the message must match the connected account, and the app should check that the message matches what it asked for.

## Sample code

Connect and sign in at once through an [EIP-1193](/eip-1193/) provider, then verify (ethers v6):

```ts
import { verifyMessage } from "ethers";

const nonce = crypto.randomUUID().replace(/-/g, ""); // server-issued in practice

const { accounts } = await window.ethereum.request({
  method: "wallet_connect",
  params: [{
    version: "1",
    capabilities: {
      signInWithEthereum: { nonce, chainId: "0x1" },
    },
  }],
});

const [{ address, capabilities }] = accounts;
const { message, signature } = capabilities.signInWithEthereum;

// Check on your backend: signer, nonce, domain and expiry
const signer = verifyMessage(message, signature);
if (signer.toLowerCase() !== address.toLowerCase()) throw new Error("bad SIWE signature");
if (!message.includes(`Nonce: ${nonce}`)) throw new Error("nonce mismatch");
```

## Things to know

- **Status: Draft.** Wallet support varies, so fall back to `eth_requestAccounts` plus `personal_sign` when the method is not available.
- `verifyMessage` only works for EOAs. Smart-contract wallets need ERC-1271 verification, ideally via a full SIWE library.
- The usual SIWE rules still apply: issue nonces server-side, check domain, URI and expiry, and never accept a message you did not request.
- New capabilities can be added over time; the spec warns that combining them needs care to avoid unexpected interactions.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7846
