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

# Platform Architecture

> Technical overview of Hunch's hybrid blockchain architecture

# Platform Architecture

Hunch employs a hybrid architecture that combines blockchain's trust guarantees with traditional infrastructure's performance characteristics.

## System Components

| Layer           | Technology            | Purpose                                      |
| --------------- | --------------------- | -------------------------------------------- |
| Blockchain      | Base (Coinbase L2)    | Settlement, token transfers, bet execution   |
| Smart Contracts | Solidity / EVM        | Token logic, betting pools, payouts          |
| Wallets         | Privy + ZeroDev       | Authentication, smart accounts, session keys |
| Backend         | Node.js on Railway    | API, market sync, settlement automation      |
| Database        | Supabase (PostgreSQL) | User data, market cache, analytics           |
| Frontend        | React Native          | iOS, Android, and web from single codebase   |
| Data Source     | Polymarket API        | Market questions, odds, resolution data      |

## Why This Stack

### Base (Coinbase L2)

<CardGroup cols={2}>
  <Card title="Sub-cent Fees" icon="coins">
    Transaction fees enable micro-bets
  </Card>

  <Card title="2-Second Finality" icon="clock">
    Responsive user experience
  </Card>

  <Card title="Coinbase Ecosystem" icon="building">
    Credibility and on-ramp integration
  </Card>

  <Card title="EVM Compatible" icon="code">
    Proven Solidity patterns
  </Card>
</CardGroup>

### Privy + ZeroDev

<CardGroup cols={2}>
  <Card title="Privy" icon="shield">
    Industry-leading auth with 10M+ users across clients
  </Card>

  <Card title="ZeroDev" icon="key">
    Best-in-class ERC-4337 implementation
  </Card>

  <Card title="Combined" icon="link">
    Social login → Smart account in one flow
  </Card>

  <Card title="Session Keys" icon="bolt">
    Eliminate transaction popups entirely
  </Card>
</CardGroup>

### React Native

* Single codebase for iOS, Android, and web
* Near-native performance for swipe interactions
* Large talent pool and ecosystem
* Proven at scale (Instagram, Coinbase, Discord)

<Frame>
  <img src="https://mintcdn.com/hunch-9ec04947/TKeBj3syi_P3oHY7/images/DataFlow2.png?fit=max&auto=format&n=TKeBj3syi_P3oHY7&q=85&s=063563953ac6f95f76f8819289d2ae8d" alt="Data Flow2" width="1122" height="1402" data-path="images/DataFlow2.png" />
</Frame>

## Scalability

The architecture is designed to scale to millions of users:

| Component          | Capability                                      |
| ------------------ | ----------------------------------------------- |
| Horizontal Scaling | Stateless API servers behind load balancer      |
| Database           | Supabase handles 10,000+ concurrent connections |
| Blockchain         | Base processes 1M+ daily transactions           |
| Caching            | Redis layer planned for high-frequency data     |

<Info>
  Current infrastructure supports \~100K monthly active users. Scale upgrades are straightforward and budgeted in growth plans.
</Info>
