Skip to main content

Schemas and storage

All documents generated and validated within the DPO2U ecosystem follow rigid JSON schemas so that audit logic can be reproduced programmatically rather than inferred from prose.

LGPD context​

The Brazilian Lei Geral de Proteção de Dados (LGPD — Law 13.709/2018) establishes the core principles that the dpo2u/lgpd/v1 schema maps into machine-readable fields:

#PrincipleLGPD ArticleSchema mapping
1Finalidade (Purpose)Art. 6, Idata_categories — what data is collected and why
2Adequação (Adequacy)Art. 6, IIdata_categories — processing must match declared purpose
3Necessidade (Necessity)Art. 6, IIIdata_categories — minimum data for stated purpose
4Livre acesso (Free access)Art. 6, IVdpo_contact — channel for requests
5Qualidade dos dados (Data quality)Art. 6, Vlast_review — periodic accuracy review
6Transparência (Transparency)Art. 6, VIprivacy_notice document (CID on IPFS)
7Segurança (Security)Art. 6, VIIAttestation-backed evidence of controls
8Prevenção (Prevention)Art. 6, VIIIdpia document
9Não discriminação (Non-discrimination)Art. 6, IXvalidation rules over processing claims
10Responsabilização (Accountability)Art. 6, Ximmutable CID + attestation
11Consentimento (Consent)Art. 7, Iconsent_mechanism

Cross-jurisdiction note​

The schema starts from LGPD, but the approach is deliberately extensible. That matters because the surrounding regulatory environment is moving toward machine-verifiable attributes and narrower disclosure:

  • eIDAS 2 normalizes selective disclosure in the EU digital identity stack
  • AMLA increases pressure for auditable, per-decision compliance logic
  • MiCAR raises the baseline for crypto-asset compliance evidence

DPO2U does not claim that dpo2u/lgpd/v1 is already a universal schema. The claim is narrower: the schema approach is compatible with cross-jurisdiction extension, rather than hard-coding a single-country model.

Schema design principles​

Each field maps to a concrete legal requirement:

  • retention_days — LGPD Art. 15 requires deletion when data is no longer necessary
  • consent_mechanism — LGPD Art. 7 requires a legal basis for processing
  • dpo_contact — LGPD Art. 41 requires a reachable DPO function
  • last_review — supports data quality and policy freshness

The dpo2u/lgpd/v1 schema​

The default structure emitted by the LGPD Kit Generator is intentionally compact so that any agent in the network knows where to find the decisive fields.

Structure​

{
"schema_version": "dpo2u/lgpd/v1",
"company_id": "cnpj:XX.XXX.XXX/XXXX-XX",
"generated_at": "2026-03-01T14:30:00Z",
"policy": {
"retention_days": 365,
"data_categories": ["identificacao", "financeiro"],
"consent_mechanism": "opt-in-explicito",
"dpo_contact": "dpo@empresa.com.br",
"last_review": "2026-02-15"
},
"documents": [
{ "type": "privacy_notice", "cid": null },
{ "type": "dpia", "cid": null }
]
}
Mandatory fields

For a policy to be accepted by an Auditor Agent, it must contain all mandatory fields: retention_days, consent_mechanism, dpo_contact, and last_review.

Field reference​

FieldTypeRequiredDescription
schema_versionstringYesMust be "dpo2u/lgpd/v1"
company_idstringYesCompany identifier
generated_atstringYesISO 8601 timestamp
policy.retention_daysnumberYesMaximum retention period in days
policy.data_categoriesstring[]YesCategories of personal data processed
policy.consent_mechanismstringYesDeclared legal basis
policy.dpo_contactstringYesDPO email or equivalent contact
policy.last_reviewstringYesDate of last review
documents[].typestringYesDocument type
documents[].cidstringNoImmutable content reference after upload

Storage flow​

Step by step​

  1. Generation — the Expert Agent produces policy.json conforming to dpo2u/lgpd/v1
  2. IPFS upload — the payload is stored and receives a CID
  3. CID injection — the CID is linked back into the schema
  4. Validation — the Auditor Agent checks mandatory fields and computes a score
  5. Attestation — score and references are wrapped into an attestation flow

Validation rules​

RuleCheckFailure behavior
Schema versionMust equal "dpo2u/lgpd/v1"Rejected
Mandatory fieldsAll required fields present and non-nullRejected
Retention periodretention_days > 0 and ≤ 3650Warning / review
Consent mechanismMust be recognizedWarning
DPO contactMust be a valid contact channelRejected
Last reviewMust be reasonably recentWarning
Document CIDsIf present, must be validWarning

Only after passing mandatory checks does scoring proceed.

What's next​

  • Research — why schemas matter in a multi-jurisdiction attestation protocol
  • Architecture — where schemas fit into the current stack
  • Agents — how auditor agents consume these fields