デバイス
各アカウントが特定のデバイスに縛られることなく情報を送受信し他のアカウントと通信できるよう、すべてのアカウントにはすべてのデバイスが認識できる中央キーが作成されます。中間コードは32バイトの初期シードからランダムに生成されます。このキーは、アカウントの指定されたデバイスのみが読み取れるよう暗号化されます。
salt: "EDH-Derived-NaCl-X25519"salt: "EDH-Derived-NaCl-Secret"SEEDがランダム化された後、以下のように別のキーコードを計算できます。
X25519鍵ペア
: SCRYPT(SEED, "EDH-Derived-NaCl-X25519")
対称暗号化キー
: SCRYPT(SEED, "EDH-Derived-NaCl-Secret")
鍵導出関数は以下のパラメーターを使用します。
- アルゴリズム:
SCRYPT - SCRYPTパラメーターN(コスト):
16,384 - SCRYPTパラメーターr(ブロックサイズ):
8 - SCRYPTパラメーターp(並列化):
1
すべてのキーを計算した後、アカウントは公開鍵部分をコントラクトレジストリに保存し、他のアカウントがそれを使用してアカウント間でデータを暗号化できるようにします。
Device Keys
Each device generates its own key pair, separate from the account's central keys:
- Ethereum Wallet: A keypair used for transaction signing and on-chain identity.
- NaCl Keypair: An X25519 keypair used for encrypting data between devices.
A device's private keys are stored only on the device itself. Ever does not store any user private keys.
デバイス管理
アカウントへのデバイスの追加または削除には、以下の主要なプロセスが含まれます:
- EDHAccountにデバイスのアドレスと公開鍵を追加する。このステップでは、EDHAccountコントラクトでアカウント情報を編集する権限を持つデバイスのアドレスを追加/削除します。
- アカウントの中央キーを共有または失効させる。新しいデバイスが異なるアカウントの中間キーを生成するためのSEEDを認識できるよう、SEEDデータを新しいデバイスに送る必要があります。開発者はSeedVaultを経由せずにSEEDを配送する方法を選択できますが、EverはSeedVaultを使用できる参照ベースとして組み込んでいます。
デバイスを失効させるには、アカウントの新しいSEEDと中央キーのセットを作成します。次に、すべてのデバイスに新しいSEEDを共有します。アカウントから削除されたデバイスは除外します。
SeedVaultコントラクト
アカウントの中央キー用SEEDを他のデバイスに送信する方法は、アカウント登録の範囲を超えています。また、QRコードを介したデータ送信や集中型サービスを介した送信などのプロセス選択はシステム開発者の選択です。ただし、Everはブロックチェーンを使用して集中管理キーを共有・管理する手段としてSeedVaultコントラクトを作成しました。 以下の手順で行います:
- アカウントにリンクされた各デバイスについて、Nacl.box関数を使用してSEEDを暗号化し、以下のキーを使用します。
- デバイスのX25519公開鍵、および
- 新しいSEEDから計算されたX25519秘密鍵
- 古いSEEDがある場合は、新しいSEEDから計算された対称キーで古いSEEDを暗号化します。
- 両方の暗号化データをブロックチェーン上のSeedVaultコントラクトに保存します。
アカウント間通信の暗号化
ユーザーがアカウントを持ち、2つのアカウント間でデータを送信したい場合、送信者は宛先アカウントのX25519公開鍵とソースアカウントの秘密鍵を使用して暗号化されたデータを転送できます。 NaclのSealed Box関数を暗号化と復号化に使用でき、以下のシグネチャを持ちます:
nacl.box(message, nonce, devicePublicKey, accountNewSecretKey)
インターフェース:SeedVault
contract SeedVault {
event EDHVaultKeyUpdated(address indexed _account, address _updater, bytes32 publicKey, address [] devices);
function addAccountSeed(
bytes32 encryptionPublicKey,
bytes32 previousEncryptionPublicKey,
bytes memory previousSeed,
address[] memory devices,
bytes[] memory seeds
) external;
function addDeviceAccountSeed(
address accountAddress,
bytes32 encryptionPublicKey,
bytes32 previousEncryptionPublicKey,
bytes memory previousSeed,
address[] memory devices,
bytes[] memory seeds
) external;
function getDeviceVaultSeeds(address deviceAddress)
external view returns(DeviceSeedView[] memory);
function getVaultSeeds(address accountAddress, address deviceAddress)
external view returns (DeviceSeedView[] memory seeds);
function getVaultSeedsAt(address accountAddress, address deviceAddress, uint offset, uint count)
external view returns (DeviceSeedView[] memory seeds);
}
Event EDHVaultKeyUpdated : 公開鍵が更新されたときに生成されるイベントです。
addAccountSeed/addDeviceAccountSeed : シードを変更したり、新しいデバイスのシードを追加したりするためのトランザクション関数です。
getDeviceVaultSeeds/getVaultSeeds/getVaultSeedsAt : アカウント内のデバイスのシード値を読み取るビュー関数です。
Device Recovery
Scenario 1: A Single Device Is Lost (Other Active Devices Remain)
- Use a remaining active device to call
revokeDeviceto revoke the lost device. - The system automatically generates a new SEED (SEED rotation).
- New central keys are derived from the new SEED.
- The SeedVault is updated with the new SEED for all remaining devices.
- Call
updateEncryptionPublicKeyon the EDHAccount to store the new public key. - (Optional) Register a new device to replace the lost one.
Scenario 2: All Devices Are Lost (Backup SEED Required)
- Set up a new device by generating a new Ethereum keypair and NaCl keypair.
- Import the backup SEED that was previously stored (32 bytes).
- Derive the central keys from the SEED to prove ownership of the account.
- Use the Emergency Guardian or social recovery mechanism to register the new device.
If the backup SEED is lost and all active devices are unavailable, the account cannot be recovered. Users should always store their SEED backup in a secure location.
Key Rotation
Key rotation occurs when a device is revoked, ensuring that the revoked device cannot read any new data.
Process
- Generate a new SEED: Randomly generate a new 32-byte SEED.
- Derive new keys: Use SCRYPT derivation to create a new X25519 keypair and symmetric key.
- Update the EDHAccount: Call
updateEncryptionPublicKeyto store the new public key. - Update the SeedVault: Encrypt the new SEED for each remaining active device, and encrypt the old SEED with the symmetric key derived from the new SEED.
- Update Account Storage: Re-encrypt the EVFS root key with the new key.
Accessing Old Files
After key rotation, files encrypted with previous keys remain accessible because:
encryptionPublicKeys()returns all historical public keys.- The SeedVault stores old SEEDs encrypted with the new SEED, allowing active devices to decrypt them retroactively.
- Files created after rotation are encrypted with the new key, so revoked devices cannot read them.
Security Best Practices
SEED Storage
- Never store the SEED as plaintext on a device. Use an encrypted vault (e.g., Android Keystore, iOS Keychain).
- Back up the SEED offline, for example by writing it on paper and storing it in a safe.
- The SEED is not a BIP-39 mnemonic: The EDH SEED is a random 32-byte value, not a cryptocurrency wallet seed phrase.
Device Security
- Each device has its own Ethereum keypair -- private keys are never shared between devices.
- A revoked device immediately loses access to the account (on the blockchain).
- Device private keys are never exported from the device.
Risk and Mitigation Table
| Scenario | Risk | Mitigation |
|---|---|---|
| Phone stolen | Attacker gains device access | Revoke device immediately, triggering SEED rotation |
| Server compromised | Data on the server is leaked | E2E encryption -- the server holds no decryption keys |
| SEED leaked | Attacker can read data | Generate a new SEED and revoke the compromised device |
| Device key leaked | Attacker uses a spoofed device | Revoke the device -- attacker loses access |
| Genomic data compromised | Bio-anchor is forged | Revoke the bio-anchor and re-register with a new salt |
See Also
- Account -- EDHAccount and account management
- File Storage -- EVFS and Cryptree encryption
- BIA Architecture -- Biological Identity Attestation
- BioAnchorRegistry -- Smart contract for genomic identity