> For the complete documentation index, see [llms.txt](https://wiki.4thtech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.4thtech.io/occ-v1/storage.md).

# Storage

Where OCC v1 keeps data: on chain, in remote storage and in the user's local storage.

{% hint style="warning" %}
**Status: Legacy (reference).** OCC v1 is the first-generation 4thTech protocol. It is documented for existing integrations and as reference; new agent-to-agent work uses OCC v2 ([AgentLink](/agentlink/agentlink.md)).
{% endhint %}

OCC v1 uses up to four places to keep data. What goes where depends on its size and sensitivity.

1. **Blockchain.** Short, encrypted records: a mail's link and checksum; a chat message with its timestamp and sender.
2. **Remote storage.** Encrypted mail envelopes and attachments. Decentralised storage can be temporary or permanent.
3. **Cloud storage.** Integrators may choose more centralised storage instead. Encrypted content is still unreadable to the provider.
4. **User local storage.** Content hashes and user-initiated backups of conversations, files and reports, on the user's own device.

```mermaid
sequenceDiagram
    participant S as Sender app
    participant R as Remote storage
    participant M as Mail contract
    participant X as Recipient app
    S->>S: Encrypt envelope and attachments
    S->>R: Upload encrypted envelope and files
    R-->>S: Link
    S->>M: Record link and checksum
    M-->>X: Event: new mail
    X->>R: Fetch envelope
    X->>X: Verify checksum, then decrypt
```

*Figure: A mail is stored encrypted in remote storage; only its link and checksum go on chain.*

The full flows are on [Message flows](/occ-v1/message-flows.md). Which storage providers the SDK supports is covered in the [SDK reference](/sdk-and-white-label/sdk.md).
