System Architecture
DPO2U is structured into 5 main layers:
1. Application Layer
The entry interface for users and agents:
- LGPD Kit Generator: Generates compliant privacy policies and documents.
- MCP Server DPO2U: Exposes tools (like
check_compliance_status) for AI agents to natively consume the protocol.
2. Agent Layer
Autonomous agents that operate the system:
- Expert Agent: Document generation.
- Auditor Agent: Compliance analysis and Attestation generation. It has its own DID (
did:midnight:agent:auditor) and linked wallet. - Monitor Agent: Continuous monitoring.
3. Storage Layer
Decentralized and public storage for hashes/proofs:
- Lighthouse (IPFS): Responsible for document storage, returning immutable CIDs.
4. Midnight Layer
The consensus, privacy, and economic viability layer:
- $NIGHT: Token for funding operations and paying fees.
- $DUST: Non-transferable token used to cover operational costs (gas/contract execution).
- Compact Smart Contracts: On-chain business logic (e.g.,
ComplianceRegistry.compact). - zk-SNARKs: Zero-knowledge mathematical proofs that guarantee validation authenticity without exposing data.
5. Analytical Layer
Computation on encrypted data for advanced analytics:
- OpenFHE (Fully Homomorphic Encryption) — enables mathematical operations on ciphertext. ML models can train on PII-sensitive datasets (e.g., patient health records linked to a partner institution) without ever decrypting the data
- Risk dashboards — corporate risk dashboards and multi-institutional data sharing immune to data breaches. The calculation occurs on encrypted data without revealing the original plaintext
The Analytical Layer is on the roadmap and not yet deployed. It will use OpenFHE and the LEANN vector database (C++ backend) to provide encrypted computations for enterprise risk analytics. See the Whitepaper for the full 5-layer architecture description.
Layers 1–4 (Application, Agent, Storage, Midnight) are deployed on Midnight testnet. The Analytical Layer (Layer 5 — OpenFHE) is on the roadmap and not yet deployed.
For a detailed breakdown of each Compact contract and the zero-knowledge principle, see Smart Contracts.
Data flow (MVP)
- Generation — LGPD Kit produces
policy.json(schemadpo2u/lgpd/v1). - Storage — Upload to Lighthouse, which returns a CID.
- Analysis — DPO2U Auditor Agent evaluates the document and generates the Attestation.
- Registration — Attestation is submitted to the Midnight network via a Compact contract.
- Consumption — The MCP Server reads the chain and exposes
check_compliance_statusto other agents.
What's next
- Smart Contracts — Compact contracts and the zero-knowledge principle
- Agents — the autonomous agents that operate each layer
- Tokenomics — the
$NIGHT/$DUSTdual-token economy powering the protocol