Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC2386, which proposes a walletstore mechanism for storing and managing Ethereum 2.0 hierarchical deterministic (HD) wallet information in a secure, interoperable format.
This article translates, summarizes, and adds context to the following proposal.
I also cover a variety of other EIPs.
Overview
ERC2386 proposes a standardized JSON format for storing and retrieving hierarchical deterministic (HD) wallet definitions in Ethereum 2.0.
This improves interoperability and makes it easier to migrate wallet information between different wallet applications.
Ethereum 2.0 is an umbrella term for a major upgrade planned as the next generation of the Ethereum network. It is formally referred to as the Merge.
Background
Ethereum originally used Proof of Work, which had limitations including high electricity consumption from mining and restricted scalability.
Main features of Ethereum 2.0
Transition to Proof of Stake (PoS)
Ethereum moved from PoW to PoS. Under PoS, participants can stake ETH (ether) to take part in network operations (block proposal and validation). This significantly reduced electricity consumption and improved network security and efficiency.
The Beacon Chain
In the first phase of Ethereum 2.0, the Beacon Chain launched in 2020 as the foundation for the PoS network. It was Ethereum's new consensus layer, responsible for PoS validator management, providing randomness, and related tasks.
The Merge
The Merge, completed in September 2022, integrated Ethereum's existing execution environment (the former PoW chain) with the Beacon Chain, completing the transition to PoS. In this sense, the transition to Ethereum 2.0 was technically complete.
Ethereum already has the concept of a keystore for defining private keys, specified by EIP2335.
ERC2386 introduces an additional concept called a walletstore.
A walletstore is a collection of information describing an HD wallet and how the keys it contains are generated (for example, which derivation paths to use).
Motivation
HD wallets derive multiple keys from a single seed (a secret random value). This presents the following challenges.
- Generating new keys requires access to the seed, which must be protected as rigorously as a private key.
- Derivation path information (for example, m/44'/60'/0'/0/0) must also be stored to preserve uniqueness and avoid duplication.
Storing and managing this information (seeds, paths, and metadata) in a standardized format offers several advantages.
- Easier data migration between wallet applications
- Reduced risk of duplicate key generation and incorrect derivation
- Greater consistency and security in wallet creation and management
Standardizing walletstores is therefore important for achieving both security and convenience.
Specification
uuid
uuid is a randomly generated version 4 UUID conforming to RFC4122, used as a unique identifier for the wallet.
It is required and must be a string.
name
name is a UTF-8 string that helps the user identify the wallet.
It must not begin with an underscore (_).
It is required and must be a string.
version
version specifies the walletstore version.
Under the current specification, it must be 1.
It is required and must be numeric.
type
type specifies the wallet type.
For a hierarchical deterministic wallet, the value must be "hierarchical deterministic".
It is required and must be a string.
crypto
crypto is a structure used to store secret information securely.
For an HD wallet, it stores the seed from which individual private keys are derived.
This structure follows the format defined in EIP2335.
It is an object with modules for kdf (key derivation function), checksum (integrity verification), and cipher (encryption method).
It is required.
nextaccount
nextaccount is the index used when creating a new private key.
It corresponds to <index> in the path m/12381/60/<index>/0 and follows EIP2334.
It must be an integer.
Whether it is required depends on the wallet type, so it is mandatory for many HD wallets.
JSON schema definition
The root object, Walletstore, has the following properties.
uuid(UUID string)name(string)version(integer)type(string)crypto(object containing cryptographic information)nextaccount(integer)
crypto consists of the following three components.
-
kdf(key derivation function module) -
checksum(checksum verification module) -
cipher(encryption module) -
Each module (
Module) contains the following fields. -
function: function name (string) -
params: parameters (object) -
message: message (string)
The Walletstore object requires the following six properties.
uuidnameversiontypecryptonextaccount
This structure enables the consistent and secure storage, migration, and use of the information required by Ethereum 2 HD wallets.
Additional context
Standardizing the walletstore, like the existing keystore (private key storage) standard, is important for improving interoperability between wallets.
Compliance with ERC2386 makes it easier to migrate and exchange wallets and keys between different wallet applications, giving users more flexible and secure key management. For systems that handle multiple keys, such as HD wallets, standardizing key derivation rules and seed storage formats is particularly important.
Test cases
ERC2386 provides test vectors for verifying correct implementations. The following is a concrete example of the contents stored in a walletstore.
Test conditions
- Password:
'testpassword' - Seed (secret information):
0x147addc7ec981eb2715a22603813271cce540e0b7f577126011eb06249d9227c
Walletstore in JSON format
{
"crypto": {
"checksum": {
"function": "sha256",
"message": "8bdadea203eeaf8f23c96137af176ded4b098773410634727bd81c4e8f7f1021",
"params": {}
},
"cipher": {
"function": "aes-128-ctr",
"message": "7f8211b88dfb8694bac7de3fa32f5f84d0a30f15563358133cda3b287e0f3f4a",
"params": {
"iv": "9476702ab99beff3e8012eff49ffb60d"
}
},
"kdf": {
"function": "pbkdf2",
"message": "",
"params": {
"c": 16,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "dd35b0c08ebb672fe18832120a55cb8098f428306bf5820f5486b514f61eb712"
}
}
},
"name": "Test wallet 2",
"nextaccount": 0,
"type": "hierarchical deterministic",
"uuid": "b74559b8-ed56-4841-b25c-dba1b7c9d9d5",
"version": 1
}crypto: stores encrypted seed information.kdf: settings for deriving a key from the password (PBKDF2 in this example)cipher: AES-128-CTR encryption and the initialization vector (iv)checksum: a SHA-256 checksum for checking whether the ciphertext has been altered
name: the wallet name chosen by the user ("Test wallet 2")nextaccount: the next HD wallet index to use (0 in this example)type: a string identifying the HD wallet type ("hierarchical deterministic")uuid: the UUID used to identify the walletversion: the version of this walletstore format (1)
This test case can be used to check the correctness and compatibility of walletstore implementations. Developers can implement wallet storage and retrieval using this format to integrate seamlessly with other wallet software.
Reference implementation
An implementation of the walletstore specification for hierarchical deterministic (HD) wallets is available in Go.
It can be found in the following repository.
This library supports the generation and management of HD wallets based on Ethereum 2.0 key management requirements (including EIP2333, EIP2334, and EIP2335). Developers can use the implementation to build applications and tools that comply with the walletstore specification.
Security
The importance of the seed and its encryption
In an HD wallet, all keys are derived from a common seed. Consequently, if the encrypted seed in a walletstore is decrypted by an attacker, all private keys generated from the same derivation paths may be exposed.
The security of the seed as a whole, rather than that of individual keys alone, is therefore critical to HD wallets.
Operational design options
HD wallets allow flexible operational designs, including the following options.
- Use only a walletstore
- Derive keys from the seed each time they are needed.
- Since this approach requires only one decryption, a stronger passphrase can be used without sacrificing convenience.
- Use only keystores
- Generate individual keystores from the seed in advance and use those files.
- In this case, exposure of one keystore does not affect the other keys.
Example of a high-security deployment
For maximum security, the following setup is recommended.
- Manage the walletstore and generate keys in an offline environment
- Transfer only the generated keystore files to an online environment and use them for signing
This approach protects the seed by keeping it disconnected from the network and limits the attack surface to individual keystores, significantly reducing risk.
References
Jim McDonald Jim@mcdee.net, "ERC-2386: Ethereum 2 Hierarchical Deterministic Walletstore [DRAFT]," Ethereum Improvement Proposals, no. 2386, November 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2386.
Conclusion
This article covered ERC2386, which proposes the walletstore mechanism for storing and managing Ethereum 2.0 hierarchical deterministic (HD) wallet information in a secure, interoperable format. How did you find it?
If you have any questions, feel free to send me a direct message on Twitter.
I also publish on other platforms. Feel free to explore them.



