본문으로 건너뛰기

Architecture

System Overview

EDH is organized into three layers:

Client Layer — Encryption happens here
Desktop App
Electron
Chrome Extension
Manifest V3
Ever Healthcare App
Proprietary
ever-edh-core
ALL crypto happens here
Service Layer — Registration, storage, relay
edh-accounts
Account registration + Bio-OIDC
NestJS
edh-accounts-worker
Async blockchain tx broadcast
pg-boss
edh-ipfs-uploads
Encrypted file storage via S3
50MB limit
Storage Layer — Persistent data (all encrypted at rest)
PostgreSQL
Account metadata, job queue
Blockchain (EVM)
Smart contracts, public keys, audit trail
IPFS Cluster
Encrypted file blobs, CID-addressed
Key Principle: Client-Side Encryption
The server NEVER sees plaintext health data. All encryption/decryption happens in the client via ever-edh-core.
EDH Three-Layer Architecture

Key Principle: Client-Side Encryption

The server NEVER sees plaintext health data.

All encryption and decryption happens in the client (desktop app, Chrome extension, or mobile app) using ever-edh-core. The backend services only handle:

  • Encrypted blob storage (IPFS)
  • Account registration (blockchain via meta-transactions)
  • Transaction relay (admin wallet pool)

Smart Contracts

Four contracts form the on-chain layer:

  1. EDHAccountRegistry — Registers accounts and devices, stores encryption public keys
  2. SeedVault — Stores encrypted seeds for multi-device key recovery
  3. AccessLogAnchor — Anchors Merkle roots of access logs (tamper-proof audit trail)
  4. EverTrustedForwarder — Meta-transaction relay (users don't pay gas)

Data Flow: Sharing Health Data

Data Flow: Sharing Health Data
Patient
1Look up Doctor's public key from blockchain
2Encrypt data with NaCl Box (Patient.secretKey + Doctor.publicKey)
3Upload encrypted blob to IPFS → get CID
4Create sharing grant (scope, expiry, CID)
5Access log entry → Merkle batch → on-chain anchor
Doctor
6Receive sharing grant notification
7Fetch encrypted blob from IPFS via CID
8Decrypt with NaCl Unbox (Doctor.secretKey + Patient.publicKey)
9View health data in File Viewer
Zero-knowledge sharing: The server only ever sees encrypted blobs. Access is logged immutably on-chain.
Cryptographic Stack
Symmetric
XSalsa20-Poly1305
TweetNaCl
Asymmetric
Curve25519-ECDH
TweetNaCl
Key Derivation
Scrypt (N=16384)
scrypt-js
File Integrity
SHA-256
sha.js
Tx Signing
ECDSA + EIP-712
ethers.js
Audit Trail
Keccak-256 Merkle
Solidity
End-to-end encrypted health data sharing