{"eip":7846,"title":"Wallet Connection API","description":"Adds JSON-RPC method for requesting wallet connection with modular capabilities.","authors":["Conner Swenberg (@ilikesymmetry)","Jake Moxey (@jxom)","Lukas Rosario (@lukasrosario)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-12-15","discussionsTo":"https://ethereum-magicians.org/t/erc-7846-wallet-connection-api/22245","repo":"ERCs","label":"ERC-7846","officialUrl":"https://eips.ethereum.org/EIPS/eip-7846","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7846.md","url":"https://eips.huatuo.xyz/eip-7846/","tldr":{"en":"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.","ja":"wallet_connect JSON-RPC メソッドを追加する。アカウントを接続し、Sign-In with Ethereum の署名などの追加の機能（capabilities）を、1 回のウォレット操作で返す。","ko":"wallet_connect JSON-RPC 메서드를 추가해, 한 번의 지갑 상호작용으로 계정을 연결하고 Sign-In with Ethereum 서명 같은 추가 기능(capabilities)을 함께 반환한다.","zh":"新增 wallet_connect JSON-RPC 方法，在一次钱包交互中连接账户并返回额外的能力（capabilities），例如 Sign-In with Ethereum 签名。"},"tags":["wallet","json-rpc","siwe","connection","ux"],"explainers":{"en":{"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"],"related":[5792,4361,1193,191],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7846/","markdown":"## What problem does it solve?\n\nLogging 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).\n\nERC-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.\n\n## How it works\n\n**`wallet_connect`** takes one object:\n\n- `version`: the method version (e.g. `\"1\"`).\n- `capabilities` (optional): a map of capability name to parameters.\n\nIt 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.\n\n**`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`.\n\nThe ERC defines one capability up front, **`signInWithEthereum`**, based on [ERC-4361](/eip-4361/):\n\n- Request fields are the SIWE fields in camelCase: `nonce` and `chainId` are required; `domain`, `uri`, `issuedAt`, `version` and others are optional and default sensibly.\n- The wallet returns the formatted SIWE `message` and a `signature` over its [EIP-191](/eip-191/) `personal_sign` hash.\n- The address in the message must match the connected account, and the app should check that the message matches what it asked for.\n\n## Sample code\n\nConnect and sign in at once through an [EIP-1193](/eip-1193/) provider, then verify (ethers v6):\n\n```ts\nimport { verifyMessage } from \"ethers\";\n\nconst nonce = crypto.randomUUID().replace(/-/g, \"\"); // server-issued in practice\n\nconst { accounts } = await window.ethereum.request({\n  method: \"wallet_connect\",\n  params: [{\n    version: \"1\",\n    capabilities: {\n      signInWithEthereum: { nonce, chainId: \"0x1\" },\n    },\n  }],\n});\n\nconst [{ address, capabilities }] = accounts;\nconst { message, signature } = capabilities.signInWithEthereum;\n\n// Check on your backend: signer, nonce, domain and expiry\nconst signer = verifyMessage(message, signature);\nif (signer.toLowerCase() !== address.toLowerCase()) throw new Error(\"bad SIWE signature\");\nif (!message.includes(`Nonce: ${nonce}`)) throw new Error(\"nonce mismatch\");\n```\n\n## Things to know\n\n- **Status: Draft.** Wallet support varies, so fall back to `eth_requestAccounts` plus `personal_sign` when the method is not available.\n- `verifyMessage` only works for EOAs. Smart-contract wallets need ERC-1271 verification, ideally via a full SIWE library.\n- The usual SIWE rules still apply: issue nonces server-side, check domain, URI and expiry, and never accept a message you did not request.\n- New capabilities can be added over time; the spec warns that combining them needs care to avoid unexpected interactions.\n"},"ja":{"lang":"ja","tldr":"wallet_connect JSON-RPC メソッドを追加する。アカウントを接続し、Sign-In with Ethereum の署名などの追加の機能（capabilities）を、1 回のウォレット操作で返す。","tags":["wallet","json-rpc","siwe","connection","ux"],"related":[5792,4361,1193,191],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7846/","markdown":"## 何を解決するのか\n\nウォレットで dapp にログインするには、通常 2 回の確認が必要です。接続のための `eth_requestAccounts` と、Sign-In with Ethereum メッセージに署名するための `personal_sign` です。どちらのメソッドも拡張できないため、接続時にさらに多くを（認証、プロフィールデータ、権限など）求めるきれいな方法がありません。\n\nERC-7846 は、**capabilities** を中心に据えた接続メソッド `wallet_connect` を導入します。これは [ERC-5792](/eip-5792/) で使われているものと同じモジュール式の考え方です。接続と認証が 1 回のやり取りになります。\n\n## 仕組み\n\n**`wallet_connect`** は 1 つのオブジェクトを受け取ります。\n\n- `version`: メソッドのバージョン（例: `\"1\"`）。\n- `capabilities`（任意）: capability 名からパラメーターへのマップ。\n\n戻り値は `accounts` で、`{ address, capabilities }` の配列です。各アカウントには、そのアカウントに許可された capability の結果が付きます。複数のアカウントを返せるため、`eth_requestAccounts` との互換性が保たれます。ほとんどのアプリは最初のものを使います。\n\n**`wallet_disconnect`** は、ウォレットに接続を切るよう求めます。ウォレットは、アカウントへのアクセスと、`wallet_connect` を通じて許可された capability へのアクセスを取り消すべきです。\n\nこの ERC は、最初から 1 つの capability、[ERC-4361](/eip-4361/) に基づく **`signInWithEthereum`** を定義しています。\n\n- リクエストのフィールドは、SIWE のフィールドを camelCase にしたものです。`nonce` と `chainId` は必須で、`domain`、`uri`、`issuedAt`、`version` などは任意で、適切なデフォルトが使われます。\n- ウォレットは、整形された SIWE の `message` と、その [EIP-191](/eip-191/) `personal_sign` ハッシュに対する `signature` を返します。\n- メッセージ内のアドレスは接続されたアカウントと一致しなければならず、アプリは、メッセージが自分の要求した内容と一致することを確認するべきです。\n\n## サンプルコード\n\n[EIP-1193](/eip-1193/) プロバイダー経由で接続とサインインを一度に行い、その後に検証する例（ethers v6）:\n\n```ts\nimport { verifyMessage } from \"ethers\";\n\nconst nonce = crypto.randomUUID().replace(/-/g, \"\"); // server-issued in practice\n\nconst { accounts } = await window.ethereum.request({\n  method: \"wallet_connect\",\n  params: [{\n    version: \"1\",\n    capabilities: {\n      signInWithEthereum: { nonce, chainId: \"0x1\" },\n    },\n  }],\n});\n\nconst [{ address, capabilities }] = accounts;\nconst { message, signature } = capabilities.signInWithEthereum;\n\n// Check on your backend: signer, nonce, domain and expiry\nconst signer = verifyMessage(message, signature);\nif (signer.toLowerCase() !== address.toLowerCase()) throw new Error(\"bad SIWE signature\");\nif (!message.includes(`Nonce: ${nonce}`)) throw new Error(\"nonce mismatch\");\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** ウォレットの対応状況はまちまちなので、このメソッドが使えない場合は `eth_requestAccounts` と `personal_sign` にフォールバックしてください。\n- `verifyMessage` が使えるのは EOA だけです。スマートコントラクトウォレットには ERC-1271 の検証が必要で、できれば完全な SIWE ライブラリを使ってください。\n- SIWE の通常のルールは引き続き適用されます。nonce はサーバー側で発行し、ドメイン、URI、有効期限を確認し、自分が要求していないメッセージは決して受け入れないでください。\n- 新しい capability は時間とともに追加できます。仕様は、予期しない相互作用を避けるため、組み合わせには注意が必要だと警告しています。\n"},"ko":{"lang":"ko","tldr":"wallet_connect JSON-RPC 메서드를 추가해, 한 번의 지갑 상호작용으로 계정을 연결하고 Sign-In with Ethereum 서명 같은 추가 기능(capabilities)을 함께 반환한다.","tags":["wallet","json-rpc","siwe","connection","ux"],"related":[5792,4361,1193,191],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7846/","markdown":"## 어떤 문제를 해결하나요?\n\n지갑으로 dapp에 로그인하려면 보통 확인 창이 두 번 필요합니다. 연결을 위한 `eth_requestAccounts`, 그리고 Sign-In with Ethereum 메시지에 서명하기 위한 `personal_sign`입니다. 두 메서드 모두 확장할 수 없어서, 연결하는 동안 더 많은 것(인증, 프로필 데이터, 권한)을 요청할 깔끔한 방법이 없습니다.\n\nERC-7846은 **capabilities**를 중심으로 만든 연결 메서드 `wallet_connect`를 도입합니다. [ERC-5792](/eip-5792/)에서 쓰이는 것과 같은 모듈식 아이디어입니다. 연결과 인증이 한 번의 상호작용으로 합쳐집니다.\n\n## 어떻게 동작하나요?\n\n**`wallet_connect`**는 객체 하나를 받습니다.\n\n- `version`: 메서드 버전(예: `\"1\"`).\n- `capabilities`(선택): capability 이름에서 파라미터로의 맵.\n\n반환값은 `accounts`로, `{ address, capabilities }`의 배열입니다. 각 계정에는 그 계정에 허용된 capability의 결과가 담깁니다. 여러 계정을 반환하므로 `eth_requestAccounts`와 호환되며, 대부분의 앱은 첫 번째를 사용합니다.\n\n**`wallet_disconnect`**는 지갑에 연결을 끊도록 요청합니다. 지갑은 해당 계정과 `wallet_connect`로 허용된 모든 capability에 대한 접근을 취소해야 합니다.\n\n이 ERC는 처음부터 하나의 capability, 즉 [ERC-4361](/eip-4361/) 기반의 **`signInWithEthereum`**을 정의합니다.\n\n- 요청 필드는 SIWE 필드를 camelCase로 쓴 것입니다. `nonce`와 `chainId`는 필수이고, `domain`, `uri`, `issuedAt`, `version` 등은 선택이며 적절한 기본값이 쓰입니다.\n- 지갑은 형식이 갖춰진 SIWE `message`와 그 [EIP-191](/eip-191/) `personal_sign` 해시에 대한 `signature`를 반환합니다.\n- 메시지 안의 주소는 연결된 계정과 일치해야 하며, 앱은 메시지가 자신이 요청한 내용과 일치하는지 확인해야 합니다.\n\n## 샘플 코드\n\n[EIP-1193](/eip-1193/) provider로 연결과 로그인을 한 번에 하고 이어서 검증하기(ethers v6):\n\n```ts\nimport { verifyMessage } from \"ethers\";\n\nconst nonce = crypto.randomUUID().replace(/-/g, \"\"); // server-issued in practice\n\nconst { accounts } = await window.ethereum.request({\n  method: \"wallet_connect\",\n  params: [{\n    version: \"1\",\n    capabilities: {\n      signInWithEthereum: { nonce, chainId: \"0x1\" },\n    },\n  }],\n});\n\nconst [{ address, capabilities }] = accounts;\nconst { message, signature } = capabilities.signInWithEthereum;\n\n// Check on your backend: signer, nonce, domain and expiry\nconst signer = verifyMessage(message, signature);\nif (signer.toLowerCase() !== address.toLowerCase()) throw new Error(\"bad SIWE signature\");\nif (!message.includes(`Nonce: ${nonce}`)) throw new Error(\"nonce mismatch\");\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 지갑마다 지원 여부가 다르므로, 이 메서드를 쓸 수 없으면 `eth_requestAccounts`와 `personal_sign`으로 폴백하세요.\n- `verifyMessage`는 EOA에서만 동작합니다. 스마트 컨트랙트 지갑은 ERC-1271 검증이 필요하며, 가능하면 완전한 SIWE 라이브러리를 쓰는 것이 좋습니다.\n- SIWE의 일반 규칙은 그대로 적용됩니다. nonce는 서버에서 발급하고, 도메인, URI, 만료를 확인하며, 요청하지 않은 메시지는 절대 받아들이지 마세요.\n- 새로운 capability는 시간이 지나며 추가될 수 있습니다. 명세는 예기치 않은 상호작용을 피하려면 이들을 조합할 때 주의가 필요하다고 경고합니다.\n"},"zh":{"lang":"zh","tldr":"新增 wallet_connect JSON-RPC 方法，在一次钱包交互中连接账户并返回额外的能力（capabilities），例如 Sign-In with Ethereum 签名。","tags":["wallet","json-rpc","siwe","connection","ux"],"related":[5792,4361,1193,191],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7846/","markdown":"## 它解决什么问题？\n\n用钱包登录 dapp 通常需要两次弹窗：先用 `eth_requestAccounts` 连接，再用 `personal_sign` 对 Sign-In with Ethereum 消息签名。这两个方法都不可扩展，所以在连接时没有干净的办法去请求更多内容（认证、个人资料数据、权限）。\n\nERC-7846 引入了 `wallet_connect`，这是一个围绕 **capabilities（能力）**构建的连接方法，与 [ERC-5792](/eip-5792/) 采用的模块化思路相同。连接与认证合并成一次交互。\n\n## 它如何运作\n\n**`wallet_connect`** 接收一个对象：\n\n- `version`：方法版本（例如 `\"1\"`）。\n- `capabilities`（可选）：从能力名称到参数的映射。\n\n它返回 `accounts`，即 `{ address, capabilities }` 的数组，每个账户都附带为其授予的各项能力的结果。返回多个账户可以与 `eth_requestAccounts` 保持兼容；大多数应用会使用第一个。\n\n**`wallet_disconnect`** 请求钱包断开连接。钱包应当撤销对这些账户以及通过 `wallet_connect` 授予的任何能力的访问权限。\n\n该 ERC 一开始就定义了一个能力，即基于 [ERC-4361](/eip-4361/) 的 **`signInWithEthereum`**：\n\n- 请求字段是以 camelCase 书写的 SIWE 字段：`nonce` 和 `chainId` 必填；`domain`、`uri`、`issuedAt`、`version` 等可选，并有合理的默认值。\n- 钱包返回格式化后的 SIWE `message`，以及对其 [EIP-191](/eip-191/) `personal_sign` 哈希的 `signature`。\n- 消息中的地址必须与已连接的账户一致，应用还应检查消息是否与自己所请求的一致。\n\n## 示例代码\n\n通过 [EIP-1193](/eip-1193/) provider 一次完成连接和登录，然后验证（ethers v6）：\n\n```ts\nimport { verifyMessage } from \"ethers\";\n\nconst nonce = crypto.randomUUID().replace(/-/g, \"\"); // server-issued in practice\n\nconst { accounts } = await window.ethereum.request({\n  method: \"wallet_connect\",\n  params: [{\n    version: \"1\",\n    capabilities: {\n      signInWithEthereum: { nonce, chainId: \"0x1\" },\n    },\n  }],\n});\n\nconst [{ address, capabilities }] = accounts;\nconst { message, signature } = capabilities.signInWithEthereum;\n\n// Check on your backend: signer, nonce, domain and expiry\nconst signer = verifyMessage(message, signature);\nif (signer.toLowerCase() !== address.toLowerCase()) throw new Error(\"bad SIWE signature\");\nif (!message.includes(`Nonce: ${nonce}`)) throw new Error(\"nonce mismatch\");\n```\n\n## 需要注意\n\n- **状态：Draft。**各钱包的支持情况不一，因此当该方法不可用时，请回退到 `eth_requestAccounts` 加 `personal_sign`。\n- `verifyMessage` 只适用于 EOA。智能合约钱包需要 ERC-1271 验证，最好通过完整的 SIWE 库来完成。\n- SIWE 的常规规则依然适用：在服务端签发 nonce，检查域名、URI 和过期时间，并且绝不接受你没有请求过的消息。\n- 新的能力可以随时间添加；规范警告说，把它们组合使用时需要谨慎，以避免意外的相互影响。\n"}}}
