EIPs

EIP-2255 — Wallet permissions

eips.ethereum.org/EIPS/eip-2255

A permission system layered on top of EIP-1193. A dapp asks the wallet for a capability (typically eth_accounts); the wallet returns a Permission object recording what was granted and any caveats.

import {
  wallet_requestPermissions,
  wallet_getPermissions,
} from "@ethernauta/eip/2255";
import type { Provider } from "@ethernauta/eip/1193";
import { create_provider, encode_chain_id } from "@ethernauta/transport";
import { eip155_1 } from "@ethernauta/chain/eip155-1";

const CHAIN_ID = encode_chain_id({ namespace: "eip155", reference: eip155_1.chainId });
declare const provider: Provider; // see /eips/6963 for discovery
const { signer } = create_provider(provider);

const permissions = await wallet_requestPermissions([{ eth_accounts: {} }])(
  signer({ chain_id: CHAIN_ID }),
);
void permissions;

const current = await wallet_getPermissions()(
  signer({ chain_id: CHAIN_ID }),
);
void current;

Surface

ExportTypePurpose
wallet_request_permissionsSignable<Permission[]>Open the permission prompt.
wallet_get_permissionsSignable<Permission[]>Read current permissions.
Permission, Caveat, RequestedPermissionstypesInferred from schemas.
PermissionSchema, CaveatSchema, RequestedPermissionSchemaValibot schemasValidate wire shapes.

Where it’s used

  • eth_requestAccounts (EIP-1102) creates an eth_accounts permission as a side effect.
  • A dapp can revoke its own access by calling wallet_requestPermissions with restricting caveats.
  • A wallet UI typically exposes “manage connections” — that’s just reading + mutating the permission set.

See also