---
eip: 2255
label: EIP-2255
title: Wallet Permissions System
status: Final
type: Standards Track
category: Interface
created: 2019-08-22
requires: 1193
official: https://eips.ethereum.org/EIPS/eip-2255
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2255.md
canonical: https://eips.huatuo.xyz/eip-2255/
lang: en
tldr: Adds wallet_requestPermissions and wallet_getPermissions to the wallet provider API, so a dapp asks once for named permissions (like seeing your accounts) instead of triggering a prompt for every action.
tags: [wallet, permissions, rpc, provider, interface]
---

# EIP-2255: Wallet Permissions System

> An interface to restrict access to sensitive methods

**TL;DR:** Adds wallet_requestPermissions and wallet_getPermissions to the wallet provider API, so a dapp asks once for named permissions (like seeing your accounts) instead of triggering a prompt for every action.

## What problem does it solve?

Wallets sit between untrusted websites and the user's keys. The safe default is to prompt for everything, but that makes onboarding a string of popups: reveal your address, switch network, sign a challenge, approve a token, send a transaction.

Web users know a better pattern from OAuth ("Sign in with ..."): one screen listing what the site wants, which the user can approve, reject, or narrow. EIP-2255 brings that model to wallets with a small, generic permissions API.

## How it works

Two methods on the [EIP-1193](/eip-1193/) provider:

**`wallet_requestPermissions`** takes one object mapping method names to caveat objects:

```ts
interface PermissionRequest {
  [methodName: string]: { [caveatName: string]: any };
}
```

The wallet shows a prompt. If the user approves, it returns an array of `{ parentCapability, date? }`. If the user rejects, it throws an error with code `4001` (user rejected, per EIP-1193).

**`wallet_getPermissions`** takes no parameters and returns the permissions the current site holds (empty by default):

```ts
interface Permission {
  invoker: string;           // origin of the dapp, e.g. "https://app.example"
  parentCapability: string;  // the permitted method, e.g. "eth_accounts"
  caveats: { type: string; value: any }[]; // restrictions on that permission
}
```

Calls to a restricted method fail until the matching permission has been granted. **Caveats** let a permission be attenuated; for example, a site could ask only for accounts that support a given signing method, or the user could add an expiry.

## Sample code

Asking for account access explicitly and checking what was granted (browser, EIP-1193 provider):

```ts
const provider = (window as any).ethereum;

try {
  await provider.request({
    method: "wallet_requestPermissions",
    params: [{ eth_accounts: {} }],
  });
} catch (err: any) {
  if (err.code === 4001) console.log("User rejected the request");
  else throw err;
}

const permissions = await provider.request({ method: "wallet_getPermissions" });
const hasAccounts = permissions.some((p: any) => p.parentCapability === "eth_accounts");

if (hasAccounts) {
  const accounts = await provider.request({ method: "eth_accounts" });
  console.log(accounts);
}
```

## Things to know

- Status is **Final**. MetaMask supports both methods; other wallets vary, so feature-detect and fall back to `eth_requestAccounts`.
- The EIP defines the request and response shapes, not which permissions or caveats exist. Those are wallet-specific.
- When a wallet shows the site's icon, it should be careful about fetching arbitrary URLs (the spec warns about server-side request forgery).
- [ERC-7715](/eip-7715/) (Draft) builds on this idea for richer, scoped permissions such as session keys. Related wallet RPCs include [EIP-3085](/eip-3085/) and [EIP-3326](/eip-3326/) for adding and switching chains.


---

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