{"eip":2386,"title":"Ethereum 2 Hierarchical Deterministic Walletstore","description":"A JSON format for the storage and retrieval of Ethereum 2 hierarchical deterministic (HD) wallet definitions.","authors":["Jim McDonald \u003cJim@mcdee.net\u003e"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2019-11-21","requires":[2334,2335],"discussionsTo":"https://ethereum-magicians.org/t/eip-2386-walletstore/3792","repo":"ERCs","label":"ERC-2386","officialUrl":"https://eips.ethereum.org/EIPS/eip-2386","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2386.md","url":"https://eips.huatuo.xyz/eip-2386/","tldr":{"en":"A JSON 'walletstore' format that saves an encrypted HD seed plus the next key index for Ethereum consensus-layer (BLS) keys, so validator wallets can move between tools.","ja":"Ethereum コンセンサスレイヤー（BLS）鍵のために、暗号化した HD シードと次の鍵インデックスを保存する JSON の「walletstore」形式。バリデーターのウォレットをツール間で移行できるようにする。","ko":"이더리움 합의 계층(BLS) 키를 위해 암호화된 HD 시드와 다음 키 인덱스를 저장하는 JSON \"walletstore\" 형식. 검증자 지갑을 도구 간에 옮길 수 있게 한다.","zh":"一种 JSON \"walletstore\" 格式，为以太坊共识层（BLS）密钥保存加密的 HD 种子和下一个密钥索引，使验证者钱包可以在不同工具之间迁移。"},"tags":["wallet","keystore","validator","bls","json"],"explainers":{"en":{"lang":"en","tldr":"A JSON 'walletstore' format that saves an encrypted HD seed plus the next key index for Ethereum consensus-layer (BLS) keys, so validator wallets can move between tools.","tags":["wallet","keystore","validator","bls","json"],"related":[2333,2334,2335],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2386/","markdown":"## What problem does it solve?\n\n[EIP-2335](/eip-2335/) standardised the *keystore*: an encrypted JSON file holding one BLS private key, as used by consensus-layer validators. But a hierarchical deterministic (HD) wallet does not store individual keys. It stores a **seed** and derives keys from it along a path. To create the next key without reusing an old one, the wallet also needs to remember which index it has reached.\n\nWithout a standard, each tool saved that seed and counter in its own way, so you could not move a wallet from one client or CLI to another. ERC-2386 defines a common JSON file for it, called a *walletstore*.\n\n## How it works\n\nA walletstore is a JSON object with these fields:\n\n| Field | Meaning |\n| --- | --- |\n| `uuid` | Random version-4 UUID identifying the wallet |\n| `name` | Human-friendly name; must not start with `_` |\n| `version` | Always the integer `1` |\n| `type` | The string `\"hierarchical deterministic\"` |\n| `crypto` | The encrypted seed, using exactly the EIP-2335 `kdf` / `checksum` / `cipher` structure |\n| `nextaccount` | Non-negative integer: the index to use for the next key |\n\nNew keys are derived at path `m/12381/60/\u003cnextaccount\u003e/0`, following [EIP-2334](/eip-2334/), with the key derivation itself defined in [EIP-2333](/eip-2333/). After creating a key the wallet increments `nextaccount` so the same key is never generated twice.\n\nDecryption works exactly like a keystore: run the KDF on the password, check the checksum, then decrypt the `cipher.message` to recover the seed.\n\n## Sample code\n\nThe shape of a walletstore (placeholder values shown; real files contain hex output from the KDF and cipher):\n\n```json\n{\n  \"crypto\": {\n    \"kdf\": {\n      \"function\": \"pbkdf2\",\n      \"params\": { \"c\": 262144, \"dklen\": 32, \"prf\": \"hmac-sha256\", \"salt\": \"\u003chex\u003e\" },\n      \"message\": \"\"\n    },\n    \"checksum\": { \"function\": \"sha256\", \"params\": {}, \"message\": \"\u003chex\u003e\" },\n    \"cipher\": {\n      \"function\": \"aes-128-ctr\",\n      \"params\": { \"iv\": \"\u003chex\u003e\" },\n      \"message\": \"\u003cencrypted seed, hex\u003e\"\n    }\n  },\n  \"name\": \"Validator wallet\",\n  \"nextaccount\": 0,\n  \"type\": \"hierarchical deterministic\",\n  \"uuid\": \"b74559b8-ed56-4841-b25c-dba1b7c9d9d5\",\n  \"version\": 1\n}\n```\n\nDeriving the path for the next key:\n\n```ts\nfunction nextKeyPath(ws: { nextaccount: number }): string {\n  return `m/12381/60/${ws.nextaccount}/0`;\n}\n```\n\n## Things to know\n\n- Status is **Stagnant**. The format has a Go implementation by the author, but it is not broadly adopted as a cross-client standard.\n- Security: the seed can regenerate every key on the path, so the walletstore is only as safe as its password and KDF settings. A leaked walletstore is worse than a leaked single keystore.\n- The spec suggests keeping the walletstore on an offline machine, generating individual EIP-2335 keystores there, and moving only those keystores to the online validator.\n- The JSON schema in the spec has a syntax slip (missing commas in the `required` list); follow the field descriptions above rather than copying it literally.\n"},"ja":{"lang":"ja","tldr":"Ethereum コンセンサスレイヤー（BLS）鍵のために、暗号化した HD シードと次の鍵インデックスを保存する JSON の「walletstore」形式。バリデーターのウォレットをツール間で移行できるようにする。","tags":["wallet","keystore","validator","bls","json"],"related":[2333,2334,2335],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2386/","markdown":"## 何を解決するのか\n\n[EIP-2335](/eip-2335/) は *keystore* を標準化しました。コンセンサスレイヤーのバリデーターが使う、BLS 秘密鍵 1 つを保持する暗号化 JSON ファイルです。しかし階層的決定性（HD）ウォレットは個々の鍵を保存しません。**シード**を保存し、そこからパスに沿って鍵を導出します。古い鍵を再利用せずに次の鍵を作るには、ウォレットはどのインデックスまで進んだかも記憶しておく必要があります。\n\n標準がなければ、各ツールがそのシードとカウンターを独自の方法で保存するため、あるクライアントや CLI から別のものへウォレットを移せませんでした。ERC-2386 は、そのための共通の JSON ファイルを *walletstore* として定義します。\n\n## 仕組み\n\nwalletstore は次のフィールドを持つ JSON オブジェクトです。\n\n| フィールド | 意味 |\n| --- | --- |\n| `uuid` | ウォレットを識別するランダムなバージョン 4 の UUID |\n| `name` | 人間向けの名前。`_` で始まってはならない |\n| `version` | 常に整数 `1` |\n| `type` | 文字列 `\"hierarchical deterministic\"` |\n| `crypto` | 暗号化されたシード。EIP-2335 の `kdf` / `checksum` / `cipher` 構造をそのまま使う |\n| `nextaccount` | 非負整数。次の鍵に使うインデックス |\n\n新しい鍵は、[EIP-2334](/eip-2334/) に従ってパス `m/12381/60/\u003cnextaccount\u003e/0` で導出され、鍵導出自体は [EIP-2333](/eip-2333/) で定義されています。鍵を作成した後、ウォレットは `nextaccount` をインクリメントし、同じ鍵が二度生成されないようにします。\n\n復号は keystore とまったく同じです。パスワードに KDF を適用し、チェックサムを確認し、`cipher.message` を復号してシードを復元します。\n\n## サンプルコード\n\nwalletstore の形（プレースホルダーの値を表示。実際のファイルには KDF と暗号の 16 進出力が入ります）:\n\n```json\n{\n  \"crypto\": {\n    \"kdf\": {\n      \"function\": \"pbkdf2\",\n      \"params\": { \"c\": 262144, \"dklen\": 32, \"prf\": \"hmac-sha256\", \"salt\": \"\u003chex\u003e\" },\n      \"message\": \"\"\n    },\n    \"checksum\": { \"function\": \"sha256\", \"params\": {}, \"message\": \"\u003chex\u003e\" },\n    \"cipher\": {\n      \"function\": \"aes-128-ctr\",\n      \"params\": { \"iv\": \"\u003chex\u003e\" },\n      \"message\": \"\u003cencrypted seed, hex\u003e\"\n    }\n  },\n  \"name\": \"Validator wallet\",\n  \"nextaccount\": 0,\n  \"type\": \"hierarchical deterministic\",\n  \"uuid\": \"b74559b8-ed56-4841-b25c-dba1b7c9d9d5\",\n  \"version\": 1\n}\n```\n\n次の鍵のパスを導出する:\n\n```ts\nfunction nextKeyPath(ws: { nextaccount: number }): string {\n  return `m/12381/60/${ws.nextaccount}/0`;\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。この形式には作者による Go 実装がありますが、クライアント横断の標準としては広く採用されていません。\n- セキュリティ: シードはパス上のすべての鍵を再生成できるため、walletstore の安全性はパスワードと KDF 設定次第です。walletstore の漏えいは、単一の keystore の漏えいより深刻です。\n- 仕様は、walletstore をオフラインのマシンに置き、そこで個別の EIP-2335 keystore を生成し、オンラインのバリデーターには keystore だけを移すことを勧めています。\n- 仕様内の JSON スキーマには構文ミス（`required` リストのカンマ抜け）があります。文字どおりコピーせず、上記のフィールド説明に従ってください。\n"},"ko":{"lang":"ko","tldr":"이더리움 합의 계층(BLS) 키를 위해 암호화된 HD 시드와 다음 키 인덱스를 저장하는 JSON \"walletstore\" 형식. 검증자 지갑을 도구 간에 옮길 수 있게 한다.","tags":["wallet","keystore","validator","bls","json"],"related":[2333,2334,2335],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2386/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-2335](/eip-2335/)는 *keystore*를 표준화했습니다. 합의 계층 검증자가 사용하는, BLS 개인키 하나를 담은 암호화 JSON 파일입니다. 하지만 계층적 결정론적(HD) 지갑은 개별 키를 저장하지 않습니다. **시드**를 저장하고 경로를 따라 키를 파생합니다. 이전 키를 재사용하지 않고 다음 키를 만들려면 지갑은 어떤 인덱스까지 왔는지도 기억해야 합니다.\n\n표준이 없으면 도구마다 시드와 카운터를 자기만의 방식으로 저장했기 때문에, 지갑을 한 클라이언트나 CLI에서 다른 곳으로 옮길 수 없었습니다. ERC-2386은 이를 위한 공통 JSON 파일을 *walletstore*라는 이름으로 정의합니다.\n\n## 어떻게 동작하나요?\n\nwalletstore는 다음 필드를 가진 JSON 객체입니다.\n\n| 필드 | 의미 |\n| --- | --- |\n| `uuid` | 지갑을 식별하는 무작위 version-4 UUID |\n| `name` | 사람이 읽기 쉬운 이름. `_`로 시작해서는 안 됨 |\n| `version` | 항상 정수 `1` |\n| `type` | 문자열 `\"hierarchical deterministic\"` |\n| `crypto` | 암호화된 시드. EIP-2335의 `kdf` / `checksum` / `cipher` 구조를 그대로 사용 |\n| `nextaccount` | 0 이상의 정수: 다음 키에 사용할 인덱스 |\n\n새 키는 [EIP-2334](/eip-2334/)에 따라 경로 `m/12381/60/\u003cnextaccount\u003e/0`에서 파생되며, 키 파생 자체는 [EIP-2333](/eip-2333/)에서 정의됩니다. 키를 만든 뒤 지갑은 `nextaccount`를 증가시켜 같은 키가 두 번 생성되지 않게 합니다.\n\n복호화는 keystore와 똑같이 동작합니다. 비밀번호에 KDF를 적용하고, 체크섬을 확인한 뒤, `cipher.message`를 복호화해 시드를 복원합니다.\n\n## 샘플 코드\n\nwalletstore의 형태(자리표시자 값을 표시함. 실제 파일에는 KDF와 암호의 16진수 출력이 들어갑니다):\n\n```json\n{\n  \"crypto\": {\n    \"kdf\": {\n      \"function\": \"pbkdf2\",\n      \"params\": { \"c\": 262144, \"dklen\": 32, \"prf\": \"hmac-sha256\", \"salt\": \"\u003chex\u003e\" },\n      \"message\": \"\"\n    },\n    \"checksum\": { \"function\": \"sha256\", \"params\": {}, \"message\": \"\u003chex\u003e\" },\n    \"cipher\": {\n      \"function\": \"aes-128-ctr\",\n      \"params\": { \"iv\": \"\u003chex\u003e\" },\n      \"message\": \"\u003cencrypted seed, hex\u003e\"\n    }\n  },\n  \"name\": \"Validator wallet\",\n  \"nextaccount\": 0,\n  \"type\": \"hierarchical deterministic\",\n  \"uuid\": \"b74559b8-ed56-4841-b25c-dba1b7c9d9d5\",\n  \"version\": 1\n}\n```\n\n다음 키의 경로 파생하기:\n\n```ts\nfunction nextKeyPath(ws: { nextaccount: number }): string {\n  return `m/12381/60/${ws.nextaccount}/0`;\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 이 형식은 작성자가 만든 Go 구현이 있지만 클라이언트 간 표준으로 널리 채택되지는 않았습니다.\n- 보안: 시드는 경로상의 모든 키를 다시 만들 수 있으므로, walletstore의 안전성은 비밀번호와 KDF 설정에 달려 있습니다. walletstore 유출은 개별 keystore 하나가 유출되는 것보다 더 심각합니다.\n- 스펙은 walletstore를 오프라인 머신에 보관하고, 거기서 개별 EIP-2335 keystore를 생성한 다음, 그 keystore만 온라인 검증자로 옮길 것을 권합니다.\n- 스펙의 JSON 스키마에는 문법 실수(`required` 목록의 쉼표 누락)가 있습니다. 그대로 복사하지 말고 위의 필드 설명을 따르세요.\n"},"zh":{"lang":"zh","tldr":"一种 JSON \"walletstore\" 格式，为以太坊共识层（BLS）密钥保存加密的 HD 种子和下一个密钥索引，使验证者钱包可以在不同工具之间迁移。","tags":["wallet","keystore","validator","bls","json"],"related":[2333,2334,2335],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2386/","markdown":"## 它解决什么问题？\n\n[EIP-2335](/eip-2335/) 标准化了 *keystore*：共识层验证者使用的、保存单个 BLS 私钥的加密 JSON 文件。但分层确定性（HD）钱包并不存储单个密钥，它存储的是一个**种子**，并沿着某条路径从中派生密钥。为了在不重复使用旧密钥的前提下创建下一个密钥，钱包还需要记住自己走到了哪个索引。\n\n没有标准时，各个工具以各自的方式保存种子和计数器，因此无法把钱包从一个客户端或命令行工具迁移到另一个。ERC-2386 为此定义了一种通用的 JSON 文件，称为 *walletstore*。\n\n## 它如何运作\n\nwalletstore 是一个包含以下字段的 JSON 对象：\n\n| 字段 | 含义 |\n| --- | --- |\n| `uuid` | 标识钱包的随机 version-4 UUID |\n| `name` | 便于人阅读的名称；不得以 `_` 开头 |\n| `version` | 始终为整数 `1` |\n| `type` | 字符串 `\"hierarchical deterministic\"` |\n| `crypto` | 加密后的种子，严格采用 EIP-2335 的 `kdf` / `checksum` / `cipher` 结构 |\n| `nextaccount` | 非负整数：下一个密钥使用的索引 |\n\n新密钥按 [EIP-2334](/eip-2334/) 在路径 `m/12381/60/\u003cnextaccount\u003e/0` 派生，密钥派生本身由 [EIP-2333](/eip-2333/) 定义。创建密钥后，钱包会递增 `nextaccount`，确保不会两次生成同一个密钥。\n\n解密方式与 keystore 完全相同：对密码运行 KDF，校验 checksum，然后解密 `cipher.message` 得到种子。\n\n## 示例代码\n\nwalletstore 的结构（显示的是占位值；真实文件包含 KDF 和加密算法输出的十六进制数据）：\n\n```json\n{\n  \"crypto\": {\n    \"kdf\": {\n      \"function\": \"pbkdf2\",\n      \"params\": { \"c\": 262144, \"dklen\": 32, \"prf\": \"hmac-sha256\", \"salt\": \"\u003chex\u003e\" },\n      \"message\": \"\"\n    },\n    \"checksum\": { \"function\": \"sha256\", \"params\": {}, \"message\": \"\u003chex\u003e\" },\n    \"cipher\": {\n      \"function\": \"aes-128-ctr\",\n      \"params\": { \"iv\": \"\u003chex\u003e\" },\n      \"message\": \"\u003cencrypted seed, hex\u003e\"\n    }\n  },\n  \"name\": \"Validator wallet\",\n  \"nextaccount\": 0,\n  \"type\": \"hierarchical deterministic\",\n  \"uuid\": \"b74559b8-ed56-4841-b25c-dba1b7c9d9d5\",\n  \"version\": 1\n}\n```\n\n推导下一个密钥的路径：\n\n```ts\nfunction nextKeyPath(ws: { nextaccount: number }): string {\n  return `m/12381/60/${ws.nextaccount}/0`;\n}\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。该格式有作者提供的 Go 实现，但作为跨客户端标准并未被广泛采用。\n- 安全性：种子可以重新生成路径上的每一个密钥，因此 walletstore 的安全程度取决于其密码和 KDF 设置。泄露 walletstore 比泄露单个 keystore 更严重。\n- 规范建议将 walletstore 保存在离线机器上，在那里生成单独的 EIP-2335 keystore，只把这些 keystore 转移到在线的验证者。\n- 规范中的 JSON schema 有语法疏漏（`required` 列表缺少逗号）；请遵循上面的字段说明，不要原样照抄。\n"}}}
