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

# System Map

> How RNDRNTWRK fits together across client, service, agent, and chain layers

<Info>**Status: Live**: This feature is operational.</Info>

# Architecture Overview

RNDRNTWRK is a multi-layer system spanning client applications, edge services, backend infrastructure, AI agents, and on-chain programs.

## System Diagram

```mermaid theme={null}
graph TD
    subgraph Client ["Client Layer"]
        Arcade["555 Arcade"]
        Stream["555stream Studio"]
        SW4P_UI["sw4p Bridge"]
        Wallet["Wallet Adapter"]
    end

    subgraph Edge ["Edge Layer"]
        Encoding["Encoding Workers"]
        Storage["Media Storage"]
        Cache["Edge Cache"]
        Sessions["Session Manager"]
        CDN["CDN / WAF"]
    end

    subgraph Backend ["Service Layer"]
        API["API Service"]
        VAP_Svc["VAP Verifier"]
        AGG_Svc["AGG Router"]
        CtrlPlane["Control Plane"]
        SFU["SFU Service"]
        MediaEngine["Media Engine"]
        Capture["Capture Service"]
        TTS["Text-to-Speech"]
        Avatar["Avatar Pipeline"]
        DB[("Database")]
        StateStore[("State Store")]
    end

    subgraph Agent ["Alice"]
        AliceBot["Agent Core"]
        Plugins["Plugins"]
        VectorDB["Vector Memory"]
        Knowledge["Knowledge Corpus"]
    end

    subgraph Blockchain ["Solana"]
        Token["$555 SPL Token"]
        SW4P_Bridge["sw4p (the sw4p engine)"]
        Jupiter["Jupiter Aggregator"]
        Kora["Kora (Gasless)"]
    end

    %% Client connections
    Arcade -->|HTTPS| CDN
    Stream -->|HTTPS/WSS| Encoding
    SW4P_UI -->|HTTPS| API

    %% Edge connections
    CDN -->|Route| API
    Encoding -->|Persist| Storage
    Encoding -->|Cache| Cache
    Encoding -->|State| Sessions

    %% Backend connections
    API -->|Query| DB
    API -->|State| StateStore
    VAP_Svc -->|State| StateStore
    VAP_Svc -->|Persist| DB
    CtrlPlane -->|Manage| SFU
    CtrlPlane -->|Manage| MediaEngine

    %% Agent connections
    AliceBot -->|Read| DB
    AliceBot -->|Read| StateStore
    AliceBot -->|Post| API
    AliceBot -->|Stream| CtrlPlane

    %% Blockchain connections
    API -->|Settle| Token
    API -->|Bridge| SW4P_Bridge
    AGG_Svc -->|Swap| Jupiter
    AGG_Svc -->|Gasless| Kora
```

## Layer Overview

### Client Layer

User-facing applications that connect to the protocol:

* **555 Arcade**: Browser-based game platform with wallet authentication (SIWS). Games run in sandboxed iframes with the VAP SDK for verified engagement.
* **555stream Studio**: Browser-based streaming studio with everywhere all at once, scene composition, and guest management via WebRTC.
* **sw4p Bridge**: Cross-chain bridge interface for USDC transfers across Solana, Base, and Polygon.

### Edge Layer

Globally distributed infrastructure handling encoding, caching, and real-time sessions:

* **Encoding Workers**: Video encoding and distribution at the edge, offloading compute from creator devices.
* **Media Storage**: Persistent storage for stream recordings, clips, and media assets.
* **Edge Cache**: Low-latency caching for frequently accessed data.
* **Session Manager**: Stateful session handling for real-time interactions.
* **CDN / WAF**: Content delivery and web application firewall.

### Service Layer

Backend services handling API routing, verification, media composition, and settlement:

* **API Service**: Central API handling authentication, game state, leaderboards, rewards, referrals, and settlement.
* **VAP Verifier**: Validates cryptographic heartbeats from client sessions, maintains engagement proofs.
* **AGG Router**: Payment aggregation with optimal swap routing and gasless transaction sponsorship.
* **Control Plane**: Manages scene composition, source routing, and guest connections for 555stream.
* **SFU Service**: Selective Forwarding Unit for multi-party WebRTC.
* **Media Engine**: Video composition and transcoding pipeline.
* **Capture Service**: Browser-based capture for recording and clip generation.
* **Text-to-Speech + Avatar**: Alice's voice and visual presence pipeline.

### Agent Layer (Alice)

Autonomous AI operator with persistent memory and multi-platform capabilities:

* **Agent Core**: Autonomous decision engine with 12+ custom plugins.
* **Vector Memory**: Local-first RAG retrieval for contextual intelligence.
* **Knowledge Corpus**: 80+ documents covering the full protocol specification.
* See [Alice: The Operator](/alice/persona) for details.

### Blockchain Layer (Solana)

On-chain programs and integrations:

* **\$555 SPL Token**: Protocol token for staking, burns, and participation.
* **sw4p (the sw4p engine)**: native USDC settlement across 7 chains + USDT corridor.
* **Jupiter Aggregator**: Optimal swap routing across Solana DEXs.
* **Kora**: Gasless transaction sponsorship for frictionless user experience.

## Data Flow: Play Session

Trace a user action through the system:

1. **Client**: User plays a game in the Arcade.
2. **Game Engine**: Emits events (`SCORE_UPDATE`, `ENEMY_KILL`, etc.).
3. **VAP SDK**: Hashes events into the current InputBlock and signs with session key.
4. **WebSocket**: Sends `PULSE` packet to VAP Verifier.
5. **Verifier**: Validates signature, checks nonce sequence, updates session state.
6. **Persistence**: State periodically flushed to the database.
7. **Points**: Session score converted to points based on game normalization rules.
8. **Settlement**: Weekly engine converts credits to USDC payouts.

## Data Flow: Live Stream

1. **555stream**: Creator starts broadcast from browser.
2. **Edge Encoding**: Handles video encoding and distribution.
3. **Distribution**: Custom RTMP output to any destination, everywhere all at once.
4. **Alice**: Monitors engagement signals, triggers L-Bar ads at optimal moments.
5. **Control Plane**: Manages scene composition, guest WebRTC, overlays.
6. **Settlement**: Ad revenue flows through 10% ARP → 50/50 split cascade.
