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

# The Proof Loop

> How paid gateway usage becomes signed receipts, an anchored Usage Root, a Builder Passport, and ecosystem income.

<img src="https://mintcdn.com/tokscale-giwa/PZ-qe7GbREC4q3PR/public/assets/proof-loop-diagram.png?fit=max&auto=format&n=PZ-qe7GbREC4q3PR&q=85&s=82207561c34d0924cd4914d67672d041" alt="One loop: usage → proof → identity → income." style={{display:'block',margin:'0 auto 2.5rem',width:'100%',maxWidth:'700px',borderRadius:'12px'}} width="2560" height="1440" data-path="public/assets/proof-loop-diagram.png" />

Tokscale is four product layers wired into a single loop. Each one consumes what the layer before it produced, and the last one feeds the third.

## 01 Tokscale Gateway

An OpenAI-compatible gateway (plus Anthropic Messages) where every request is paid on-chain via x402 and observed into an immutable request ledger. Three protocols, one model: `/v1/models` returns a single model object in every topology, and `/v1/models/:model` resolves only that native model ID. The gateway is what turns usage from self-reported into gateway-verified: it sees the traffic because it serves the traffic.

It is a Rust service fronting OpenAI chat and responses plus Anthropic messages with SSE streaming. It authenticates `tok_` bearer keys, routes to providers, prices deterministically, and writes every completed request into an append-only ledger protected by UPDATE-blocking triggers. It also terminates x402 payment: HTTP 402 challenges with body-aware maximum quotes, settled through a facilitator stack Tokscale ported to GIWA itself.

For detailed instructions, see [The Gateway and Its Workers](/gateway/service) and [x402 Payments on GIWA](/gateway/x402-payments).

## 02 Verified Usage

Every request gets an EIP-712 signed receipt off-chain (zero gas, zero latency, instantly verifiable). Once per epoch, the receipts fold into a single merkle root anchored on GIWA as one Usage Root attestation, one per builder subject per epoch. Per-request on-chain writes would scale cost linearly with traffic; the two-layer design does not.

Any single receipt stays provable down the chain: receipt → receiptRoot → leaf → Usage Root. The design borrows Dojang's own Balance Root commitment idiom, so the GIWA team can read it instantly. Usage climbs a five-tier evidence ladder: self-reported, consistency-checked, source-verified, gateway-verified, attested.

For detailed instructions, see [Verified Usage and the Evidence Ladder](/builder-passport/evidence-ladder), [UsageReceiptV1](/gateway/usage-receipt-v1), and [The Gateway and Its Workers](/gateway/service).

## 03 Builder Passport

Verified usage accrues into a portable record of how a developer works with AI: verified tokens, active days, per-model and per-harness skill signals, and the share of usage that is gateway-verified. The Passport is bound to a Dojang Verified Address and issued as EAS attestations, not ERC-721 tokens, so it cannot be sold or transferred. It exposes aggregates and proofs only: never prompts, code, or project content.

It binds one GitHub identity and one or more wallets to a single account, and renders at `/passport/[username]` as a shareable artifact carrying its own network and trust labels.

For detailed instructions, see [Builder Passport](/builder-passport/overview), [Dual Identity](/builder-passport/dual-identity), and [Dojang: On-Chain Attestations](/builder-passport/dojang).

## 04 Earn

The loop closes when verified identity converts to income: GIWA ecosystem projects (the GASOK cohort first) post bounties, verified builders apply with their Passport, and stablecoin payouts accrue back to the Passport as more proof. The model is proven: Superteam Earn and Base Builder Rewards have distributed \~\$10M+ to \~198K builders.

Earn is a Phase 2 mechanism. It appears here so the loop is legible end to end, not because any part of it ships today.

For the comparables behind this layer, see [Five Proven Patterns](/overview/market).

## How the loop is proven

The full loop (gateway, x402 payment, receipts, attestation pipeline, browser-rendered Passport) runs end to end as a hermetic local proof on localnet using Anvil fixtures. The harness target prints its markers on success:

```sh theme={null}
BUILDX_BUILDER=desktop-linux bun run local:e2e
# pass marker: "GIWA_LOCAL_E2E_OK"
# browser artifacts: "verified=receipt,passport,transactions"
```

<Info>
  Local and public evidence are never mixed. What is additionally proven on public GIWA Sepolia, with explorer links, is itemized on [Live Evidence](/overview/live-evidence).
</Info>

## Next steps

* For what one full harness pass covers, see [Gateway Overview](/gateway/overview).
* See how one request moves through five durable stages in [Gateway Overview](/gateway/overview).
* Understand what separates each tier of proof in [Verified Usage and the Evidence Ladder](/builder-passport/evidence-ladder).
* For what is verifiable on the public chain today, see [Live Evidence](/overview/live-evidence).
