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

# Deploy the account now (normally lazy with the first op)

> Bearer-enforced server-side (requireSmartWallet: 401 without bearer, 403 unless bearer == path address — src/lib/server/smart-wallets.ts:24-31). The spec's v0.3.0 `security: []` underclaimed enforcement (R4-2). The residual risk (bearer forgery — the token IS the address string) is disclosed once in x-auth-posture, not per-path. Deployment is a REAL EntryPoint op (always on-chain — labeled anyway, R4-23).



## OpenAPI

````yaml /mvp-spec-v0.4.7.yaml post /api/wallets/smart/{address}/deploy
openapi: 3.1.0
info:
  title: Skia Agentic Settlement API
  version: 0.4.7
  contact:
    name: Skia
    url: https://skia.money
  description: >
    Multi-chain agent-facing settlement: free quotes + commit/reveal settlement

    with equivocation-binding via AirSwap SwapERC20, on twelve app-chain keys —
    EIGHT live

    (ethereum, arbitrum, base, robinhood, mantle, ink, xlayer, monad — each
    backed by a

    deterministic canonical TESTNET deployment; monad's was REPRODUCED
    2026-11-19 from the

    recovered salts/initcodes by a wallet that never held the original deployer
    key; its

    registry row lands with the desk's tx hashes in v0.4.6) and FOUR dormant
    (taiko, bsc,

    polygon, hyperevm — wire-accepted for backward compatibility; hyperevm is
    STAGED with

    its deployment pre-verified in simulation; all dormant keys are refused

    client-side by the SDK). Tokens are TWO-TIER: seven accepted symbols, of

    which exactly two (USDC, DAI → MockUSDC, MockDAI) are canonically deployed

    and settlement-real. Smart wallets settle as ERC-4337 UserOperations

    sponsored by SkiaPaymaster; the EOA path remains the escape hatch. The

    read-only Capital State Registry (`GET /api/registry`, schema v0.2.0 — the

    capability-graph declaration extension per the 2026-11-23 dossier, RFC

    v0.1.0 + RA-1..RA-7 + CG rules R-CG1..R-CG5) is LIVE since v0.4.4: public

    attested reads (ETag = payloadHash), reads NEVER gate — phase gating AND

    activation-tier gating live on execution paths only, and non-SWAP route

    classes plus dormant F0/F1 capability rows still carry

    executableNow:false until their gates open. LAUNCH SEQUENCE (operator
    decision 2026-11-19, updated

    v0.4.5): X Layer (settle-verified x3 multi-asset) -> Ink (one funding wave

    from its verification run) -> Robinhood (SETTLE-VERIFIED — 1 TSLA <-> 1

    AMZN + a sponsored 4337 userOp) -> Monad (deployed + rehearsal battery

    green 2026-11-19; gas-priced out of the cheap tier — own schedule, 27,300

    transfers, PVG charged in full never refunded), then Arbitrum/Base; Mantle

    stays CONDITIONAL on non-fee grounds (its measured fee posture — 50 gwei

    flat, ~0.0073 MNT per approve+swap, ~$0.0028/settle — already justifies it

    by our own corrected numbers; the deferral is attention budget and flow

    prioritization, and PROMOTION is an open operator decision); Ethereum

    last. HyperEVM is staged behind them (0.1 gwei, pre-furnished, deployment

    pre-verified in simulation; one operator faucet claim from firing).

    v0.4.0 "Tetrad": settlement is receipt-verified END-TO-END through the live

    API on FOUR sepolia-family lanes (mantle, base, ethereum, arbitrum) — see

    info.x-testnet.settleVerification. v0.4.1: the API base URL is

    https://api.skia.money (operator-owned Cloudflare zone skia.money) — the

    api.talos.xyz base carried by earlier specs was erroneous and is retired.

    v0.4.2 (external round-3 triage, docs-intel — wire unchanged): LAYER

    GUARANTEES stated plainly — the on-chain contract has NO commit step, so

    commit/reveal (equivocation-binding, NOT mempool shielding) is an

    API-layer property: the protocol's MEV posture is exactly as strong as

    the API's availability and honesty, and direct swap() settlers get

    atomic settlement without it. The AUTHORIZATION MODEL is a first-class

    feature: open wallet-keyed delegation (authorizeSigner for session keys

    and custodians, authorizeSender for relayers and agents; swapAnySender

    needs no link) — non-relayer makers can settle directly; the API is an

    accelerator, not a gatekeeper. See the SwapERC20 note in

    info.x-testnet.contracts for the UNAUTHORIZED-overload disclosure, the

    check() preflight forward contract, and

    docs/settlement-interface-reference.md for the EIP-712 types + ABI.


    CONFIDENTIALITY HONESTY (R4-10): the commit body carries ALL NINE preimage

    fields in plaintext — commit/reveal binds an intent to a taker under an

    expiry window (equivocation-binding); it does NOT hide order details and is

    NOT an MEV-shielding mechanism. The withheld pieces are the makerSignature,

    the AirSwap order nonce, and protocolFee.


    ### Invoice surface (v0.4.7 — the round-12 forward contract, SERVED by
    round-13)

    v0.4.7 specs the Invoice capability
    (docs/ops/invoice-thesis-intake-2026-11-29.md:

    Kimi dossier x Gemini review, adopted with corrections — the lock layer, cut

    before any code). An invoice is NOT an Order: it is an OFF-CHAIN,

    signature-acknowledged obligation (InvoiceClaim, EIP-712) that RESOLVES into

    existing Orders and settles through the UNCHANGED swap() rail; the
    append-only

    event ledger is the only new trust assumption, and every state-changing act
    is

    a signature + an event. TWO CLOCKS: an Order's expiry is 10-minute
    settlement

    liveness; a claim's dueAt is claim maturity — a unix-seconds timestamp,
    never a

    block number. The settlement mapping is 1->N: an invoice maps to a LIST of

    payment attempts (the same idempotency key returns the SAME attempt — a
    retry

    never burns a second nonce; a fresh nonce per attempt is never reused).
    Status

    is a PURE FOLD over the event list, never stored: payments reduce principal

    only; credit notes reduce principal only; the late fee is a non-compounding

    read-time accrual on outstanding − disputed — fees never consume payments in

    Phase 1, and on-chain late-fee enforcement is NEVER in the current contract

    set. The ISSUANCE GATE is application-layer policy that CONSUMES

    registry-encoded jurisdiction restrictions (the registry ENCODES and does
    NOT

    ENFORCE — the v0.2.0 posture is unchanged): absent -> allow + flag; stale ->

    treat as absent; transport failure -> allow + flag — degradation is loud,
    and

    no non-restricted issuance is ever misfired against. DEFAULT is an ASSERTED

    issuer signal after grace, not cryptographic proof of non-payment (the
    debtor

    may have paid on a rail outside the issuer's view). SERVED (round-13, (A)):

    the forward contract was honored — specced 2026-11-29 before any code,
    SERVED

    2026-11-30 by work-order steps 2-5; the /v1 paths answer real traffic (the

    501 PHASE_GATED posture survives ONLY for templateId swap-sponsored), and

    production ship rides the X Layer mainnet release as planned. Phase 2
    (SECURED

    escrow via SkiaAccount, on-chain hash anchoring, negotiation transcripts,

    receivable transfer) waits on exactly one external gate: a sponsored 4337

    settle receipted end-to-end through a PUBLIC bundler (ERC-7562) — direct-RPC

    does not satisfy it.


    ### Wire-stability rules (do not regress)

    - No renames of live fields. `unsignedIntent` stays the wire name (the SDK
      type is honestly `MakerIntent` — the object carries the maker signature).
    - Deprecate, never remove: retired fields are flagged, with a removal
      target, not deleted.
    - `info.x-testnet` is a GENERATED block (`bun run spec:sync-testnet`) —
      never hand-edit it.
    - `info.x-error-codes` is a GENERATED block from the server error registry
      (`bun run spec:sync-error-codes`; CI drift check `bun run spec:check-drift`)
      — never hand-edit it (qwen round-4 addition 2: generation prevents the
      next invented code permanently).
    - Forward contracts (`PHASE_GATED`, `settlementMode`, `/api/registry`, the
      v0.4.7 `/v1` invoice surface) are specced before the features activate, so
      agents code against them once.

    ### Deliberately KEPT from v1.6.3 despite "minimize" pressure

    - Idempotency-Key on /api/commit and /api/reveal (the two state-creating
      steps; a retried reveal without a key can double-settle against the same
      commitment and lose funds).
    - 410 COMMIT_EXPIRED (commits expire by design; agents must handle it).

    - Minimal Error schema with retryable flag (agents need it to decide
      between retrying and aborting).
    - Full 9-field CommitRequest (commitmentHash must have a well-defined
      preimage the server can recompute from the paired reveal; this was the
      v1.6.3 fix — do not regress it).
    - QuoteResponse echoes the request and carries the exact uint256
      settlement fields so agents can build CommitRequest without keeping
      request state.
  x-mvp-validation-checklist:
    - >-
      Agents can GET /api/quote with no account and build a CommitRequest from
      the zero-sender response alone (senderWallet signed as 0x0; bearer-bound
      quotes additionally bind the bearer)
    - >-
      Reveal settles exactly once per commitId — a SERVER invariant
      (transactional claim-before-execute, SV-2 LANDED 2026-11-18: guarded
      status claim before any settlement, release-on-failure, TTL reclaim; the
      check-then-act gap is CLOSED). Idempotency-Key is a response-replay aid,
      NOT the correctness mechanism
    - Expired commit deterministically returns 410, never settles
    - >-
      Dormant chain keys are refused honestly (SDK-side) and settle nowhere
      server-side
    - >-
      Simulated settlements are labeled on the wire (onChain/settlementMode);
      never explorer-linked
    - >-
      Settlement spread (fee) is the only Phase-1 revenue path; Edge x402-style
      payment is the paid-lane option
    - >-
      (invoice forward contract) An acknowledged invoice's receivable view is a
      PURE FOLD over the append-only event list — status is never stored;
      payments and credit notes reduce principal only; the late fee is a
      read-time accrual that never consumes payments; the same payment
      idempotency key never burns a second nonce; DEFAULT is asserted, not
      proven
  x-auth-posture:
    decision: keep-bearer-for-testnet
    current:
      scheme: ethSigAuth
      format: 'Authorization: Bearer 0x<walletAddress>'
      note: >-
        Simulated ethereum-signature bearer (address-as-identity). GET
        /api/quote, /api/layer-info, /api/commitment-hash and /api/registry are
        anonymous. Bearer enforcement is per-endpoint (server truth,
        src/lib/server/auth.ts + src/lib/server/smart-wallets.ts
        requireSmartWallet): GUARDED set = commit, reveal, tier (self-scoped
        403), payment/verify, webhook subscriptions, POST
        /api/wallets/smart/{address}/userops, POST .../session-keys (+DELETE),
        POST .../deploy — the smart-wallet write surfaces enforce bearer == path
        address (401 without bearer, 403 on mismatch). UNGUARDED set (by
        decision, testnet): GET /api/wallets/{address}, GET
        /api/wallets/{address}/orders, GET /api/wallets/smart/{address}, POST
        /api/wallets/{address}/faucet — faucet is an anonymous WRITE that
        triggers real on-chain relayer transfers on the backed chain (griefing
        vector, posture decision SV-1). The residual risk on the GUARDED set is
        bearer forgery: the token IS the address string (auth.ts:4-14, regex
        check only), so bearer == path enforcement is cosmetic against a forger.
        Disclosed here ONCE, not per-path (R4-2). Address-scoped endpoints that
        DO check return 403 FORBIDDEN on owner mismatch. CLAIM-1: every sentence
        above cites the server file it describes; the server, not this block, is
        the authority.
    deferred:
      feature: SIWE (EIP-4361) + real signature-verified bearers
      version: v1.7.0
      rationale: >-
        Agents are non-interactive; static credentials fit machine-to-machine
        access. CORRECTED (R4-1 — the v0.3.0 rationale was false on the working
        custody path): the EIP-712 Order signature verified on-chain by
        SwapERC20 is the MAKER's authorization only. Taker-side authorization is
        the API credential itself: on every custody path the taker key is the
        server-custodial wallet key, so a forged bearer CAN drive commit/reveal
        or userops against someone's wallet — the attacker simply supplies their
        own maker signature (an order offering their own address favorable
        terms), and SwapERC20 executes the transfers. "A leaked bearer alone
        cannot move tokens" was wrong as stated; it holds only where the user
        holds their own signer. Custody encryption-at-rest + real signature auth
        (this upgrade) is what actually closes it — hardening-queue version
        target v1.7.0 (rides the SIWE cut).
    not-auth:
      - >-
        X-Integrator-Id (attribution metadata only; ignored by the Sovereign
        layer)
      - x402 payment proofs (payment axis, separate from identity)
    reference: docs/auth-posture-testnet.md
  x-token-tiers:
    canonical:
      tokens:
        - symbol: USDC
          registryName: MockUSDC
          decimals: 6
        - symbol: DAI
          registryName: MockDAI
          decimals: 18
      note: >-
        Deployed in the canonical testnet registry — the ONLY settlement-real
        assets. PaymentGuard.allowedAssets is pinned to this tier.
        isCanonicalTestnetToken(symbol) is the SDK predicate.
    accepted-undeployed:
      symbols:
        - USDT
        - USDS
        - GHO
        - LUSD
        - PYUSD
      note: >-
        Quote-valid symbols (the accepted set). Synthetic addresses on the
        simulated surface; NO on-chain balance anywhere. A quote that accepts
        one of these settles in DB simulation by definition.
    warning: >-
      Testnet "USDC" is MockUSDC (Skia's own mock), not Circle's USDC. NEVER
      bridge mainnet assets to any address in this deployment.
  x-error-codes:
    generated: >-
      GENERATED BLOCK — do not hand-edit. Source:
      src/lib/server/error-registry.ts via bun run spec:sync-error-codes (CI
      drift check: bun run spec:check-drift). Rows cite the server files that
      emit them (CLAIM-1).
    retired: >-
      RETIRED ROWS (tombstones): WALLET_NOT_SMART@rest — REST never emitted it —
      NOT_A_SMART_WALLET is the REST code; WALLET_NOT_SMART survives as the MCP
      alias row. | INSUFFICIENT_PAYMASTER_DEPOSIT — Never emitted by any server
      path — an invention of the v0.3.0 table itself (MCP-2). The real code is
      SPONSOR_DEPOSIT_LOW 503 retryable.
    validation:
      - code: DORMANT_CHAIN
        status: 400
        retryable: false
        when: >-
          RESERVED — server-side rejection for dormant keys (taiko/bsc/polygon).
          The SDK refuses client-side today (assertQuoteInput); the server
          posture is a follow-up decision. Dormant keys currently fall through
          to honest simulated-label behavior.
        cites:
          - (reserved forward contract)
        entryStatus: reserved
      - code: INVALID_AMOUNT
        status: 400
        retryable: false
        when: amountIn is not a positive decimal string.
        cites:
          - src/app/api/quote/route.ts
        entryStatus: live
      - code: INVALID_EXPIRY
        status: 400
        retryable: false
        when: commitmentExpiry is neither a valid ISO date-time nor unix seconds.
        cites:
          - src/app/api/commit/route.ts
        entryStatus: live
      - code: INVALID_JSON
        status: 400
        retryable: false
        when: Body is not valid JSON.
        cites:
          - src/app/api/quote/route.ts
          - src/app/api/commit/route.ts
          - src/app/api/reveal/route.ts
          - src/app/api/commitment-hash/route.ts
        entryStatus: live
      - code: INVALID_PARAM
        status: 400
        retryable: false
        when: >-
          Malformed query/body (bad chain key, token symbol, amount, hex,
          address, calls array).
        cites:
          - src/app/api/quote/route.ts
          - src/app/api/commit/route.ts
          - src/app/api/reveal/route.ts
          - src/app/api/commitment-hash/route.ts
          - src/lib/server/chain/balances.ts
        entryStatus: live
      - code: MISSING_PARAM
        status: 400
        retryable: false
        when: Required query parameter(s) absent (names listed in the message).
        cites:
          - src/app/api/quote/route.ts
        entryStatus: live
      - code: SAME_TOKEN
        status: 400
        retryable: false
        when: tokenIn and tokenOut are identical.
        cites:
          - src/app/api/quote/route.ts
        entryStatus: live
      - code: UNSUPPORTED_TOKEN
        status: 400
        retryable: false
        when: >-
          A token symbol/address does not resolve to a supported token on the
          relevant chain.
        cites:
          - src/app/api/quote/route.ts
          - src/app/api/commit/route.ts
          - src/app/api/reveal/route.ts
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/provisioning.ts
          - src/lib/server/chain/balances.ts
        entryStatus: live
      - code: QUOTE_BELOW_SPREAD_FLOOR
        status: 500
        retryable: false
        when: >-
          Fail-closed revenue-envelope guard: the built quote's realized net
          spread fell below the configured floor — quote refused (a subsidizing
          quote is not expressible by construction; this trips only on a
          code/config regression).
        cites:
          - src/lib/server/quote-math.ts
        entryStatus: live
    commit-reveal:
      - code: ALREADY_REVEALED
        status: 400
        retryable: false
        when: >-
          This commitId was already revealed — NEVER 409 (the MCP schema once
          said 409; the HTTP API says 400, and this table is the contract). SV-2
          LANDED 2026-11-18: once-only is a transactional claim-before-execute
          (guarded updateMany); losers — including the in-flight window (status
          settling) — get this 400. Distinct from NONCE_ALREADY_USED (409),
          which is the ON-CHAIN revert when the order nonce itself was consumed.
        cites:
          - src/app/api/reveal/route.ts
          - src/app/api/mcp/route.ts
        entryStatus: live
      - code: COMMIT_ATTEMPT_MISMATCH
        status: 400
        retryable: false
        when: >-
          Attempt-bound reveal: the commitment is not bound to the presented
          attemptId (the commit must carry the same attemptId the intent
          minted).
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: COMMITMENT_HASH_MISMATCH
        status: 400
        retryable: false
        when: >-
          commitmentHash does not match the committed fields — compute it via
          POST /commitment-hash (keccak256 over the EVM-encoded preimage) or
          re-derive locally; the commit and its hash must agree before the
          commitment is accepted.
        cites:
          - src/app/api/commit/route.ts
        entryStatus: live
      - code: HASH_MISMATCH
        status: 400
        retryable: false
        when: >-
          Revealed order does not match the commitment (hash recomputation
          failed over the stored commitNonce + commitmentExpiry).
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: IDEMPOTENCY_REUSED
        status: 400
        retryable: false
        when: >-
          An Idempotency-Key was replayed with a DIFFERENT body or caller than
          its first use (SV-3 LANDED 2026-11-18). Same-key-same-body replays are
          answered from the stored response (scope = one logical reveal, TTL =
          the commitment's lifetime). The once-only invariant is the SV-2
          transactional claim — the key is a response-replay aid, never the
          correctness mechanism.
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: INSUFFICIENT_BALANCE
        status: 400
        retryable: false
        when: >-
          Taker balance cannot cover senderAmount (or the taker transfer failed
          on-chain).
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: ORDER_SENDER_MISMATCH
        status: 400
        retryable: false
        when: >-
          order.senderWallet does not match the signed sender. Sender-bound
          quotes only — the zero-sender form (senderWallet 0x0 as-signed) is
          exempt (SV-6b LANDED 2026-11-18): it commits as-signed, the commitment
          binds commitId → authenticated bearer, and reveal authenticates the
          BINDING, not the sender field; the binding bearer's key settles via
          swapAnySender().
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: ORDER_SIGNATURE_INVALID
        status: 400
        retryable: false
        when: >-
          The maker signature is missing/invalid for the revealed fields, or no
          signed quote is bound to the commitment.
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: QUOTE_EXPIRED
        status: 400
        retryable: false
        when: The referenced quote has expired before commit.
        cites:
          - src/app/api/commit/route.ts
        entryStatus: live
      - code: QUOTE_MISMATCH
        status: 400
        retryable: false
        when: >-
          Committed fields do not match the referenced quote's signed order
          (tokens, amounts, or expiry).
        cites:
          - src/app/api/commit/route.ts
        entryStatus: live
      - code: SETTLEMENT_REQUIRES_CUSTODIAL_WALLET
        status: 400
        retryable: false
        when: >-
          On-chain settlement on the active network needs a server-custodial
          testnet wallet (a real key that can sign the settlement transaction);
          legacy simulated wallets can still trade on the other chains.
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: SIGNER_MISMATCH
        status: 400
        retryable: false
        when: >-
          signerWallet is not the Skia relayer (maker) — orders signed by anyone
          else are not settleable through this API.
        cites:
          - src/app/api/commit/route.ts
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: UNSUPPORTED_SIGNATURE_TYPE
        status: 400
        retryable: false
        when: signatureType is not 0 (EIP-712).
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: COMMIT_NOT_FOUND
        status: 404
        retryable: false
        when: No commitment exists for the given commitId.
        cites:
          - src/app/api/reveal/route.ts
          - src/app/api/mcp/route.ts
        entryStatus: live
      - code: QUOTE_NOT_FOUND
        status: 404
        retryable: false
        when: The quoteId referenced by a commit does not exist.
        cites:
          - src/app/api/commit/route.ts
          - src/app/api/mcp/route.ts
        entryStatus: live
      - code: NONCE_ALREADY_USED
        status: 409
        retryable: false
        when: >-
          The signed order's nonce is already consumed on-chain — the taker
          self-settled first (the advertised exit capability). commitId is
          burned; the agent re-quotes. This is the on-chain revert path,
          DISTINCT from ALREADY_REVEALED (400, commit-state).
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: COMMIT_EXPIRED
        status: 410
        retryable: false
        when: >-
          revealDeadline passed (or the order expired on-chain: EXPIRY_PASSED) —
          never settles; agent must re-quote.
        cites:
          - src/app/api/reveal/route.ts
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: SETTLEMENT_REVERT
        status: 500
        retryable: false
        when: >-
          SwapERC20/SkiaAccount rejected the settlement with an unmapped revert
          reason.
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: UNSUPPORTED_TOKEN
        status: 500
        retryable: false
        when: >-
          500 VARIANT (inventory provisioning context): a token address is not
          part of the active network deployment while provisioning relayer
          inventory — operator-visible, not agent-recoverable. Distinct from the
          400 variant (agent-facing quote/commit/reveal validation).
        cites:
          - src/lib/server/chain/provisioning.ts
        entryStatus: live
      - code: APPROVAL_FAILED
        status: 502
        retryable: true
        when: Token approval to SwapERC20 reverted before settlement.
        cites:
          - src/lib/server/chain/settlement.ts
        entryStatus: live
      - code: SETTLEMENT_FAILED
        status: 502
        retryable: false
        when: >-
          On-chain settlement reverted (receipt not 0x1) or the settlement
          transaction failed.
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: RELAYER_INVENTORY
        status: 503
        retryable: true
        when: >-
          Relayer (maker) token transfer failed on-chain — maker inventory
          problem. Retryable after the relayer self-faucets.
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
    phase-gating:
      - code: PHASE_GATED
        status: 501
        retryable: false
        when: >-
          RESERVED forward contract — route class not yet executable in the
          active phase. details: { routeClass, earliestPhase }. Single code —
          phase lives in details, never in new error codes (R7). Phase-1 trigger
          set is EMPTY (R4-16): every /api/commit body is SWAP-class until
          registry routes activate.
        cites:
          - (reserved forward contract)
        entryStatus: reserved
    custody-sponsored:
      - code: NOT_A_SMART_WALLET
        status: 400
        retryable: false
        when: >-
          Taker is not an ERC-4337 SkiaAccount (sponsored lane requires
          walletType 'smart'). REST emits this code; the MCP layer emits
          WALLET_NOT_SMART for the same condition.
        cites:
          - src/lib/server/smart-wallets.ts
        entryStatus: live
      - code: SESSION_TOKEN_CAPS_REQUIRED
        status: 400
        retryable: false
        when: >-
          Session-key issuance without per-token 24h caps (SkiaAccount v4 fails
          closed on swap-shaped calls without them — caps are mandatory at
          issuance). NOTE (v0.4.5): unreachable via REST
          /api/wallets/smart/{address}/session-keys — the route ALWAYS binds
          caps (dailyTokenLimit default 250.0 applied to every settlement token;
          request body accepts it). Guards the lib entry for direct callers and
          misconfig (e.g. a network config with zero tokens).
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: SMART_WALLET_NOT_CUSTODIAL
        status: 400
        retryable: false
        when: >-
          The smart wallet has no server-custodial owner key (testnet-only
          routes).
        cites:
          - src/lib/server/smart-wallets.ts
        entryStatus: live
      - code: SPONSOR_POLICY_REJECTED
        status: 403
        retryable: false
        when: >-
          Gas sponsorship policy rejected the operation on-chain (EP AA34/AA30)
          — only SwapERC20 settlement calls (and their approvals), 0-value
          self-management, and deploy-only ops are sponsorable by
          SkiaDefaultPolicy.
        cites:
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
      - code: SESSION_KEY_NOT_FOUND
        status: 404
        retryable: false
        when: No session key with the given id on the given wallet (revoke path).
        cites:
          - src/app/api/wallets/smart/[address]/session-keys/[id]/route.ts
        entryStatus: live
      - code: WALLET_NOT_FOUND
        status: 404
        retryable: false
        when: >-
          No wallet for the requested address (requireSmartWallet + GET
          /api/wallets/{address}).
        cites:
          - src/lib/server/smart-wallets.ts
        entryStatus: live
      - code: FAUCET_COOLDOWN
        status: 429
        retryable: true
        when: Faucet limited to once per 30s per wallet (Retry-After present).
        cites:
          - src/app/api/wallets/[address]/faucet/route.ts
        entryStatus: live
      - code: SPONSOR_QUOTA_EXCEEDED
        status: 429
        retryable: false
        when: >-
          Daily gas sponsorship quota exceeded for the wallet (resets 00:00
          UTC).
        cites:
          - src/app/api/wallets/smart/[address]/userops/route.ts
        entryStatus: live
      - code: SESSION_POLICY_FAILED
        status: 500
        retryable: false
        when: >-
          500 VARIANT (operator-visible misconfiguration, surfaced in the
          Task-45 session-maker batching): the deployment registry carries no
          relayer address, so the session maker allowlist cannot be bound —
          distinct from the 502 on-chain revert variant.
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: SMART_WALLET_CORRUPT
        status: 500
        retryable: false
        when: Smart wallet row is missing its accountSalt (data integrity failure).
        cites:
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: SPONSOR_MISCONFIGURED
        status: 500
        retryable: false
        when: >-
          SKIA_PAYMASTER_SIGNER_KEY is not configured (operator error, not
          agent-recoverable).
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: DEPLOY_FAILED
        status: 502
        retryable: false
        when: Account deployment (lazy or explicit) reverted on-chain.
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: SESSION_POLICY_FAILED
        status: 502
        retryable: false
        when: setSessionPolicy reverted on-chain while issuing a session key.
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: SESSION_REVOKE_FAILED
        status: 502
        retryable: false
        when: revokeSessionKey reverted on-chain.
        cites:
          - src/lib/server/chain/smart-account.ts
        entryStatus: live
      - code: SPONSOR_DEPOSIT_LOW
        status: 503
        retryable: true
        when: >-
          Sponsored lane cannot pay gas — SkiaPaymaster EP deposit too low (EP
          AA31). Retry after the sponsor funding run (contracts:fund-paymaster).
          NOTE: v0.3.0's table row INSUFFICIENT_PAYMASTER_DEPOSIT never existed
          in code — renamed per MCP-2 discipline (R4-6/R4-12).
        cites:
          - src/lib/server/chain/aa-revert.ts
        entryStatus: live
    transport:
      - code: UNAUTHORIZED
        status: 401
        retryable: false
        when: Bad or missing bearer.
        cites:
          - src/lib/server/auth.ts
          - src/lib/server/smart-wallets.ts
        entryStatus: live
      - code: PAYMENT_REQUIRED
        status: 402
        retryable: true
        when: >-
          Edge paid quote without a consumable payment — X-Payment-Request
          carries the SkiaPaymentRequest.
        cites:
          - src/app/api/quote/route.ts
        entryStatus: live
      - code: FORBIDDEN
        status: 403
        retryable: false
        when: >-
          Owner mismatch on an address-scoped endpoint that enforces it (tier
          self-scope; smart-wallet bearer==path; commit sender≠bearer —
          commit/route.ts:72-74).
        cites:
          - src/lib/server/auth.ts
          - src/lib/server/smart-wallets.ts
          - src/app/api/commit/route.ts
        entryStatus: live
      - code: PAYMENT_NOT_FOUND
        status: 404
        retryable: false
        when: payment/verify referenced an unknown paymentId.
        cites:
          - src/app/api/payment/verify/route.ts
        entryStatus: live
      - code: SUBSCRIPTION_NOT_FOUND
        status: 404
        retryable: false
        when: >-
          No webhook subscription with the given id for this agent (delete path;
          server answers 204 on success, not 200 — the v0.3.0 spec said 200,
          fixed per MCP-2).
        cites:
          - src/app/api/webhook/subscriptions/[subscriptionId]/route.ts
        entryStatus: live
      - code: RATE_LIMITED
        status: 429
        retryable: true
        when: >-
          Layer burst/day limit exceeded (Retry-After present). Commit: 1000/60s
          (commit/route.ts:51-57); Sovereign quote per-Tor-circuit; Edge quote
          100/min; Registry read: 100/min per IP (registry/route.ts — public
          reads, honest 429). Reveal throttle is queued (SV-4) — the 429
          response is pre-declared on /api/reveal per the forward-contract rule.
        cites:
          - src/app/api/commit/route.ts
          - src/app/api/quote/route.ts
          - src/app/api/registry/route.ts
          - src/lib/server/rate-limit.ts
        entryStatus: live
      - code: INTERNAL
        status: 500
        retryable: false
        when: Unexpected server error (smart-wallet route catch-all).
        cites:
          - src/lib/server/smart-wallets.ts
        entryStatus: live
      - code: NOT_IMPLEMENTED
        status: 501
        retryable: false
        when: >-
          Feature-flagged surface (rebate is the live example — v1.8.0). Webhook
          DELIVERY is the second honest example: subscriptions store, no
          dispatcher exists (SV-9).
        cites:
          - src/app/api/rebate/route.ts
        entryStatus: live
      - code: BUNDLE_INCOMPLETE
        status: 502
        retryable: true
        when: >-
          handleOps confirmed but no UserOperation event was emitted for this
          op.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
      - code: BUNDLE_MALFORMED
        status: 502
        retryable: true
        when: External bundler returned no userOpHash.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
      - code: BUNDLE_REJECTED
        status: 502
        retryable: true
        when: External bundler rejected the op.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
      - code: BUNDLE_REVERTED
        status: 502
        retryable: true
        when: handleOps reverted on-chain for the submitted UserOperation.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
      - code: BUNDLE_UNREACHABLE
        status: 502
        retryable: true
        when: External bundler unreachable.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
      - code: CHAIN_UNAVAILABLE
        status: 503
        retryable: true
        when: >-
          RPC/contract unreachable (settlement, balances, account factory,
          EntryPoint, paymaster reads). Retry with backoff.
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/chain/smart-account.ts
          - src/lib/server/chain/bundler.ts
          - src/lib/server/chain/balances.ts
        entryStatus: live
      - code: BUNDLE_TIMEOUT
        status: 504
        retryable: true
        when: >-
          External bundler accepted the op but no EntryPoint event arrived
          within 60s.
        cites:
          - src/lib/server/chain/bundler.ts
        entryStatus: live
    invoice:
      - code: INVOICE_AMOUNT_INVALID
        status: 400
        retryable: false
        when: >-
          Face/credit/disputed amount is not a positive integer in atomic units
          (floats never touch money on the invoice surface).
        cites:
          - src/lib/server/invoice-fold.ts
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_CHAIN_NOT_ACTIVE
        status: 400
        retryable: false
        when: >-
          ACTIVE-CHAIN RULE (Phase 1, Gemini sharp check 1): the claim's
          settleChainId is not the service's ONE active settlement chain (the
          release chain — X Layer at ship); refused at ISSUE with the active
          chain named in the message. No per-request cross-chain routing exists
          in Phase 1 (Phase 2 introduces an explicit routing table).
        cites:
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/payment-intent.ts
        entryStatus: live
      - code: INVOICE_CURRENCY_UNSUPPORTED
        status: 400
        retryable: false
        when: >-
          Claim currency is not a settlement-accepted symbol on settleChainId
          (registry-attested rows only).
        cites:
          - src/lib/server/payment-intent.ts
        entryStatus: live
      - code: INVOICE_SIGNATURE_INVALID
        status: 400
        retryable: false
        when: >-
          EIP-712 verification failed: bad signature, wrong domain (D-INV-1), or
          the recovered address is not the claimed party.
        cites:
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/payment-intent.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_STATE_INVALID
        status: 400
        retryable: false
        when: >-
          Request-context invoice-state refusal: committed/revealed order fields
          fail the attempt's payment template law on the commit/reveal lanes
          (the round-13 two-tier convention — B-3: template law answers 400,
          fold/machine violations answer 409; terminal invoice intent is 409,
          never 400).
        cites:
          - src/app/api/commit/route.ts
          - src/app/api/reveal/route.ts
        entryStatus: live
      - code: INVOICE_TERM_INVALID
        status: 400
        retryable: false
        when: >-
          Claim terms fail validation (dueAt <= issuedAt, negative grace,
          lateFeeBpsPerDay outside 0..10000, memo/externalRef over length,
          swap-convert without paymentCurrency).
        cites:
          - src/lib/server/invoice-fold.ts
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/payment-intent.ts
        entryStatus: live
      - code: SIGNING_REQUIRES_CUSTODIAL_WALLET
        status: 400
        retryable: false
        when: >-
          The custodial DEMO signing path needs the debtor's server-custodial
          TESTNET key; external agents sign their own Order and POST the bind
          path /v1/invoices/{invoiceId}/payments/{attemptId}/order (or its
          app-lane twin /api/.../order). Parented round-13 (B-5/B-1: the
          custodial lane is declared with its TESTNET-only boundary).
        cites:
          - src/app/api/invoices/[invoiceId]/payments/sign/route.ts
        entryStatus: live
      - code: INVOICE_PARTY_MISMATCH
        status: 403
        retryable: false
        when: >-
          Signature or bearer does not match the acting party (issuer-only /
          debtor-only surfaces; the desk-relayer sender law on the invoice
          settlement lane).
        cites:
          - src/lib/server/chain/settlement.ts
          - src/lib/server/invoice-fold.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_NOT_FOUND
        status: 404
        retryable: false
        when: Unknown invoiceId (or attemptId).
        cites:
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/payment-intent.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_CLAIM_HASH_MISMATCH
        status: 409
        retryable: false
        when: >-
          Countersignature verifies against a digest that is not the issued
          claim's claimHash.
        cites:
          - src/lib/server/invoice-fold.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_ID_EXISTS
        status: 409
        retryable: false
        when: >-
          invoiceId already used by a DIFFERENT claim; the same-claim replay
          returns the same record (idempotent by claimHash).
        cites:
          - src/lib/server/invoice-ledger.ts
        entryStatus: live
      - code: INVOICE_IDEMPOTENCY_CONFLICT
        status: 409
        retryable: false
        when: >-
          Same Idempotency-Key with a different payload (R-1: the same key MUST
          return the same attempt; a different payload is a client bug).
        cites:
          - src/lib/server/invoice-ledger.ts
        entryStatus: live
      - code: INVOICE_STATE_INVALID
        status: 409
        retryable: false
        when: >-
          Transition not allowed from the current fold state or the attempt
          machine (ack after reject, credit note above outstanding, dispute
          above outstanding, DEFAULT before dueAt + grace, terminal-attempt
          receipt/bind, terminal invoice intent, VOID after a partial payment —
          round-13 G-2, and the expired 10-minute intent window — round-13
          realigned 410 -> 409: the two-tier convention has exactly two tiers,
          template law 400 / fold+machine 409).
        cites:
          - src/lib/server/invoice-fold.ts
          - src/lib/server/invoice-ledger.ts
          - src/lib/server/payment-intent.ts
          - src/lib/server/invoice-rest.ts
        entryStatus: live
      - code: INVOICE_JURISDICTION_RESTRICTED
        status: 422
        retryable: false
        when: >-
          Issuance gate (R-4, work-order step 5 — LIVE): an application-layer
          refusal consuming the registry-encoded jurisdictionRestrictions. Two
          refusal shapes: (a) the declared counterpartyJurisdictions overlap the
          encoded restriction codes; (b) the currency is restricted but the
          ISSUE request declared no codes — an absent declaration is NOT a
          clear. The registry stays declarative (ENCODES, does NOT ENFORCE).
        cites:
          - src/lib/server/issuance-gate.ts
          - src/lib/server/invoice-rest.ts
          - src/app/api/invoices/route.ts
          - src/app/api/invoices/demo/route.ts
        entryStatus: live
      - code: LEDGER_INTERNAL
        status: 500
        retryable: false
        when: >-
          Ledger integrity fault that must refuse the append (e.g. the demo
          issuer's signature fails self-verification — a BUG guard, never a
          client error). Parented round-13 (B-5/B-1): the demo issuer lane this
          row cites is part of the declared app surface (Amendment 3 B).
        cites:
          - src/app/api/invoices/demo/route.ts
        entryStatus: live
  x-phase-gating:
    phases:
      - phase: 1
        routeClass: SWAP (idle↔idle, contract-direct)
        behavior: >-
          EXECUTES — MockUSDC ↔ MockDAI on the backed network; DB-simulated
          elsewhere (honesty per RevealResponse)
      - phase: 2
        routeClass: ACCRUE, LIQUIDATE (contract-direct ERC-4626)
        behavior: 501 PHASE_GATED
      - phase: 2-econ
        routeClass: ACCRUE, LIQUIDATE (skia-desk instant exit)
        behavior: >-
          501 PHASE_GATED until the economics-audit 'transformation inventory'
          section passes
      - phase: 3
        routeClass: STAKE, UNSTAKE (contract-direct; msg.value settlement shape)
        behavior: 501 PHASE_GATED
      - phase: per-lane
        routeClass: WRAP, UNWRAP (custodian-dependent)
        behavior: 501 PHASE_GATED
      - phase: 4
        routeClass: COLLATERALIZE, DECOLLATERALIZE (external-venue)
        behavior: enum reserved; additive when the venue layer exists
      - phase: invoice-1
        routeClass: INVOICE (ledger obligations resolving into SWAP orders)
        behavior: >-
          SERVED (round-13, (A)): types + locks + the ledger + the intent
          service + REST+MCP + the R-4 gate are live — the 7-path /v1 surface +
          the bind path answer real traffic; templateId swap-sponsored stays 501
          PHASE_GATED (RESERVED Phase 2); SECURED class + sponsorship are Phase
          2 behind the public-bundler receipt gate
  x-testnet:
    active: true
    milestone: >-
      Pre-mainnet validation — EIGHT chain-backed app chains
      (ethereum/arbitrum/base/robinhood/mantle/ink/xlayer/monad — monad DEPLOYED
      BY REPRODUCTION 2026-11-19 from the recovered salts/initcodes; registry
      row lands with the desk's tx hashes) + four dormant keys
      (taiko/bsc/polygon/hyperevm, wire-accepted only; hyperevm staged —
      deployment pre-verified in simulation), mock tokens, real EIP-712 + real
      on-chain settlement on the active network. v0.4.0 Tetrad: settlement is
      receipt-verified END-TO-END on FOUR lanes (mantle, base, ethereum,
      arbitrum) through the LIVE API. v0.4.3: additionally INDEPENDENT
      direct-chain verification — X Layer ×3 as a multi-asset matrix (four asset
      types, exact fee math, replay guards) and Mantle + 4337 userOp;
      launch-order pivot: X LAYER FIRST (see settleVerification +
      independentVerification below).
    settlementNetwork:
      key: arbitrum-sepolia
      chainIdNumeric: 421614
      rpc: https://sepolia-rollup.arbitrum.io/rpc
      explorer: https://sepolia.arbiscan.io
      deployedAt: '2026-11-10T10:36:28.993Z'
      registrySource: >-
        deployments/arbitrum-sepolia.json (address source of truth — this block
        is a generated snapshot)
    canonicalChains:
      note: >-
        CONTRACT-5 canonical matrix: the SAME deterministic address set resolves
        on all seven live deployments; the active settlement network above is
        where /reveal executes. SETTLE-VERIFIED LANES (Tetrad, 2026-11-19):
        mantle, base, ethereum, arbitrum each executed a real receipt-verified
        settlement through the LIVE API — verified per lane by SKIA_EVM_NETWORK
        config flip; the active-network model stays SINGULAR (a multi-backed
        runtime is future wire scope, SV-7). INDEPENDENT DIRECT-CHAIN
        VERIFICATION (external round-4, same day): X Layer settle-verified ×3 as
        a MULTI-ASSET MATRIX (USDG / USD₮0 / USDC / TST — the multi-asset
        question is answered; USD₮0 is the Global South dominant-asset proxy)
        and Mantle settle-verified + 4337 userOp verified — see
        independentVerification below. LAUNCH-ORDER PIVOT (operator decision
        2026-11-19): X LAYER FIRST. Mantle lane ops posture (CORRECTED
        2026-11-19 — fee truth): official RPC rpc.sepolia.mantle.xyz caps
        estimate allowance (18003) — set
        SKIA_EVM_RPC_MANTLE_SEPOLIA=https://mantle-sepolia.drpc.org (network.ts
        honors the per-network override). The v0.4.0-era fee claim (effective
        EOA fee ≈555 gwei, baseFee 50 gwei + L1-data component baked into the
        node's estimate math, hence a 0.2 MNT taker grant) is STALE as measured:
        12 transactions priced 50.0001 gwei flat with l1Fee = 0 on receipts —
        approve+swap ≈ 0.0073 MNT, and the 0.2 MNT grant is ~34x over-provision
        (safely conservative, but the numbers were wrong on the day). RULE
        ADOPTED: treat Mantle fees as VOLATILE — the 555 gwei figure was
        presumably real when measured — keep grant sizing pinned to the BAD case
        and re-measure periodically before trusting the cheap case.
        createAccount dominates session cost (~76% of 0.1128 MNT across 12 txs):
        at account-per-user scale, DEPLOYMENT is the gas line item, not
        settlement. PILOT REALITY (R4-13): base-sepolia is the Phase-2 PRIMARY
        pilot but the RECORDED active settlement network is arbitrum-sepolia —
        every other live key settles DB-simulated (isChainBacked) until the
        operator flips SKIA_EVM_NETWORK (one env line + one sync re-run).
      chains:
        - key: ethereum-sepolia
          chainIdNumeric: 11155111
          appChainKey: ethereum
          phaseRole: >-
            pilot — validation leg (operator decision 2026-11-14);
            SETTLE-VERIFIED (Tetrad 2026-11-19)
        - key: arbitrum-sepolia
          chainIdNumeric: 421614
          appChainKey: arbitrum
          phaseRole: >-
            pilot — secondary validation; SETTLE-VERIFIED (Tetrad 2026-11-19) —
            recorded active network
        - key: base-sepolia
          chainIdNumeric: 84532
          appChainKey: base
          phaseRole: >-
            pilot — PRIMARY (Phase 2 capital-state first test); SETTLE-VERIFIED
            (Tetrad 2026-11-19)
        - key: robinhood-testnet
          chainIdNumeric: 46630
          appChainKey: robinhood
          phaseRole: live — settlement verification pending
        - key: mantle-sepolia
          chainIdNumeric: 5003
          appChainKey: mantle
          phaseRole: >-
            live — SETTLE-VERIFIED (Tetrad via API + independent direct-chain
            2026-11-19) + 4337 userOp verified + fee re-measured (see
            canonicalChains.note); launch-order: second wave
        - key: ink-sepolia
          chainIdNumeric: 763373
          appChainKey: ink
          phaseRole: live — settlement verification pending
        - key: xlayer-testnet
          chainIdNumeric: 1952
          appChainKey: xlayer
          phaseRole: >-
            live — SETTLE-VERIFIED ×3 (independent direct-chain multi-asset
            matrix, 2026-11-19, see independentVerification); 4337 userOp
            pending; LAUNCH-ORDER: FIRST (operator decision 2026-11-19)
    independentVerification:
      asOf: '2026-11-19T00:00:00.000Z'
      source: >-
        External round-4 direct-chain review (independent of the API and relayer
        — the 'works without us' posture reproduced and extended)
      note: >-
        Same evidence class as the round-3 fresh-wallet reproduction (spec
        v0.4.2): third-party settlement of the SAME primitive with NO Skia
        infrastructure in the path. Confirms cross-chain behavioral parity
        beyond address parity: the authorization model
        (authorizeSigner/authorizeSender links) behaves identically on its
        second chain, and the fee-on-signer model holds across 6-decimal and
        18-decimal tokens.
      xlayerMatrix:
        chainId: 1952
        settlements:
          - pair: 5 USDG <-> 5 MockDAI
            txHash: '0x9a8dd65b7508be001251013874f015f6efc4909b06df48cc6b3c02392c184c0c'
            gas: ~152k
            treasuryFee: +0.0035 USDG
            replay: NONCE_ALREADY_USED
          - pair: 5 USD₮0 <-> 5 MockUSDC
            txHash: '0xd246e7559367cb60be4e6f1534999fd8f1d8710c3c699b9bb7d826f49bac0b66'
            gas: ~142k
            treasuryFee: +0.0035 USD₮0
            replay: NONCE_ALREADY_USED
          - pair: 5 USDC <-> 1,000 TST
            txHash: '0x6563bc51ae04c9f8944938d3f1ed645748e3f60f9b7e75a4baa38f1f563a0caa'
            gas: ~167k
            treasuryFee: +0.0035 USDC
            replay: NONCE_ALREADY_USED
        assetCoverage: >-
          Paxos-flavored USDG, Tether-flavored USD₮0, Circle-native USDC + an
          18-decimal swap token (TST) — four stablecoin/asset types through one
          primitive; fee math exact on 6-decimal AND 18-decimal tokens
        setup: >-
          3 fixture transfers, 4 authorization links, 6 approvals — all
          confirmed before the matrix ran
      mantle:
        chainId: 5003
        settlement:
          pair: 100 MockDAI <-> 100 MockUSDC
          txHash: '0x3e80bbe3c5f1a873ec8a0e6027ba9896112cfa3ae09213cdd9e906df38a3bade'
          result: exact deltas, Treasury +0.07 DAI, replay -> NONCE_ALREADY_USED
        erc4337:
          counterfactualAddressParity: >-
            identical to arbitrum-sepolia (0xF612…1b6E) — cross-chain account
            parity holds
          createAccountTxHash: '0xb8d30f3c2fc17fd74c5170655e1740f6c2d2bcd03502033bc7f3823ad929ae2e'
          selfPaidUserOpTxHash: '0xf424bfb8bb4c1bd0d41419c36ed75c88f9134e1ad1ef6fef935fcfc9749a6dca'
          userOpResult: >-
            UserOperationEvent success=true (MockDAI.approve allowance set);
            random-key signer UNAUTHORIZED reproduced via eth_call
        feeTruth: >-
          FEE-TRUTH CORRECTION (2026-11-19, 12-tx measurement): effective price
          50.0001 gwei flat, l1Fee = 0 — the v0.4.0-era ≈555 gwei / 0.2
          MNT-grant posture is STALE; approve+swap ≈ 0.0073 MNT and the 0.2 MNT
          grant is ~34x over-provision. Rule: Mantle fees are VOLATILE (the 555
          gwei figure was presumably real when measured) — keep grant sizing
          pinned to the bad case and re-measure periodically. createAccount
          dominates session cost (~76%): at account-per-user scale, deployment
          is the gas line item, not settlement.
      pendingLanes:
        - ink-sepolia
    settleVerification:
      asOf: '2026-11-19T00:00:00.000Z'
      release: v0.4.0 Tetrad
      note: >-
        FOUR lanes receipt-verified END-TO-END through the LIVE API
        (docs/release-notes-v0.4.0.md): fresh custodial taker → on-chain faucet
        (relayer transfers) → sovereign quote (relayer-signed maker order) →
        commit (equivocation-bound; MEV posture is API-side) → reveal with
        Idempotency-Key → real SwapERC20 swap() — receipt status=0x1 re-verified
        against the chain RPC INDEPENDENTLY of the server. On every lane: SV-2
        keyless retry of a settled commitment → 400 ALREADY_REVEALED (never 409,
        never a second execution); SV-3 same-key same-body replay → the STORED
        response (same orderId).
      lanes:
        - lane: mantle-sepolia
          txHash: '0x4166be475c7519c0bcbf85a6ae668960aa87560bc8e146f2e0780be52effa337'
          block: 46785727
        - lane: base-sepolia
          txHash: '0x79bbc82a46ca7b31fa4930016c3d94bbf828806bcdee265e714ad831f3656b46'
          block: 60971489
        - lane: ethereum-sepolia
          txHash: '0x3880a851efdadbe842a2baf99bc0bce9f03ed831994a15809e4d4abc6278f0a9'
          block: 12170422
        - lane: arbitrum-sepolia
          txHash: '0x580d553fd39867526a374c8cbea4c3e5289c7fc1b6fac8ee540157d906e547ca'
          block: 330826496
      honestScope: >-
        EOA custodial-taker lane proven ×4; the ERC-4337 sponsored lane is
        CAPITALIZED (paymaster deposit 0.04–0.05 native + 0.002 staked —
        externally confirmed by the round-2 benchmark). UPDATE (v0.4.5,
        2026-11-19) — a SPONSORED settlement userOp has since been SMOKED on
        Robinhood (0xda71dd44…0b48e0, UserOperationEvent success=true,
        paymaster-paid) — via DIRECT-RPC handleOps; a PUBLIC-BUNDLER run
        (ERC-7562 validation rules, session-budget storage writes during
        validation) is still queued and is the lane that could invalidate the
        sponsored session path. Active-network model stays singular — lanes
        verified by config flip; multi-backed runtime is future wire scope
        (SV-7).
      source: deployments/funding-status.json settleVerification20261119
    contracts:
      SwapERC20:
        address: '0xe5Ee89fA4b3Ea79937a69609EC93Cd3b83E24bAc'
        note: >-
          AirSwap SwapERC20 v4-domain-compatible settlement (swap /
          swapAnySender, fee-on-signer). NONCE BEHAVIOR (contract-verified;
          x-verification CLOSED v0.4.5 — SV-5 closes on the external round-3
          two-wallet receipt: two distinct takers filled the same permissionless
          quote form atomically, each burn under the CALLER's bitmap):
          nonceBitmap is TAKER-keyed and swapAnySender burns under the CALLER's
          bitmap — one signed permissionless quote is fillable once PER DISTINCT
          TAKER, and maker cancel() reaches neither bitmap (upstream-v4
          divergence, signer-keyed). REKEY PLAN (CV-1, mainnet gate): re-key
          nonces to signerWallet (upstream v4) BEFORE any integrator hardcodes
          this address — the re-key moves the CREATE2 address, the EIP-712
          verifyingContract, and re-binds SkiaDefaultPolicy.target + session-key
          allowlists + THE D-INV-1 INVOICE-CLAIM DOMAIN (round-13 (F), G-1:
          verifyingContract is the pinned SwapERC20 — every claimHash minted
          before the re-key BREAKS; pre-rekey rehearsal claims are understood to
          break, acceptable pre-mainnet, disclosed). SIGNING TRAP (external
          round-2 benchmark, 2026-11-20; docs/testnet-deployment.md SIGNING TRAP
          block): the deployed ORDER_TYPEHASH VALUE (0x2584b14e…) is the NESTED
          OrderERC20 typehash — hashing that VALUE over the 12 FLAT scalar
          fields produces a digest the contract rejects with UNAUTHORIZED at the
          signer-match require (SwapERC20.sol:320-323): a HASH failure
          indistinguishable from an authorization failure. Build the digest with
          the nested encodeType (Party-style nested structs) and self-check
          against the deployed hashOrder (0x8c51e6d0) / hashOrderCore
          (0x322e6d1a) getters before spending gas. VERDICT CREDIT (round-2 A/B,
          tool-results/round2-verdict-probe-2026-11-19.json): deployed bytecode
          is byte-identical to the artifact on ALL SEVEN chains (keccak
          0x6acdb974…21b7db, 7019B) and contains NO authorizer gate — the two
          "hardcoded authorizer addresses" in the external report are
          dead-matched PUSH32 constant fragments (SetAuthorizations event-topic
          tail + EIP712Domain typehash tail); live eth_call A/B on
          arbitrum+mantle: NESTED digest → SUCCESS, flat/hybrid → UNAUTHORIZED
          (their exact construction reproduced deterministically). UNAUTHORIZED
          OVERLOAD (external round-3 triage, 2026-11-19; supersedes candidate
          SV-11): UNAUTHORIZED currently means THREE different failures — (1)
          bad/malformed signature INCLUDING the hash-construction error above,
          (2) wrong msg.sender (swap() called by neither the bound senderWallet
          nor a signer-authorized party), (3) missing authorization link (signer
          never authorized the submitter). REVERT SPLIT FILED FOR THE CV-1
          RE-KEY WAVE as a forward contract (agents may code against these names
          now): SIGNATURE_INVALID (stage 1), SENDER_MISMATCH (stage 2),
          SIGNER_NOT_AUTHORIZED (stage 3). Until the split ships, self-diagnose
          IN ORDER: verify the digest against deployed hashOrder (0x8c51e6d0) /
          hashOrderCore (0x322e6d1a), then msg.sender vs senderWallet, then the
          authorizedSender/authorizedSigner mappings. AUTHORIZATION MODEL
          (documented as a feature per external round-3): open wallet-keyed
          delegation — authorizeSigner(delegate,bool) grants signing-side
          delegation (session keys, custodians), authorizeSender(account,bool)
          grants submitter-side rights (relayers, agents); public
          double-mappings authorizedSigner/authorizedSender are readable
          on-chain (event SetAuthorizations); swap() settles from the bound
          sender OR a party the signer authorized; swapAnySender() needs NO
          authorization link (caller is the taker). Non-relayer makers can
          settle directly — the API is an accelerator, not a gatekeeper
          (external round-3 reproduction: two fresh wallets settled atomically
          WITHOUT the API/relayer — exact token deltas, fee to Treasury,
          SELF_SWAP + NONCE_ALREADY_USED guards confirmed, sender/taker-keyed
          nonce burn CONFIRMS the documented TAKER-keyed bitmap — that
          two-wallet receipt CLOSED SV-5 in v0.4.5; CV-1 rekey posture
          unchanged). PREFLIGHT FORWARD CONTRACT (CV-1 bundle): add check(Order)
          — a view validating an order against every rule and returning the
          structured failure reason (AirSwap v4 parity); the single biggest
          agent-UX win available. Until it ships, simulate via eth_call and
          decode the revert string. Interface reference:
          docs/settlement-interface-reference.md + docs/abi/SwapERC20.json
          (explorer source verification remains operator-gated —
          docs/ops/forge-verify-runbook.md).
      MockUSDC:
        address: '0x23251ccD011337F659898FEc5357B4A0311e083B'
        decimals: 6
        note: >-
          Mock ERC20 with an open faucet(); zero value. Testnet stand-in — NOT
          the mainnet asset.
      MockDAI:
        address: '0x5D5Fe290FA1Bd10a71aCbD103232F1755b3f851a'
        decimals: 18
        note: >-
          Mock ERC20 with an open faucet(); zero value. Testnet stand-in — NOT
          the mainnet asset.
    operationalWallets:
      deployer: '0xc8B9AC8A7b34B6c0adEC5C401cf9588D82a2dA1F'
      relayer: '0x7F1ae3b7129aDd1E7F18d86084ea3d10aD6a4437'
      treasury: '0x8463c76931F5B80376fF2cf2e0424a88C6b8558c'
      sponsor: '0xA334482F112974A72c06a8516C0Ff3B4889Dd650'
      paymasterSigner: '0xE865bBb894FbF81DA4c35Be054E41B09D01f6737'
      feeRecipient: '0x8463c76931F5B80376fF2cf2e0424a88C6b8558c'
      feeWiring: >-
        constructor (deterministic deployment) — feeWallet is TREASURY from the
        first block
      note: >-
        Five-role topology: DEPLOYER owns/funds; RELAYER signs EIP-712 orders
        and holds maker inventory; TREASURY receives the protocol fee
        (SwapERC20.feeWallet); SPONSOR funds gas grants and the ERC-4337
        paymaster; PAYMASTER SIGNER signs sponsorship tickets. ADDRESSES ONLY —
        keys are never published.
    deterministicDeployment:
      universalProxy: '0x4e59b44847b379578588920cA78FbF26c0B4956C'
      proxyKind: arachnid/deterministic-deployment-proxy (keyless one-time signer)
      skiaFactory: '0x88672995b2d8D42ae06DE01F68eDD8c09ce0Db42'
      factorySalt: '0xc4a4d4adaa8ed66c75c210a1fb90c0ac061222fe000af0d740fb92ba98a77fdf'
      factorySaltPreimage: skia.factory.v1
      note: >-
        Deterministic deployment (Task 18): universal keyless proxy →
        SkiaFactory (CREATE2, fixed salt) → contracts (fixed salts). The SAME
        addresses resolve on every EVM chain — integrators configure one address
        set for all chains. Proof: bun run contracts:verify-crosschain.
    erc4337:
      entryPoint:
        address: '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
        kind: >-
          canonical eth-infinitism EntryPoint v0.7 singleton (pre-audited, same
          address on every major chain) — never deployed by Skia
        verifiedBehavior: >-
          getUserOpHash matches v0.7 UserOperationLib math byte-for-byte on live
          bytecode; handleOps/getNonce/getSenderAddress/stake manager present
      accountFactory:
        name: SkiaAccountFactory
        address: '0xfD4e462e972433135730584e69Dc4b933D4b4886'
        saltPreimage: skia.accountfactory.v3
        fork: >-
          eth-infinitism/account-abstraction v0.7.0 SimpleAccountFactory
          (GPL-3.0), direct salted construction (no proxy/UUPS)
        accountAddressFormula: >-
          CREATE2(SkiaAccountFactory, bytes32(salt), keccak(creationCode ++
          abi.encode(entryPoint, owner))) — chainId-free, identical on every
          chain. GENERATION NOTE (v0.4.5, external-review prompt) — this 2-arg
          form is CORRECT for the DEPLOYED v3-generation factory (saltPreimage
          skia.accountfactory.v3, single-arg ctor, account ctor (entryPoint,
          owner)). The v4 canonical pin (skia.accountfactory.v4 — the REQUIRED
          repin wave, BUILT 2026-11-15) moves the account ctor to (entryPoint,
          owner, initialDefaultMaker) and the factory ctor to (entryPoint,
          defaultMaker) — on v4 the formula becomes keccak(creationCode ++
          abi.encode(entryPoint, owner, defaultMaker)). Integrators computing
          counterfactual addresses MUST use the generation deployed on their
          chain; factory.getAddress(owner, salt) is the SSOT.
      paymaster:
        name: SkiaPaymaster
        address: '0xB38baA9212053B2a456aBCCde9f88a1cf10F1B48'
        saltPreimage: skia.paymaster.v2
        fork: >-
          eth-infinitism/account-abstraction v0.7.0 VerifyingPaymaster +
          BasePaymaster (GPL-3.0), flattened + Skia sponsorship telemetry +
          ON-CHAIN sponsorship policy hook (ISponsorPolicy)
        verifyingSigner: '0xE865bBb894FbF81DA4c35Be054E41B09D01f6737'
        verifyingSignerKeyHeld: true
        sponsorPolicy:
          name: SkiaDefaultPolicy
          address: '0x42F0b663501E15809FB9bd224b62497890Ae346C'
          saltPreimage: skia.paymasterpolicy.v1
          rule: >-
            only settlement operations are sponsorable: target == SwapERC20,
            ERC20 approvals granted TO SwapERC20, 0-value account
            self-management, and deploy-only ops — everything else is rejected
            on-chain (EP AA34), even if the off-chain ticket signer were
            compromised
          swappable: >-
            owner binds new ISponsorPolicy contracts via factory.adminCall —
            policy-driven, never hardcoded (future: user-pays, merchant-pays,
            treasury-subsidized)
        funder: >-
          SPONSOR operational key (deposit + stake) — Skia-owned sponsorship, no
          vendor-hosted paymaster
      note: >-
        SkiaAccount/SkiaAccountFactory/SkiaPaymaster are audited-source forks
        with delimited additive sections — see
        contracts/src/account/PROVENANCE.md. Session keys (expiry, 24h native
        cap, target+selector allowlists) are additive on SkiaAccount.
      sponsorshipTicket: >-
        Sponsorship tickets are signed by the PAYMASTER SIGNER and issued ONLY
        through the Skia API lane (POST /api/wallets/smart/{address}/userops —
        the server composes and signs paymasterAndData). Externally verified
        (round-2 benchmark): a correctly-encoded v0.7 paymasterAndData with an
        empty/zero-signature ticket is rejected by the EntryPoint with
        FailedOp(0, AA33 reverted) and the rejected op charges NOTHING (account
        and paymaster balances unchanged). No public ticket endpoint exists —
        raw EntryPoint submission without a ticket fails AA33 by design.
      stakeReadApi: >-
        EntryPoint v0.7 stake state reads via getDepositInfo(address) →
        DepositInfo {deposit, staked, stake, unstakeDelaySec, withdrawTime}.
        getStakeInfo is a v0.6 API and does NOT exist on the canonical v0.7
        singleton — guides that call it revert (external round-2 finding #4,
        adopted).
      smartWalletEndpoints:
        - >-
          POST /api/wallets/smart — create a counterfactual SkiaAccount (owner
          key custodial testnet; address = CREATE2(factory, salt, owner,
          canonical EP))
        - >-
          GET /api/wallets/smart/{address} — deployment state, session keys,
          sponsorship ledger
        - >-
          POST /api/wallets/smart/{address}/deploy — deploy the account now
          (normally lazy with the first op)
        - >-
          POST /api/wallets/smart/{address}/session-keys — issue an AI-agent
          session key (expiry + 24h native cap + trade-only allowlist)
        - >-
          DELETE /api/wallets/smart/{address}/session-keys/{id} — revoke a
          session key on-chain
        - >-
          POST /api/wallets/smart/{address}/userops — submit arbitrary calls as
          ONE gasless (sponsored) UserOperation
    real:
      - >-
        commitmentHash = keccak256(abi.encodePacked(signerWallet, signerToken,
        signerAmount, senderWallet, senderToken, senderAmount, commitNonce,
        commitmentExpiry)) — recomputed and verified at /reveal before any state
        change.
      - >-
        unsignedIntent carries a REAL EIP-712 maker signature (domain SwapERC20
        v4, verifyingContract + chainIdNumeric above) — verifiable via on-chain
        ecrecover and self-settleable by the taker.
      - >-
        settlement executes a real SwapERC20.swap()/swapAnySender() transaction
        from the taker key; the txHash in RevealResponse is receipt-verified
        (status 0x1) before the 200 is returned.
      - >-
        balances are read from the chain (batched balanceOf via Multicall3);
        SQLite keeps an audit trail only.
      - >-
        contracts are deployed deterministically (universal keyless proxy →
        SkiaFactory → CREATE2, fixed salts) — identical addresses on every EVM
        chain, provable before deployment.
      - >-
        smart wallets settle as ERC-4337 UserOperations: [approve + swap]
        executes INSIDE the SkiaAccount through the canonical EntryPoint v0.7,
        sponsored by SkiaPaymaster — the taker holds zero gas; the EOA path
        remains as the escape hatch.
    simulated:
      - tokens are mocks with an open faucet(); zero value, no peg enforcement.
      - >-
        relayer inventory self-faucets mocks on shortage (testnet stand-in for
        maker inventory).
      - >-
        operational keys are held server-side in plaintext env (encryption at
        rest comes with item 2; five-role topology limits blast radius).
      - >-
        user keys are server-custodial testnet keys (encrypted at rest comes
        with item 2; TESTNET CUSTODIAL warning shown in the UI).
      - x402 payment on the Edge layer is simulated.
      - >-
        dormant app chains (taiko, bsc, polygon) are wire-accepted but have NO
        deployment and settle nowhere — the SDK refuses them client-side; every
        live key other than the active settlement network settles in DB
        simulation with honest labels.
      - >-
        bearer auth is address-as-identity (see x-auth-posture; SIWE lands
        v1.7.0).
    explorerVerification:
      rule: RevealResponse.txHash is verifiable on the settlement network above.
      whenExplorerNull: verify via eth_getTransactionReceipt against the network RPC.
      whenExplorerSet: view at <explorer>/tx/<txHash> (the explorer listed above).
    custodyWarning: >-
      TESTNET — tokens have no value. NEVER send mainnet assets (ETH, USDC,
      USDT, DAI…) to any address in this deployment. User keys are
      server-custodial testnet keys.
    promotion: >-
      export SKIA_DEPLOYER_KEY=<funded key> && bun run contracts:deploy --
      --network arbitrum-sepolia && bun run spec:sync-testnet -- --network
      arbitrum-sepolia
    references:
      - docs/testnet-deployment.md
      - docs/auth-posture-testnet.md
      - docs/economics-audit.md
      - docs/deterministic-deployment.md
      - docs/release-notes-v0.4.0.md
      - docs/release-notes-v0.4.3.md
      - docs/settlement-interface-reference.md
  x-invoice-deferred:
    note: >-
      THE DEFER LIST (v0.4.7 lock — nothing leaks forward; mirrors
      docs/ops/invoice-thesis-intake-2026-11-29.md §4). Each row names the gate
      that re-opens it. HAND-MAINTAINED block, pinned by spec:check-prose.
    deferred:
      - item: >-
          SECURED invoice class (escrow into SkiaAccount, policy-gated release
          at dueAt)
        gate: >-
          Phase 2 — sponsored 4337 settle receipted END-TO-END through a PUBLIC
          bundler (ERC-7562) + paymaster funding per R-M1/R-M2; direct-RPC does
          NOT satisfy the gate
      - item: >-
          On-chain claim-registry anchor contract (hash commitments only —
          payloads never go on-chain; the privacy rule stands)
        gate: Phase 2
      - item: >-
          Negotiation transcript protocol (drafts -> signed transcript
          provenance)
        gate: >-
          Phase 2 — Phase 1 ships unsigned memo drafts and a single signed ACK
          as the terminal accept state
      - item: >-
          Receivable transfer through the rail (the claim itself settles via
          swap())
        gate: Phase 2
      - item: >-
          Factoring / discounting surface; receivables as registry collateral
          rows; Meridian creditworthiness rating over ledger history
        gate: Phase 3 wave (Arbitrum/Base/Robinhood/Ethereum)
      - item: Decentralized default attestation
        gate: >-
          Phase 3 — Phase 1 DEFAULT is an issuer-asserted reputation signal
          (disclosed, not proof)
      - item: Arbitrator role
        gate: >-
          NONE in Phase 1 — bilateral CreditNote only; build a court only after
          commerce
      - item: On-chain late-fee enforcement
        gate: >-
          NEVER in the current contract set — lateFeeBpsPerDay is a derived
          off-chain fold input; on-chain enforcement is a RED FLAG by standing
          rule
      - item: >-
          Policy-triggered autonomous auto-pay (pull beyond a single
          acknowledged intent)
        gate: Phase 2, behind the sponsored-path receipt gate
      - item: Session-bounded auto-pay policies
        gate: Phase 2, after the gate
      - item: >-
          Signed dispute/decision structs (binding disputedAmount and the
          decision word into the signature)
        gate: >-
          Phase 2 upgrade alongside the transcript protocol — Phase 1 records
          the countersignature + ledger-recorded parameters (the disclosed
          ledger-trust boundary)
servers:
  - url: https://api.skia.money
    description: >-
      Cleartext HTTPS, Cloudflare-fronted (zone skia.money — operator-owned).
      All paths are /api-prefixed (no versioned base path — the version lives in
      info.version). TWO NAMESPACE RULING (round-13, (B)): the /v1 invoice
      surface (8 paths) is the CONTRACT — the versioned namespace marks the
      obligation layer's long-lived contract, distinct from the /api settlement
      primitives; the /api/invoices APP LANE (GET book, POST issue, the demo
      issuer, the custodial DEMO sign path, attempt status, the bind twin)
      serves the desk console and shares the SAME handlers — one law, two
      mounts. Auth, rate-limiting and gateway posture are shared. Tor hidden
      service added post-validation. CORRECTION (R6, 2026-11-19): the previous
      base URL api.talos.xyz was erroneous — the operator does not own that
      domain; this entry supersedes it (v0.1.0 through v0.4.0 carried it by
      mistake).
security: []
tags:
  - name: Discovery
    description: Layer topology, chains, tokens, builder attestation
  - name: Core Settlement
    description: >-
      Quote → commit → reveal (equivocation-binding; MEV posture is API-side —
      see Layer guarantees in info.description)
  - name: Wallets
    description: Server-custodial EOA wallets, balances, faucet
  - name: Smart Wallets
    description: ERC-4337 SkiaAccounts, session keys, sponsored UserOperations
  - name: Monetization
    description: Tiers, leaderboard, rebate, Edge payment verification
  - name: Webhooks
    description: Event subscriptions
  - name: Registry
    description: >-
      Capital State Registry — LIVE since v0.4.4 (attested reads; reads never
      gate)
  - name: Invoice
    description: >-
      Obligation ledger (v0.4.7 — the round-12 FORWARD CONTRACT, SERVED by
      round-13: signature-acknowledged claims that RESOLVE into Orders and
      settle through the unchanged swap() rail; the append-only ledger is the
      only new trust assumption; production ship rides the X Layer mainnet
      release; templateId swap-sponsored stays 501 PHASE_GATED until Phase 2)
paths:
  /api/wallets/smart/{address}/deploy:
    post:
      tags:
        - Smart Wallets
      summary: Deploy the account now (normally lazy with the first op)
      description: >-
        Bearer-enforced server-side (requireSmartWallet: 401 without bearer, 403
        unless bearer == path address — src/lib/server/smart-wallets.ts:24-31).
        The spec's v0.3.0 `security: []` underclaimed enforcement (R4-2). The
        residual risk (bearer forgery — the token IS the address string) is
        disclosed once in x-auth-posture, not per-path. Deployment is a REAL
        EntryPoint op (always on-chain — labeled anyway, R4-23).
      operationId: deploySmartWallet
      parameters:
        - $ref: '#/components/parameters/AddressPath'
      responses:
        '200':
          description: >-
            Deployment submitted (deploy-only ops are sponsorable per
            SkiaDefaultPolicy)
          content:
            application/json:
              schema:
                type: object
                properties:
                  txHash:
                    type:
                      - string
                      - 'null'
                  deployed:
                    type: boolean
                  onChain:
                    type: boolean
                    const: true
                    description: >-
                      Constant (R4-23): this lane is ALWAYS a real EntryPoint op
                      — labeled for pattern consistency, not duality. SV-10
                      wires the echo.
        '400':
          description: NOT_A_SMART_WALLET (the EOA name; never WALLET_NOT_SMART on REST)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: UNAUTHORIZED (missing bearer)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: FORBIDDEN (bearer ≠ path address)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: WALLET_NOT_FOUND (server emits 404 — path fixed per R4-12)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: DEPLOY_FAILED (deployment UserOperation reverted on-chain)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            SPONSOR_DEPOSIT_LOW (when the deploy op must be sponsored and the
            deposit is unfunded — the v0.3.0 row INSUFFICIENT_PAYMASTER_DEPOSIT
            never existed in code) | CHAIN_UNAVAILABLE
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ethSigAuth: []
components:
  parameters:
    AddressPath:
      name: address
      in: path
      required: true
      schema:
        type: string
        pattern: ^0x[a-fA-F0-9]{40}$
  schemas:
    Error:
      type: object
      required:
        - code
        - message
        - retryable
      properties:
        code:
          type: string
          description: >-
            MACHINE_READABLE_SNAKE_CASE — see info.x-error-codes for the exact
            status+code table.
        message:
          type: string
        retryable:
          type: boolean
          description: >-
            Agents need this to decide between retrying and aborting —
            deliberately KEPT.
        details:
          type: object
          additionalProperties: true
          description: >-
            Optional structured context. e.g. PHASE_GATED carries { routeClass,
            earliestPhase } — a single code with the phase in details, so no
            per-phase error-code churn (R7/CR-20).
  securitySchemes:
    ethSigAuth:
      type: http
      scheme: bearer
      bearerFormat: ethereum-signature
      description: >-
        TESTNET posture: simulated signature bearer — the token is the caller's
        0x<walletAddress> (address-as-identity; no per-request signature
        verification). Real EIP-191/EIP-712-verified bearers + SIWE (EIP-4361)
        sessions for the hosted UI arrive in v1.7.0. The settlement security
        boundary is the EIP-712 Order signature verified by SwapERC20 on-chain,
        not this credential. See docs/auth-posture-testnet.md.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.