---
eip: 6662
label: ERC-6662
title: AA Account Metadata For Authentication
status: Draft
type: Standards Track
category: ERC
created: 2023-03-09
requires: 4337, 4804
official: https://eips.ethereum.org/EIPS/eip-6662
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6662.md
canonical: https://eips.huatuo.xyz/eip-6662/
lang: en
tldr: Draft ERC-4337 extension where a smart account publishes on-chain where its authenticator lives and what request format it accepts, so dApps can ask it to sign without a pre-connected wallet.
tags: [account-abstraction, authentication, erc4337, smart-account, metadata]
---

# ERC-6662: AA Account Metadata For Authentication

> An ERC-4337 extension to define a new authentication model

**TL;DR:** Draft ERC-4337 extension where a smart account publishes on-chain where its authenticator lives and what request format it accepts, so dApps can ask it to sign without a pre-connected wallet.

## What problem does it solve?

Today a dApp only learns about your account after you "connect wallet": the wallet pushes your address to the site, and every signing request goes back through that live connection. With smart contract accounts ([ERC-4337](/eip-4337/)), the thing that actually authorizes operations could be anything: a phone app, a cloud signer, a hardware device. A dApp has no standard way to discover it.

ERC-6662 lets an account publish its authentication details once, on-chain. Given only your account address, a dApp can look up where to send a signing request and in what format.

## How it works

There are three roles:

- **Authenticator**: whatever holds the key that signs your user operations (mobile app, online service, …).
- **Relay**: an online service that forwards requests from dApps to the authenticator. An online authenticator can be its own relay.
- **dApp**: reads the account's metadata and sends an `AuthenticationRequest` to a relay.

The smart account implements `IAccountMetadata` alongside ERC-4337's `IAccount`:

- `getAuthenticationInfo()` returns a list of `AuthenticatorInfo { string[] relayURI; string schema; }`.
- `relayURI` lists relay endpoints; the dApp tries them in order and uses the first that works.
- `schema` is a JSON Schema (inline, or a URI, using [ERC-4804](/eip-4804/) `web3://` if stored on-chain) describing the `AuthenticationRequest`. A typical request carries the entry point address, chain ID, and an unsigned `UserOperation`.

Several `AuthenticatorInfo` entries can enable multisig: each authenticator signs independently and an ERC-4337 aggregator combines the signatures.

## Sample code

The interface and a dApp-side lookup (ethers v6):

```solidity
interface IAccountMetadata {
    struct AuthenticatorInfo {
        string[] relayURI; // where to send requests
        string schema;     // JSON schema or URI for AuthenticationRequest
    }
    function getAuthenticationInfo() external view returns (AuthenticatorInfo[] memory);
}
```

```ts
import { Contract } from "ethers";

const account = new Contract(smartAccountAddr, [
  "function getAuthenticationInfo() view returns ((string[] relayURI, string schema)[])",
], provider);

const [first] = await account.getAuthenticationInfo();
const request = {
  entrypoint: ENTRYPOINT_ADDRESS,
  chainId: "0x1",
  userOp: unsignedUserOp, // ERC-4337 UserOperation without signature
};
for (const uri of first.relayURI) {
  const res = await fetch(uri, { method: "POST", body: JSON.stringify(request) });
  if (res.ok) break; // first working relay wins
}
```

## Things to know

- **Status: Draft.** No relay protocol, transport or authentication of the dApp itself is standardized; the schema is account-defined.
- Relays can see requests. The spec recommends end-to-end encryption, e.g. JWE, with the content key encrypted to the signer, so relays cannot read or front-run them.
- On-chain metadata is public: publishing relay URIs reveals which services back your account.
- The sample's request fields follow the example schema in the spec; real accounts may require different fields.


---

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