-
Notifications
You must be signed in to change notification settings - Fork 830
Add ERC: Wallet Connection API #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
db3b787
ed25a89
25c662e
a97ac05
21e3bd2
0d97ffe
9053be2
294c5eb
4e4b001
2419fd7
c744ba7
aff00cb
4ce54a0
9ad67aa
b73d125
abd1c9f
713214c
1000612
3e89fa9
d91b259
000b07a
5ac1521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,180 @@ | ||||||
| --- | ||||||
| title: Wallet Connection API | ||||||
| description: Adds JSON-RPC method for requesting wallet connection with modular capabilities. | ||||||
| author: Conner Swenberg (@ilikesymmetry). | ||||||
| discussions-to: https://ethereum-magicians.org/t/erc-xxxx-wallet-connection-api/22245 | ||||||
ilikesymmetry marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| status: Draft | ||||||
| type: Standards Track | ||||||
| category: ERC | ||||||
| created: 2024-12-15 | ||||||
| requires: [ERC-1193](https://eips.ethereum.org/EIPS/eip-1193), [ERC-4361](https://eips.ethereum.org/EIPS/eip-4361), [ERC-5792](https://eips.ethereum.org/EIPS/eip-5792) | ||||||
| --- | ||||||
|
|
||||||
| ## Abstract | ||||||
|
|
||||||
| This ERC introduces a new wallet connection RPC method focused on extensibility. It leverages the modular capabilities approach defined in [ERC-5792](https://eips.ethereum.org/EIPS/eip-5792#wallet_getcapabilities) to streamline connections and authentication into a single interaction. | ||||||
|
|
||||||
| ## Motivation | ||||||
|
|
||||||
| Current standards like `eth_requestAccounts` and `personal_sign` lack extensibility and require separate interactions for connection and authentication. This results in added complexity for both users and developers. A unified and extensible RPC can enhance user experience, simplify development, and prepare for increasing sophistication in wallet interactions. | ||||||
|
|
||||||
| ## Specification | ||||||
|
|
||||||
| ### `wallet_connect` | ||||||
|
|
||||||
| Request the user to connect a single account and optionally confirm chain support and add capabilities. | ||||||
|
|
||||||
| #### RPC Specification | ||||||
|
|
||||||
| For each chain requested by the app, wallets MUST return a mapped capabilities object if the chain is supported and SHOULD return an empty object if no capabilities exist. Wallets MUST NOT return mapped capabilities objects for chains they do not support. If an app does not declare chains they would like to confirm support for, the wallet can return any chains it wishes to declare support for. | ||||||
|
|
||||||
| ```typescript | ||||||
| type WalletConnectParams = [{ | ||||||
| version: string; | ||||||
| chains?: `0x${string}`[]; // optional chain IDs (EIP-155 hex) | ||||||
| capabilities?: Record<string,any>; // optional connection capabilities | ||||||
| }] | ||||||
|
|
||||||
| type WalletConnectResult = { | ||||||
| account: { | ||||||
| address: `0x${string}`; // connected account address | ||||||
| supportedChainsAndCapabilities: Record<`0x${string}`,any>; // chain-specific capabilities, mirrors ERC-5792 wallet_getCapabilities | ||||||
|
||||||
| supportedChainsAndCapabilities: Record<`0x${string}`,any>; // chain-specific capabilities, mirrors ERC-5792 wallet_getCapabilities | |
| chains: `0x${string}`[]; // supported chains |
Should this just be an array of supported chains? Consumers can use wallet_getCapabilities to extract capabilities from a Wallet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent was to remove the need to make a separate wallet_getCapabilities request. That may not be necessary at API layer though because SDKs could do this automatically for apps.
Uh oh!
There was an error while loading. Please reload this page.