EIP-6051 Private key encapsulated transfer (Private Key Encapsulation)
No call decision · Security & privacy · EIP status Stagnant · created 2022-11-21
Defines a procedure for securely moving a single private key to another app by encrypting it, without exposing the seed phrase that controls the entire wallet.
Why it is needed
There are cases where you want to pull out just one messaging key from a wallet that is secure but inconvenient, like a hardware wallet, or link up with an MPC service for fraud detection or two factor authentication, or send transactions more conveniently from a mobile device. But right now, moving even a single key requires entering the seed phrase that controls the entire wallet. Since the seed controls every address across multiple chains, exposing it even once puts the entire wallet at risk. This EIP solves this problem by defining a standard method for encrypting a single purpose specific private key and delivering it to a trusted party, without handing over the seed.
What changes
Today
- Moving a single private key to another app requires entering the seed phrase that controls the entire wallet
- If the seed is exposed, every address across multiple chains is put at risk together
- Each app exchanges keys in its own way, with no compatibility
After EIP-6051
- Encapsulating and transferring a single private key using ECIES encryption
- Keys can be moved from a hardware wallet to a mobile app, an MPC service, and so on, without exposing the seed
- Optional signature verification confirms that the key is delivered only to a trusted party
Who is affected
- Wallet and hardware wallet developers: A standard interface for exporting and importing individual keys can be implemented without exposing the entire seed.
- MPC and security service providers: They can safely receive a key from a user's wallet and provide additional services such as fraud detection and two factor authentication.
- Ordinary users: A key for a specific purpose can be moved to another device or app without handing over the seed phrase.
In depth
Core algorithms: ECDH, HKDF, and authenticated encryption
The sender prepares their own private key sk, the recipient's ephemeral key pair (r, R), and the sender's own ephemeral key pair (s, S). Using ECDH, it computes the shared secret ss := [s]R = [r]S, where secp256k1 follows the compressed representation of RFC5903 (using only the x-coordinate) and Curve25519 follows RFC7748. This ss, together with an optional out-of-band value oob and a salt, is fed into HKDF (hash=SHA256) to derive a derivedKey, whose first part is used as the symmetric key skey and whose latter part is used as the IV. Finally, symAlg is used to authenticate-encrypt sk, producing cipher := authenticated_encryption(symAlg, skey, IV, sk).
Three request methods
R1 eth_generateEphemeralKeyPair has the recipient generate an ephemeral key pair (r, R) and return R. If signerPubKey is provided, a signature is also attached to R. R2 eth_encapsulatePrivateKey has the sender verify the recipient's R (and signature), then encrypt the private key of the specified account using its own ephemeral key pair (s, S), returning S || cipher. R3 eth_intakePrivateKey has the recipient decrypt cipher using the stored r to obtain the original private key, and returns its address.
Supported curves, cipher combinations, and version strings
There are two elliptic curves, secp256k1 (required) and Curve25519, and three authenticated encryption schemes, AES-128-GCM (required), AES-256-GCM, and Chacha20-Poly1305, giving six possible combinations in total. The version parameter is a string concatenating the curve and the encryption scheme (e.g. secp256k1-AES-128-GCM). If there is no user input or negotiation, secp256k1-AES-128-GCM is used as the default. For the signature algorithm, ECDSA corresponds to secp256k1 and Ed25519 corresponds to Curve25519.
Optional signatures and a dual trust structure
If a signature is attached to R or to signerPubKey, the sending app can verify that this ephemeral public key came from a trusted party. The structure is a dual signature of the form R ← signerPubKey ← trustedPubKey, where signerPubKey itself can be signed by trustedPubKey, allowing a trust hierarchy to be built up. For example, a hardware wallet manufacturer can trust only its own trustedPubKey and sign only the signerPubKey of selected partners, managing the scope of trust this way.
Full forward secrecy and the difference from EIP-5630
This EIP achieves full forward secrecy (PFS) because both the sender and the recipient generate a new ephemeral key pair each time and securely discard it after use. An attacker who intercepts the ciphertext in transit cannot recover either party's ephemeral key afterward, making decryption impossible. EIP-5630, the message encryption standard, keeps the recipient's public key stable for repeated use, whereas this EIP uses the recipient's public key as a one-time ephemeral key generated fresh each time.
salt, oob, and randomness requirements
r and s must be generated using a cryptographically secure random number generator (CSRNG). salt is used as the salt input to HKDF; its length is free, but 12 to 16 bytes is recommended as suitable for display as a QR code, and if none is given the default EIP-6051 is used. oob is optional and is a numeric or alphanumeric code entered by the user, fed into the info input of HKDF. For ease of use, implementations are recommended to require only one of salt or oob.
Limits of the security level and the current status of this proposal
This EIP does not consider quantum-resistant security. If quantum computers become a real threat, the underlying cryptography of L1 chains such as Ethereum itself will be replaced, and at that point the elliptic-curve-based ECIES of this standard will also be rendered obsolete along with the proposal itself. It also notes that since the same key may be used across different chains, the encryption strength should be chosen to meet the strictest requirement level. This proposal is currently in Stagnant status.