---
eip: 8130
label: EIP-8130
title: Keystore Accounts
status: Draft
type: Standards Track
category: Core
created: 2025-10-14
requires: 170, 1014
official: https://eips.ethereum.org/EIPS/eip-8130
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8130.md
canonical: https://eips.huatuo.xyz/eip-8130/
lang: en
tldr: Defines an on-chain Keystore where each account registers actors (keys) bound to authenticator contracts, each with a scope, expiry and optional policy, so any transaction transport can check who signed and what they may do.
tags: [account-abstraction, keys, session-keys, signatures, core]
---

# EIP-8130: Keystore Accounts

> An onchain keystore that authorizes account actors through authenticator contracts, usable by any transaction transport

**TL;DR:** Defines an on-chain Keystore where each account registers actors (keys) bound to authenticator contracts, each with a scope, expiry and optional policy, so any transaction transport can check who signed and what they may do.

## What problem does it solve?

Account-abstraction designs that let wallet code decide validity force nodes to simulate arbitrary EVM before accepting a transaction. That needs full state access, tracing and reputation systems to limit spam.

EIP-8130 splits authentication from account logic. Instead of running arbitrary wallet code, a node only needs to know **which authenticator** checked the signature and **what the resulting key is allowed to do**. That makes validation predictable, lets nodes accept a small standard set of signature schemes cheaply, and makes accounts crypto-agile: adopting a new algorithm (for example post-quantum) means adding a key that points at a new authenticator, with no migration or address change.

The Keystore is transport-neutral: it can be used through ordinary contract calls, by [ERC-4337](/eip-4337/) accounts, by [EIP-8141](/eip-8141/) frame accounts, and natively by an AA transaction type, whose integration the spec also describes.

## How it works

- **Actors and authenticators.** An account registers **actors** in the Keystore contract. Each actor is bound to an **authenticator**, a contract implementing `authenticate(hash, data)` that returns the signer's `actorId`. Authenticators answer "who signed"; the Keystore answers "what may they do".
- **Canonical set.** secp256k1 (a native sentinel at `address(1)`), P-256, WebAuthn passkeys and a delegate authenticator (account A trusts keys of account B) form a canonical set that native consumers must accept at a fixed cost.
- **One slot per actor.** `actor_config` packs authenticator, a `uint48` expiry in seconds, and a `uint16` scope. Scope `0` means admin (unrestricted); otherwise bits grant `OPERATOR` (send anywhere), `SELF_PAYER`, `SPONSOR_PAYER`, `POLICY` (may only call one manager contract) and `NONCE`.
- **Policies.** A `POLICY` key can only call its configured manager contract, with zero top-level ETH value. The manager checks requests against a stored 32-byte commitment, which is useful for session keys with spend caps.
- **Signed change batches.** Admins authorize, revoke, lock or unlock via `applySignedAccountChanges`, on a **Local** channel (this chain, with an epoch to cancel all unlanded signatures) or a **Multichain** channel (chain id 0, to sync keys across chains).
- **Accounts.** EOAs work unchanged; their own key is an implicit admin. New accounts are created at CREATE2 ([EIP-1014](/eip-1014/)) addresses that commit to the initial actors. Existing smart wallets can call `importAccount()`.
- **Signatures for apps.** `validateSignature` returns `(actorId, scope)`, and an account can build [ERC-1271](/eip-1271/) `isValidSignature` on top of it.

## Sample code

Authorizing a session key that may only use its policy manager and pay its own gas (illustrative; full ABI lives in the canonical repository):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

uint16 constant SELF_PAYER = 0x02;
uint16 constant POLICY     = 0x08;

function buildSessionKeyChange(address P256_AUTHENTICATOR, bytes32 actorId, address manager, bytes32 commitment)
    view returns (IKeystore.AccountChange[] memory changes)
{
    IKeystore.ActorConfig memory cfg = IKeystore.ActorConfig({
        authenticator: P256_AUTHENTICATOR,           // canonical P-256 authenticator
        expiry: uint48(block.timestamp + 30 days),   // seconds; 0 = never
        scope: POLICY | SELF_PAYER                   // never add OPERATOR to a gated key
    });
    bytes memory policyData = abi.encodePacked(manager, commitment); // exactly 52 bytes

    changes = new IKeystore.AccountChange[](1);
    changes[0] = IKeystore.AccountChange({
        changeType: IKeystore.ChangeType.AuthorizeActor,
        payload: abi.encode(actorId, cfg, policyData)
    });
    // Wrap in SignedAccountChanges (channel, sequence, admin signature) and submit:
    // keystore.applySignedAccountChanges(account, signedBatch);
}
```

## Things to know

- **Status: Draft.** `KEYSTORE_ADDRESS` is resolved at deployment and the companion ERC listing canonical authenticators has no number yet. Contract internals are defined in an external canonical repository, which the spec treats as authoritative.
- Never give a policy-gated key the `OPERATOR` bit: `OPERATOR` overrides `POLICY` and makes it unrestricted.
- Setting `manager = account` only works with policy-aware wallet code; a wallet that trusts all self-calls turns that key into a full operator.
- Locking freezes an account's actor set (unlock delay up to about 18 hours), which can earn higher mempool limits for payers.
- Avoid expiry on admin actors; it can break cross-chain change replay.


---

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