Skip to main content
This is the complete normative specification for the Vana Data Portability Protocol. It is the authoritative reference for implementers. For a guided introduction, see Personal servers and the other Protocol Reference pages. For focused topics, see the other Protocol Reference pages.

1. Introduction

The Data Portability Protocol enables users to:
  • Collect personal data from various platforms
  • Store data under their control
  • Grant third-party applications access to specific data scopes
  • Revoke access at any time
  • Maintain auditable records of all data access

Design principles


2. Terminology

Protocol entities

Protocol objects

Cryptographic primitives


3. Protocol model

Architecture layers

Key distinction

  • Desktop App: NOT a protocol participant. Does NOT register onchain. Controls the Personal Server.
  • Personal Server: IS a protocol participant. MUST register onchain. Can act unattended.
Multiple Desktop Apps can control the same Personal Server.

4. Protocol components

4.1 Personal server

Purpose: Stores user data in plaintext, responds to authorized data requests, maintains access logs, operates unattended. Registration: MUST be registered onchain via DataPortabilityServers. Uses EIP-712 signature-based operations.

Hosting options

Every live Personal Server form runs client-side, on the user’s own device. A user-controlled hosted form (bring your own compute) is a future option — see Personal Servers.

Implementation targets

The Personal Server does NOT require the user’s wallet private key — only the master-key signature for key derivation.

API

Data endpoints: Grant endpoints: Other endpoints: Sync endpoints (internal):

Write flow (POST /v1/data/{scope})

  1. Look up schemaId for scope via DP RPC
  2. Validate request body against schema
  3. Generate collectedAt timestamp (UTC)
  4. Construct data file envelope
  5. Store locally: ~/.vana/data/{scope}/{collectedAt}.json
  6. Return 201 Created
  7. Async: encrypt → upload to storage backend → register in DataRegistry

Authentication (builder requests)

All builder-initiated requests MUST include:
Payload fields (keys sorted alphabetically): Signing: JSON canonicalized (keys sorted) → UTF-8 → base64url (no padding). Signature is EIP-191 over ASCII bytes of base64url string. Verification: Personal Server recovers signer, verifies registered builder, validates aud/method/uri/timestamps, checks grant validity for data reads.

Access control

MCP server

Personal Server includes an MCP server for AI assistant integration. Resources: vana://files, vana://file/{scope}, vana://file/{scope}/metadata, vana://grants, vana://schemas, vana://schema/{schemaId} Tools: list_files, get_file, search_files — all require EIP-191 signature verification.

Tunneling

Desktop-bundled servers use Vana-managed FRP (Fast Reverse Proxy) for internet accessibility:
  • FRP server: proxy.server.vana.org
  • User URL: https://{userId}.server.vana.org
  • Wildcard DNS with Let’s Encrypt TLS
  • Tunnel starts on app open, terminates on close

Local data hierarchy


4.2 DP RPC

Endpoint: https://dp-rpc.vana.org Purpose: Provides fast API access to protocol operations with eventual chain consistency. Operated as a single sequencer / bounded facilitator (not decentralised); trust is bounded by the user signatures it carries and by onchain verifiability. Trust model:

DP RPC API

Server operations: Grant operations: File operations: Schema operations: Builder operations: Utility:

Request format

Response format

ID computation

The DP RPC assigns deterministically computed bytes32 IDs:

4.3 Vana L1 (onchain contracts)

DataPortabilityServers

Address: 0x1483B1F634DBA75AeaE60da7f01A679aabd5ee2c (Moksha Testnet) Manages Personal Server registration and trust relationships.

DataPortabilityGrantees

Address: 0x8325C0A0948483EdA023A1A2Fd895e62C5131234 (Moksha Testnet) Manages builder registration.

DataPortabilityPermissions

