02 · Architecture
2.1 Library layout (monorepo)#
diagram
rendering diagram…
2.2 What lives where#
diagram
rendering diagram…
Rule: nothing on Arkiv is ever decryptable without a key that lives off-chain and can be destroyed.
2.3 Key hierarchy (the heart of shredding)#
Implemented: content key = HKDF(record DEK ‖ collection key). Both are random, both are split 2-of-3 (device + 2 guardians). A collection = one schema in one month (epoch). Destroying either key kills the record.
diagram
rendering diagram…
Shred granularity = pick the node to destroy:
| Destroy | Effect |
|---|---|
| one DEK | one record gone |
| collection key | whole collection gone (e.g. all chats) |
| epoch key | everything from one month gone |
| root key shares | account nuked: everything ever written, plus blind indexes |
2.4 Write flow (zk.put)#
diagram
rendering diagram…
2.5 Verify flow (anyone, no keys)#
diagram
rendering diagram…
2.6 Shred flow (zk.shred) – see doc 04 for full detail#
diagram
rendering diagram…
2.7 Entity lifecycle state machine#
diagram
rendering diagram…