> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockmsg.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Privacy Architecture

> How blockmsg achieves true end-to-end privacy

## Zero-Knowledge Architecture

blockmsg is built with a **zero-knowledge architecture** - we literally cannot access your data, even if we wanted to.

<Note>
  Unlike traditional apps that say "we don't read your messages," blockmsg is **mathematically designed** so that reading your messages is impossible.
</Note>

***

## Visual Flow

```text theme={null}
┌────────────────────────────────────────────┐
│               SENDER                       │
│                                            │
│  Plaintext ───▶ FHE Encrypt (in browser)   │
│  "Hello!"                                  │
└─────────────────────┬──────────────────────┘
                      │ Encrypted
                      ▼
┌────────────────────────────────────────────┐
│              BLOCKCHAIN                    │
│                                            │
│  [0x3f8a...] [0x9c2b...] [0x1d4e...]      │
│                                            │
│  • Everyone can see this data              │
│  • NO ONE can read it without wallet key   │
│  • Protected by FHE encryption             │
└─────────────────────┬──────────────────────┘
                      │
                      ▼
┌────────────────────────────────────────────┐
│        RECIPIENT (wallet signature)        │
│                                            │
│  Ciphertext ──▶ Decrypt ──▶ "Hello!"       │
│                                            │
│  Only possible with recipient's wallet key │
└────────────────────────────────────────────┘
```

***

## Two Layers of Privacy

<CardGroup cols={2}>
  <Card title="Layer 1: Off-Chain (localStorage)" icon="hard-drive">
    **Your browser stores:**

    * Decrypted messages
    * Transaction history
    * Contact nicknames
    * Read/unread status

    **Our access:** ❌ **NONE**
  </Card>

  <Card title="Layer 2: On-Chain (FHE)" icon="shield-halved">
    **Blockchain stores:**

    * Encrypted message content
    * Sender/recipient addresses
    * Timestamps

    **Readable by:** ✅ Only sender & recipient
  </Card>
</CardGroup>

<Warning>
  If you clear your browser data, preferences are lost. We cannot recover them because **we never had them**.
</Warning>

***

## Zero-Database Architecture

**blockmsg has absolutely NO backend database.** We don't store:

* Your messages (encrypted or decrypted)
* Your contact lists
* Your preferences
* Your wallet associations
* Anything at all

### Where Your Data Actually Lives

<AccordionGroup>
  <Accordion icon="laptop" title="Your Browser (localStorage)">
    Stored only on YOUR device:

    * Decrypted messages (after you reveal them)
    * Contact nicknames you've set
    * Read/unread message status
    * DM allow/block preferences
    * Transaction history cache

    **Who can access:** Only you
    **Our access:** ❌ Zero - we have no servers to store this
  </Accordion>

  <Accordion icon="link" title="Blockchain (FHE Encrypted)">
    Publicly visible but encrypted:

    * Encrypted message content (FHE)
    * Sender/recipient wallet addresses
    * Timestamps
    * Self-destruct expiry times

    **Who can see:** Everyone on the blockchain
    **Who can read:** Only sender & recipient (with wallet signature)
  </Accordion>
</AccordionGroup>

<Important>
  This means if you use blockmsg on a new device or clear your browser data, your local preferences start fresh. The encrypted messages are still on the blockchain - you just need to decrypt them again with your wallet.
</Important>

***

## Who Can Read Your Messages?

| Actor                      | Access Level                            |
| -------------------------- | --------------------------------------- |
| 🔍 **Block Explorers**     | ❌ See only encrypted gibberish          |
| ⛏️ **Miners / Validators** | ❌ See only encrypted gibberish          |
| 👨‍💻 **blockmsg Team**    | ❌ **Zero access** - no keys, no servers |
| 🏛️ **Governments**        | ❌ Cryptographically impossible          |
| 📤 **You (Sender)**        | ✅ Full access with your wallet          |
| 📥 **Recipient**           | ✅ Full access with their wallet         |

***

## Trust Model

<CardGroup cols={3}>
  <Card title="Web2" icon="building">
    **Trust required:** Company

    You hope they don't read your messages
  </Card>

  <Card title="Standard Web3" icon="globe">
    **Trust required:** None

    But everyone can read everything
  </Card>

  <Card title="blockmsg" icon="lock">
    **Trust required:** None

    Trustless AND private
  </Card>
</CardGroup>

***

## Summary

<CardGroup cols={2}>
  <Card title="No Database" icon="database">
    Your data lives in your browser and on the blockchain (encrypted)
  </Card>

  <Card title="No Access" icon="ban">
    We **mathematically cannot** read your messages
  </Card>

  <Card title="True E2E" icon="lock">
    Encryption happens in your browser before data leaves
  </Card>

  <Card title="Permissionless" icon="shield">
    No one can ban you or censor your messages
  </Card>
</CardGroup>

<Tip>
  **TL;DR:** blockmsg stores nothing. The blockchain stores encrypted data. Only you and your recipient can decrypt.
</Tip>

***

## Disclaimer

<Caution>
  **This software is experimental and unaudited.** The smart contracts have NOT been formally audited. Use at your own risk.
</Caution>
