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

# How It Works

> Technical overview of Unipay's privacy architecture

# How It Works

Unipay provides privacy for Solana transactions through a graph-break primitive that separates the on-chain link between sender and recipient addresses.

## Architecture

<Steps>
  <Step title="Client Layer">
    React-based web application. Runs entirely in the browser with no server-side state.
  </Step>

  <Step title="Routing Layer">
    Stateless HTTP services that provide ephemeral deposit addresses. Never holds user funds.
  </Step>

  <Step title="On-Chain Integration">
    Direct integration with Solana programs: SystemProgram, Token Program, and liquidity aggregators.
  </Step>
</Steps>

## Execution Modes

### Wallet Mode

Standard Solana transaction flow with local signing:

```typescript theme={null}
const transaction = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: wallet.publicKey,
    toPubkey: recipientAddress,
    lamports: amount
  })
);
```

**Characteristics:**

* Direct on-chain transaction
* Single signature required
* Immediate execution

### Private Mode

Privacy-enhanced flow with routing layer. Client requests ephemeral deposit address. User sends funds to ephemeral address. Routing layer detects deposit and initiates output. Recipient receives funds from routing layer's address.

## Privacy Model

<Warning>
  Unipay provides graph-break privacy, not cryptographic anonymity. The routing layer can link inputs to outputs if subpoenaed.
</Warning>

| Adversary Type          | Protection Level |
| ----------------------- | ---------------- |
| Passive chain analysis  | ✅ Full           |
| Competitor surveillance | ✅ Full           |
| Routing layer subpoena  | ❌ Linkable       |
| Nation-state forensics  | ❌ Not designed   |

## Design Principles

1. **Non-custodial by Default** - Browser signs everything
2. **Stateless Services** - No user state on servers
3. **Disclosed Tradeoffs** - Privacy model shown in-product
4. **Zero Config** - Connect wallet and start
5. **Failure is Loud** - Errors surface immediately
