WRIT Protocol on X@writnetwork on Twitterx.com/writnetworkwrit.networkWRIT Protocol official X account: @writnetworkFollow WRIT Protocol on X: https://x.com/writnetworkTwitter: @writnetwork · Website: writ.network
docs·WRIT Protocol
docs / overview

WRIT Protocol

Anonymous Know Your Agent (KYA) layer for Solana. Proves a human is behind a wallet without revealing who, bounds what agents can do under scoped delegations, and exposes a single CPI call for verification.

LayerProgramResponsibility
L4writ_gateExternal CPI surface. Packs state from L1–L3 into AgentStatus.
L3reputationBehavior scoring, 0–10,000. Staked dispute resolution.
L3delegationScoped permissions: program whitelist, budget, expiry, actions.
L1writ_registryZK verification, nullifier storage, soulbound identity token.

The problem

Autonomous agents on Solana already move real money. The infrastructure for what an agent can do is mature. The infrastructure for who is operating one is nonexistent.

Every agent is a black box. Counterparties cannot tell whether a wallet is backed by a human with reputational skin in the game, or by code with no owner and nothing to lose. Protocols that want to gate access — liquidity pools, airdrops, lending markets, matchmaking — have no primitive to check this without outsourcing to an off-chain identity provider.

What WRIT answers

Three questions, packed into one CPI return value:

Minimal integration

Any Anchor program can gate any instruction by adding one CPI. The return value is a 64-byte AgentStatus struct that fits in two scratch slots.

your_program/src/lib.rsrust
use anchor_lang::prelude::*;
use writ_gate::{cpi, program::WritGate, state::AgentStatus};

#[program]
pub mod your_program {
    use super::*;

    pub fn sensitive_swap(ctx: Context<SensitiveSwap>, amount_in: u64) -> Result<()> {
        // One CPI. One branch. No off-chain dependency.
        let status: AgentStatus = cpi::verify(
            CpiContext::new(
                ctx.accounts.writ_gate_program.to_account_info(),
                cpi::accounts::Verify {
                    agent: ctx.accounts.agent.to_account_info(),
                    gate_state: ctx.accounts.gate_state.to_account_info(),
                },
            ),
        )?.get();

        require!(status.is_valid, ErrorCode::NotHumanBacked);
        require!(status.score >= 500, ErrorCode::InsufficientReputation);
        require!(
            status.scope.allows(&ctx.program_id, amount_in),
            ErrorCode::OutOfScope,
        );

        do_swap(ctx, amount_in)
    }
}
NoteThe verify CPI is read-only. It never mutates WRIT state, so it composes safely inside atomic transactions and multi-CPI flows. If you need to atomically debit the scope budget, use verify_and_record instead.

Protocol specs

Chain
Solana (devnet live, mainnet pending)
Framework
Anchor 1.0
Runtime
SBPFv3, ~18–42k CU per verify, ~165k CU per register
ZK system
Groth16 over BN254 (alt_bn128 syscall)
Nullifier
Poseidon(secret, domain), 32 bytes
Identity token
Token-2022 NonTransferable, supply 1
Max delegations per writ
5
Max delegation duration
90 days

Design commitments

Privacy is not optional

The registry stores one field per human: a Poseidon nullifier. It cannot be reversed to a wallet, a device, or a real-world identity. Proofs are generated in the browser; only the proof and the nullifier commitment ever touch the chain. No biometric data is collected.

No off-chain oracle

The verifier runs on-chain via Solana's alt_bn128_pairing syscall. There is no external signer, no rollup, no trusted enclave. If Solana is live, verification works.

Delegation is bounded by default

An agent never gets a blank check. Each delegation carries four constraints (programs, SOL budget, expiry, action mask) and is revocable in one transaction. Five concurrent delegations per writ caps the blast radius of a compromised human.

Reputation is earned, not declared

The 0–10,000 score is computed from behavior reports submitted by other programs. Disputes use staked resolution. Age weighting rewards longevity up to 1.5× at 180 days.

Where to go next

Quickstart — gate one instruction in five minutes.

Concepts — why KYA is a distinct primitive from KYC.

Architecture — the four programs, their PDAs, and the CPI flow in detail.

Deployments — devnet program IDs and RPC config.