Key derivation
Encryption keys are deterministically derived from the user’s wallet signature. This means any Personal Server instance with the correct signature can decrypt the user’s data — no key exchange required.Derivation chain
Step by step
-
Master key material. The user signs the fixed message
"vana-master-key-v1"using EIP-191personal_sign. The raw signature bytes become the master key material. This happens once — when the user first opens the desktop app or first initializes the web Personal Server. -
Scope key. For each scope, a 32-byte scope key is derived using HKDF-SHA256:
For example,
instagram.profileproducesHKDF-SHA256(master_key_material, "vana", "scope:instagram.profile"). - Encryption password. The scope key is hex-encoded to a 64-character string, which serves as the password for OpenPGP symmetric encryption.
Key derivation stability
The derivation inputs are versioned and stable:- Signed message:
"vana-master-key-v1"— thev1suffix is a version marker. - HKDF salt:
"vana"(fixed). - HKDF info:
"scope:{scope}"(deterministic from scope name).
v2), Personal Servers will support both versions during a migration window so existing encrypted data remains accessible.
Builders do not manage encryption keys — the Personal Server and Desktop App handle all key derivation, encryption, and decryption internally. Builders read plaintext data from the Personal Server API; the encryption layer is transparent.
What the Personal Server needs
The Personal Server does not need the user’s wallet private key. It only needs the master key signature (the output ofpersonal_sign), which the user produces when they first open the desktop app or initialize the web Personal Server. Because every Personal Server form runs client-side — bundled in the desktop app or in a browser tab — this signature stays on the user’s own device.
Encryption
The protocol uses OpenPGP password-based symmetric encryption.How it works
- Take the plaintext JSON data file
- Derive the scope key for the file’s scope
- Hex-encode the scope key to get the encryption password
- Encrypt the entire JSON as a single OpenPGP message using the password
scope, collectedAt, and data) is encrypted as one blob.
Encryption requirements by hosting option
The local working copy lives on the user’s own device in every form. In all cases, data must be encrypted before uploading to a storage backend, and must be encrypted in transit (TLS 1.3).
Storage backends
Storage backends hold encrypted data blobs. The Personal Server encrypts data before upload and decrypts on download — the backend never sees plaintext, and has no ability to decrypt what it stores. Users select one storage backend for all their data (per-user, not per-file). The selection is made during Desktop App setup and stored in~/.vana/server.json. Until a backend is selected, the Personal Server operates in local-only mode with no remote storage or DataRegistry writes.
Available backends
Backend requirements
Every storage backend must:- Accept only encrypted blobs
- Authenticate requests (verify the requester is authorized)
- Support hierarchical key format
- Return a canonical URL after upload
Backend interface
Server configuration
Storage backend selection and OAuth tokens are stored in~/.vana/server.json:
backend field accepts: vana, gdrive, dropbox, ipfs, or local.
Data flow
When new data is collected:- Data Connector collects data from a platform
- Desktop App sends raw data to the Personal Server via
POST /v1/data/{scope} - Personal Server stores the data locally (unencrypted) at
~/.vana/data/{scope}/ - Personal Server encrypts the data with the scope key
- Encrypted blob is uploaded to the storage backend
- File record is registered in the DataRegistry via the DP RPC (with
schemaId)
Data sync
When a user runs more than one Personal Server instance (e.g. the desktop app on two machines, or desktop plus the web browser tab), they stay in sync through the storage backend and Data Registry. The storage backend is the source of truth for encrypted data; each Personal Server maintains a local decrypted copy.How sync works
Each Personal Server polls the DP RPC for new file records using alastProcessedTimestamp cursor:
- Download the encrypted blob from the storage backend
- Resolve the
schemaIdto the canonical scope (viaGET /v1/schemas/{schemaId}) - Derive the scope key and decrypt
- Read
scopeandcollectedAtfrom the decrypted payload - Store locally at
~/.vana/data/{scope}/{collectedAt}.json - Update the local index (
fileId→ path, scope, collectedAt)
First activation
When a Personal Server starts for the first time (e.g. on a new device, or the first time the web Personal Server loads), it runs a full backfill:- Query the DP RPC for all file records for the user
- Download, decrypt, and index each file
- Set
lastProcessedTimestampto the most recent record
Conflict resolution
If two instances write to the same scope concurrently, the last-write-wins strategy applies based on thecollectedAt timestamp in the payload.
Sync API (internal)
The Personal Server exposes internal sync endpoints:Before storage backend selection
Until the user selects a storage backend, sync is disabled. Data exists only on the local Personal Server instance, and no DataRegistry writes occur.Data deletion
Deleting a scope’s data is user-initiated, and what it removes today depends on the deployment:- Local data is removed. The Personal Server deletes the on-disk blobs and index rows for the scope from the user’s device.
- Remote copies are not yet removed on the current (DPv2) gateway. There is no data-point deregistration or deletion endpoint yet, so the remote data-point records and the encrypted blobs in the storage backend remain in place until that API ships. They stay encrypted under the user’s key — the storage backend cannot read them — but they are not erased. (Deleting the blob alone would leave the data point listed and wedge other servers’ sync, so the current behavior is deliberately a local-only delete.)
Data deletion is user-initiated only — builders cannot delete user data. A remote deletion / deregistration API for DPv2 is planned; until it ships, deletion removes the local copy but not the remote encrypted copy.
Related
- Personal Servers — Where data is stored and served
- Scopes & Schemas — Data taxonomy and file format
- Grants & Permissions — Access control for stored data