---
eip: 7811
label: ERC-7811
title: Wallet Asset Discovery
status: Draft
type: Standards Track
category: ERC
created: 2024-11-07
requires: 20, 155, 721, 5792
official: https://eips.ethereum.org/EIPS/eip-7811
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7811.md
canonical: https://eips.huatuo.xyz/ko/eip-7811/
lang: ko
tldr: wallet_getAssets JSON-RPC 메서드를 추가해, 지갑이 사용자가 여러 체인에 걸쳐 보유한 자산을, dapp이 온체인에서 쉽게 찾기 어려운 잔액까지 포함해 정확히 dapp에 알려줄 수 있게 한다.
tags: [wallet, json-rpc, assets, multichain, dapps]
---

# ERC-7811: Wallet Asset Discovery

> JSON-RPC method for wallets to share a user’s full asset list with Dapps, including assets not easily found through on-chain data alone

**TL;DR:** wallet_getAssets JSON-RPC 메서드를 추가해, 지갑이 사용자가 여러 체인에 걸쳐 보유한 자산을, dapp이 온체인에서 쉽게 찾기 어려운 잔액까지 포함해 정확히 dapp에 알려줄 수 있게 한다.

## 어떤 문제를 해결하나요?

dapp은 보통 체인 데이터를 직접 읽어 사용자의 잔액을 알아냅니다. 체인마다, 토큰마다 RPC 호출을 한 번씩 하고, 그것도 확인해 볼 생각이 든 체인에 대해서만 합니다. 그래서 다른 체인이나 계정의 자산을 놓치고, 지갑이라면 다른 체인의 자금을 경유하는 식으로 처리할 수 있는 작업(스왑이나 결제)을 dapp이 막아 버리기도 합니다.

지갑은 이미 사용자의 포트폴리오를 알고 있으며, 온체인에서 찾기 어려운 자산이 포함되는 경우도 많습니다. ERC-7811은 dapp이 지갑에 그냥 물어볼 수 있게 합니다.

## 어떻게 동작하나요?

`wallet_getAssets`를 다음 항목으로 **요청**합니다.

- `account`(필수): 보고할 주소.
- `assetFilter`(선택): [EIP-155](/eip-155/) 체인 ID별로 정확한 자산을 `{ address, type }`으로 지정합니다(`address`는 `"native"`도 가능). 있으면 지갑은 이 자산들만 반환하고 **나머지 두 필터는 무시합니다**.
- `assetTypeFilter`(선택): 예: `["erc20", "native"]`.
- `chainFilter`(선택): 16진수 체인 ID 목록.

`assetFilter`가 없으면 지갑은 알고 있는 모든 것을, 가능하면 추정 가치순으로 반환해야 합니다. dapp은 호출을 가볍고 빠르게 유지하기 위해 가능한 한 좁게 필터링하도록 요구됩니다.

**응답:** 16진수 체인 ID를 키로 하는 객체이며, 각각 `{ address, balance, type, metadata }` 목록을 담고 `balance`는 16진수입니다. 잘 알려진 타입은 최소한의 `metadata`를 정의합니다.

- `native`: 메타데이터 불필요.
- `erc20`: `name`, `symbol`, `decimals`.
- `erc721`: `name`, `symbol`, `tokenId`, 선택적으로 `tokenURI`.

**디스커버리:** [ERC-5792](/eip-5792/)를 지원하는 지갑은 `wallet_getCapabilities`에서 체인별로 `{ "assetDiscovery": { "supported": true } }`를 알려야 합니다. CAIP-25 지갑은 `eip155` 세션 범위에 이 메서드를 나열합니다.

## 샘플 코드

```ts
// window.ethereum: an EIP-1193 provider
const [account] = await window.ethereum.request({ method: "eth_requestAccounts" });

const assets = await window.ethereum.request({
  method: "wallet_getAssets",
  params: [{
    account,
    assetTypeFilter: ["native", "erc20"],
    chainFilter: ["0x1", "0xa"],          // Ethereum mainnet, OP Mainnet
  }],
});

for (const [chainId, list] of Object.entries(assets)) {
  for (const a of list as any[]) {
    console.log(chainId, a.type, a.metadata?.symbol ?? "native", BigInt(a.balance));
  }
}
```

## 알아둘 점

- 상태는 **Draft**이며, Rationale과 Security Considerations 섹션은 아직 TODO입니다.
- 이 데이터는 **지갑**의 주장입니다. 보안상 민감한 용도에서는 자금 증명으로 취급하지 말고, 중요한 곳에서는 온체인에서 검증하세요.
- `type`은 자유 형식의 문자열입니다. 사양 자체의 예시에도 `"erc20"`과 `"ERC20"`이 섞여 있으므로 타입은 대소문자를 구분하지 않고 비교하세요.
- 모든 지갑이 구현한 것은 아니므로 먼저 `wallet_getCapabilities`를 확인하고 온체인 읽기로 폴백하세요.


---

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