Address: 0xD54523048AdD05b4d734aFaE7C68324Ebb7373eF (Moksha Testnet) Manages grant creation and revocation. Grants are scope-native (V2): a grant carries a list of scopes and an expiry, not an enumeration of file IDs.
The previous file-based permission contract (enumerating fileIds, with a permissionFileIds accessor) remains deployed on mainnet during migration, but is legacy — new grants MUST use the scope-native model above.

DataRegistry

Address: 0x8C8788f98385F6ba1adD4234e551ABba0f82Cb7C (Moksha Testnet) Stores immutable file records.
Clients MUST register files with schemaId. Omitting schemaId is invalid for protocol compliance.

4.4 Builder access (Direct flow)

Builders integrate via the Direct flow: a browser-based approval plus backend polling. There is no builder-facing deep link or session-relay hop.

Steps

  1. Create request. The builder backend calls createAccessRequest({ scopes, ... }) and receives { requestId, approvalUrl, appAddress }.
  2. User approves. The user opens approvalUrl in a browser tab, reviews the requested scopes, and signs the EIP-712 grant. The signed grant is submitted onchain via DP RPC.
  3. Poll status. The builder backend polls getAccessRequestStatus(requestId) until status is approved (or denied/expired). On approval the response is { status, personalServerUrl, grantId, scope }.
  4. Read data. The builder reads the approved data from the user’s Personal Server at personalServerUrl, paying the protocol fee from escrow (see §4.5).
See Build a Vana app for the full integration walkthrough.

Status values

