ERC-2386 Ethereum 2 HD walletstore format (Ethereum 2 Hierarchical Deterministic Walletstore)

Stagnant · Accounts & wallets · created 2019-11-21

Stores wallet-level information for an Ethereum 2 hierarchical deterministic (HD) wallet, such as its seed and next key index, in a common JSON format so that the same HD wallet can be used interchangeably across different wallet software.

Why it is needed

A hierarchical deterministic (HD) wallet derives multiple private keys from a single seed and derivation path. The seed must be accessed every time a new key is generated, so it must be protected as strictly as a private key, and the path (index) of the next key to be generated must also be recorded somewhere to prevent duplicate generation. However, if the way this seed, index, and metadata such as the wallet name are stored differs from wallet to wallet, it becomes difficult to move an HD wallet created in one wallet software to another or to use them interchangeably. A keystore format for storing a single private key has already been standardized as EIP-2335, but there was no standard for wallet-level information including the seed and next index.

In depth

uuid

A randomly generated type 4 UUID as defined by RFC 4122. It serves as a 128-bit surrogate identifier pointing to a specific wallet. It must be present and must be a string following the syntax defined in section 3 of RFC 4122.

name

A UTF-8 string that is a name for the user to recognize the wallet. It must be present and must be a string, with the only constraint being that it cannot start with an underscore (_) character.

version and type

version must be present and must be the integer 1. type must also be present and must be the string "hierarchical deterministic", used to determine mechanisms such as the key generation method.

crypto

The area that securely stores the secret used by the HD wallet to compute private keys, namely the seed. It must be present and must be an object containing the kdf, checksum, and cipher modules as defined in EIP-2335, each of which has function, message, and params.

nextaccount

The index to place in the path m/12381/60/<index>/0 (per EIP-2334) when generating a new private key from the seed. It must be present if the wallet type requires it, and must be a non-negative integer.

Required fields in the JSON schema

The schema requires name, type, uuid, version, crypto, and nextaccount as required properties of the Walletstore object. The kdf, checksum, and cipher inside crypto must each follow the Module definition, and Module requires function, message, and params as mandatory.

Status note

This proposal is in Stagnant status, meaning it may still change or may remain stalled as is.

Things to watch out for

Original ERC · ← ERCs