> ## 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.

# For Developers

> Build games, payments, agents, and real-time experiences on RNDRNTWRK.

**RNDRNTWRK gives developers the surfaces to build games, payment flows, agents, overlays, and live creator experiences on top of one active system. If your application needs to verify participation, react to live events, or move value across the network, this is where you build it.**

## What You Can Build

* **Games** that verify player activity and settle rewards in USDC
* **Payment flows** that combine verification, routing, and programmable payment links
* **Cross-chain USDC movement** through sw4p across supported chains
* **Interactive stream surfaces**, overlays, and live participation modules
* **Bots, agents, and automations** that react to REST and live SSE events

## Choose Your Starting Point

### Build a game

Use GameHarness and VAP to integrate verified gameplay, scoring, and reward accrual.

### Build payment flows

Use AGG, Hyperlink, and sw4p to route and move value.

### Build bots and automations

Use the REST API and SSE stream to react to live system events.

### Build on-chain

Use the Solana / Anchor program layer for rewards, escrow, and lottery logic.

## API Overview

Most integrations start the same way: authenticate with SIWS, keep the session cookie, use REST for actions, and SSE for live state.

**Base URL:** `https://api.rndrntwrk.com`

**Authentication:** SIWS (Sign In With Solana):

1. `POST /auth/nonce`, request a sign-in nonce
2. Sign the nonce with a Solana wallet
3. `POST /auth/verify`, submit signed message, receive session cookie
4. Include the session cookie on all subsequent requests

**Format:** JSON REST for requests and responses. SSE for real-time events.

**Endpoint groups:**

| Group                  | What It Covers                                                  |
| :--------------------- | :-------------------------------------------------------------- |
| Authentication         | Nonce, verify, logout, social linking                           |
| Arcade and Gaming      | Score submission, game state, per-game leaderboards, stats      |
| Battles                | Create, join, and track PvP matches                             |
| Lottery                | Create rounds, buy tickets, finalize draws, audit trails        |
| Leaderboards           | Global, per-game, quest, and referral rankings                  |
| Rewards                | Claim USDC, Merkle proofs, epoch management, projected earnings |
| Referrals              | Generate links, bind codes, track performance                   |
| Profile and Tasks      | User profile, daily tasks, payment history                      |
| Events and SSE         | Real-time event stream, burn events                             |
| Quests                 | List quests, track progress, check multipliers                  |
| Social                 | Twitter webhook, social sharing data                            |
| Clips                  | Upload and list gameplay clips                                  |
| Eligibility and Config | Token-gate checks, normalization config, game registry          |

Full reference: [API Reference](/api-reference)

## Integrate a Game

**GameHarness is the fastest path for integrating a game into RNDRNTWRK.**

Your game is responsible for:

* Gameplay logic
* Event emission
* Score-producing actions

The harness is responsible for:

* Session lifecycle
* VAP connection
* Hashing and signing flow
* Verifier submission
* Reward accrual hooks based on normalization settings

```tsx theme={null}
<GameHarness appId="your-game-id" onSessionStart={handleStart}>
  <YourGameComponent />
</GameHarness>
```

The harness manages the full VAP lifecycle: connect, play, hash, sign, transmit. Your game emits events (`SCORE_UPDATE`, `ENEMY_KILL`, etc.) and the harness aggregates them into a Merkle root. The session key signs the root and the signed payload is sent to the VAP Verifier.

Score normalization maps all games to a 0 to 10,000 scale. Normalization config is managed at the protocol level. See [Arcade Overview](/arcade/overview) for the current normalization rules and scoring model.

## Verification, Routing, and Settlement

Four components handle verification, routing, and settlement across the network. Each has a distinct role.

### VAP: Verifiable Attention Protocol

VAP verifies participation.

* Ed25519 challenge-response sessions
* WebSocket heartbeat at 5-second intervals
* Session lifecycle: connect, challenge, sign, verify, accumulate

<Info>**Status:** VAP v1 is live. VAP v2 is in design (not yet deployed). See [VAP](/protocol/vap) and [VAP v2](/protocol/vap-v2).</Info>

### AGG: Payment Aggregator

AGG routes and settles supported payment flows inside the protocol.

* Solana-native settlement via Jupiter (live)
* HTTP 402 (Payment Required) standard support

<Info>**Status:** Solana-native settlement is live. Cross-chain routing via the sw4p engine is in development. See [AGG](/protocol/agg).</Info>

### Hyperlink: Smart Payment Links

Hyperlink creates programmable payment surfaces.

* Generate payment links programmatically
* Embedded wallets, analytics, and social attribution
* See [Hyperlink](/protocol/hyperlink)

### sw4p: Cross-Chain USDC Movement

sw4p is the dedicated cross-chain USDC movement surface.

Use sw4p when your application needs USDC to move between supported chains without wrapped assets or liquidity-pool dependencies.

1. **Burn**: USDC is burned on the source chain
2. **Attest**: the engine observes and verifies the burn attestation
3. **Mint**: Native USDC is minted on the destination chain

**SDKs:**

* TypeScript: `@sw4p/sdk` ([docs.sw4p.io](https://docs.sw4p.io))
* Rust: `@sw4p/rs-sdk` ([docs.sw4p.io](https://docs.sw4p.io))
* Full docs: [sw4p Documentation Site](https://docs.sw4p.io)

## Real-Time Events (SSE)

Use SSE when your application needs live state without polling.

Subscribe to `GET /events` for a persistent SSE connection. Authentication follows the same SIWS session model as the REST API.

**Event categories:**

| Category    | Examples                                       |
| :---------- | :--------------------------------------------- |
| Gameplay    | `new_entry`, score updates, game state changes |
| Chat        | `chat_message`, moderation events              |
| Round state | Round transitions, winner announcements        |
| Rewards     | Claim events, epoch transitions                |
| System      | Burn events, system notifications              |

**Format:** `text/event-stream` with typed JSON payloads.

Reconnection should be handled client-side. Events are delivered in order within each category.

## Protocol Programs and Settlement Logic (Solana / Anchor)

The protocol includes Anchor-based Solana programs that handle on-chain settlement and reward distribution.

* **Rewards program**: `commit_epoch` → `fund_vault` → `claim_reward` pipeline
* **Merkle-tree distribution** for provable USDC payouts
* **PDA-based escrow** for tournament prizes and lottery pools
* **On-chain randomness** via Switchboard VRF for lottery draws

These programs handle the on-chain logic beneath the higher-level application surfaces. Most developers will interact with the REST API and SSE rather than calling these programs directly.

## Go Deeper

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference">
    Start integrating against the live endpoints.
  </Card>

  <Card title="Protocol Overview" icon="network-wired" href="/protocol/overview">
    Understand how verification, routing, and settlement fit together.
  </Card>

  <Card title="sw4p" icon="bridge" href="/sw4p">
    Build cross-chain USDC movement into your application.
  </Card>

  <Card title="Architecture" icon="sitemap" href="/architecture/overview">
    See how the system is wired across client, service, agent, and chain layers.
  </Card>
</CardGroup>

<Note>
  See also: [Security & Fairness](/guides/security-and-fairness) · [API Usage & Proxying](/guides/api-usage-and-proxying) · [Arcade Overview](/arcade/overview)
</Note>