Desktop-bundled Personal Servers are reached over a Vana-managed relay/tunnel for internet reachability (FRP, https://{userId}.server.vana.org). This is infrastructure for Personal Server reachability only — it is distinct from, and not a substitute for, the deprecated builder session-relay flow.

4.5 Fees & escrow

Protocol fees are collected through a per-account escrow contract. The Personal Server never holds funds — it only gates a read on the fee showing paid.

Escrow

Each account maintains a deposited balance that the protocol settles against on fee-bearing operations.
  • Deposit — an account funds its escrow balance.
  • Settle — the protocol moves funds from a payer to a payee against a referenced operation (ref).
  • Withdraw — an account withdraws its unspent balance.
The fee asset is environment-dependent and MUST be read from the contract configuration — do not assume a fixed asset.

FeeRegistry

Fee amounts are held onchain in a FeeRegistry. Implementers MUST read the current amount onchain rather than hard-coding it. Two fee types exist: A fee-bearing read uses a challenge/retry handshake:
  1. Builder issues the read; if the fee is unpaid, the Personal Server responds with an X-PAYMENT challenge.
  2. The SDK settles the fee from escrow and retries the request with an X-PAYMENT header carrying the payment receipt.
  3. The Personal Server verifies the fee is settled, then returns the data. The read is gated on the fee showing paid.
The payment receipt shape is:

5. Data formats

5.1 Scope taxonomy

Source is the first segment. Schema definitions MUST encode the canonical scope.

5.2 Data file format

JSON envelope (v1):
The entire plaintext JSON is encrypted as a single OpenPGP blob before storage. No plaintext metadata alongside ciphertext.

5.3 Grant format (EIP-712)

5.4 Access log format

5.5 App manifest

W3C Web App Manifest with custom vana block. Discoverable via <link rel="manifest"> at the builder’s appUrl. Required vana fields: appUrl, privacyPolicyUrl, termsUrl, supportUrl, webhookUrl, signature. Signature: EIP-191 by builder address over canonical JSON of vana block (keys sorted, signature excluded). Verification: Desktop App MUST verify manifest origin, appUrl match, and signature recovery before rendering consent.

5.6 Data connector metadata

Data Connectors are NOT part of the protocol — they are implementation details of specific clients.

6. Protocol operations

6.1 User registration

  1. User opens Desktop App
  2. Redirect to Passport (identity provider)
  3. Authenticate (social/email)
  4. Wallet created or retrieved
  5. Setup complete

6.2 Data collection

  1. User clicks “Connect ” in Desktop App
  2. Embedded browser opens; user logs in
  3. Data Connector scrapes data (user’s IP, user’s browser session)
  4. Raw data sent to Personal Server via POST /v1/data/{scope}
  5. Personal Server stores locally, then async: encrypt → upload → register
If no storage backend is selected, only local storage occurs.

6.3 Connect data flow (Direct flow)

  1. User clicks “Connect data” on builder’s web app
  2. Builder backend calls createAccessRequest({ scopes, ... }){ requestId, approvalUrl, appAddress }
  3. User opens approvalUrl in a browser tab, reviews scopes, verifies the app manifest
  4. User approves; the EIP-712 grant is signed and submitted onchain via DP RPC
  5. Builder backend polls getAccessRequestStatus(requestId) until approved{ status, personalServerUrl, grantId, scope }
  6. Builder reads approved data from the Personal Server at personalServerUrl, paying the data_access fee from escrow (see §4.5)

6.4 Grant revocation

  1. User clicks “Revoke” in Desktop App
  2. Signs revocation
  3. Submit DELETE /v1/grants/{grantId} to DP RPC
  4. DP RPC marks revoked immediately; async chain sync
  5. Personal Server blocks future requests
  6. Builder receives 410 Grant revoked on next request

6.5 Data deletion

DataRegistry entries are immutable. Deletion is implemented as:
  1. User requests deletion in Desktop App
  2. Personal Server deletes encrypted blob from storage backend
  3. Local decrypted copy removed
  4. Tombstone written via DP RPC
  5. Other Personal Servers treat tombstoned records as non-existent (410 or 404)

7. Security

7.1 Encryption

  • All user data MUST be encrypted with OpenPGP password-based encryption before writing to storage backends
  • Password is hex(scope_key) where scope key is derived per section 2
  • Personal Servers serve decrypted data to authorized builders over TLS
  • Vana MUST NOT have access to plaintext data

7.2 Authentication

  • Onchain operations MUST be signed using EIP-712 typed data
  • Builder requests to Personal Servers MUST include Authorization: Web3Signed (EIP-191)
  • Nonces MUST prevent replay attacks for onchain operations

7.3 Authorization

Personal Server MUST verify before serving data:
  • Signature valid
  • Grant not revoked
  • Grant not expired
  • Requested scope within granted scopes
  • Authorization signer matches onchain grantee

7.4 Transport

  • All HTTP endpoints MUST use TLS 1.3
  • Personal Servers SHOULD implement certificate pinning
  • DP RPC SHOULD implement rate limiting

7.5 Threat model


8. Error handling

Error code structure

Following SMTP convention, the protocol uses a 3-digit error code system:

Error codes

Error response format


9. Extensibility

Adding data sources

  1. Define scope taxonomy ({source}.{category})
  2. Create JSON Schema for data structure
  3. Register schema in DataRefinerRegistry
  4. Build a Data Connector (optional — not protocol)

Adding storage backends

Implement the StorageBackend interface:

Adding capabilities

Personal Servers declare capabilities in registration:
New capabilities can be defined without protocol changes.

10. Builder SDK

Published as @opendatalabs/vana-sdk on NPM. Builders use the Direct flow (§4.4): a server-side controller creates and polls access requests, and a React hook drives the browser approval.

Server-side usage

React client usage

See Build a Vana app for the full example.

Appendix A: SMTP analogy

Appendix B: Hosted compute (future)

Every Personal Server form that ships today runs client-side, on the user’s own device — bundled in the desktop app or in a browser tab, on a single SDK (see Hosting options above). A future addition, bring your own compute, will let a user run their Personal Server in a dedicated compute environment they control — giving a web user an always-available server without keeping a tab open — designed so that only the user can see the data (hardware-attested execution plus Protocol-Governed Encryption, both in active development). See Personal Servers → Bring your own compute.