In the schema, mark a property as encrypted and name the property that identifies its subject — for example email sealed under userId.
Make a person’s data unreadable, and keep the record honest
Declare which properties hold personal data. Each value is encrypted under a key for the person it belongs to. Destroy that key and the values can’t be read — in current data or in history. The audit chain stays intact.
Three steps, no deletes
Every write that stores a version — CREATE, MERGE, SET, a label change — seals the declared values under that subject’s key. A write without the subject id is refused, never stored in clear.
db.destroySubjectKey destroys every key version for the subject and appends a hash-chained receipt. From then on the sealed values read as erased, at any time cut.
The key goes; the record stays
Destroying the subject’s key makes the sealed values unreadable. The identifying property stays in clear, because the engine needs it to find the key — so use an opaque id, never an email, as the subject id.
Before erasure
Declared values are encrypted per subject on every write.
After erasure
Unreadable in current data and through AT VALID / AT RECORDED.
Declare, erase, prove
Mark the sensitive properties in the schema, then erase one subject and check the result.
The nonce is returned once and stored nowhere. The receipt holds only a commitment, SHA-256("gq-erase-v1" || nonce || subjectId), so nobody without the nonce can tell whose erasure it was. reason is one of data_subject_request, consent_withdrawn, retention_expired, legal_order, contract_ended, security_incident or other.
Erasure you can stand behind
| After an erasure, you can still show… | How |
|---|---|
| The audit chain still verifies clean | An erasure destroys keys; it rewrites no stored record or history entry. |
| That this graph recorded an erasure for exactly this subject, and when | The receipt’s commitment opens to the subject and nonce — only the nonce holder can show it. |
| That the key is destroyed in the live key store | keyDestroyed |
| That the receipt log and erasure ledger are intact | Their own hash chains (chainStatus, ledgerChainStatus). |
| A signed statement anyone can check without the server | signedReceipt, verified offline against the server’s public keys. |
| Whether any sealed value still opens, live or in history | db.proveErasure data checks: records_live, records_history, plaintext_residue, derived_files… |
Said plainly
Erasure reaches the live graph and the history written after the declaration. It does not reach:
- backups and snapshots taken before the erasure;
- values written before the property was declared encrypted;
- properties that aren’t declared — a free-text note that repeats an email, say;
- copies outside the database: what a client already read, or text sent to an outside model provider.
db.proveErasure lists what it did not examine in its own answer, so the gap is visible rather than assumed.
What it needs, and who can run it
| Item | How it works |
|---|---|
| Key provider | On the hosted service, subject keys are held in a managed key service — erasure works with no extra setup. Self-hosted servers choose a local key, Vault, Azure or KMS; without a durable provider, declaring an encrypted property is refused. |
| Who can erase | A narrow erasure_admin key, scoped to named graphs. It can erase, prove and export — and nothing else that writes. |
| Safe retry | Send the destroy with an idempotency key; a resend after a lost answer destroys nothing more. |
| Lookups on sealed values | A blind index answers equality and MERGE on a sealed property from keyed fingerprints held in memory only, and drops the subject’s entries when the key is destroyed. |
| WORM graphs | Erasure is refused on a graph where WORM is engaged — nothing destroyed, no receipt. |
| Access export | db.subjectExport returns a subject’s records with sealed values decrypted, for access requests. |