Skip to Content
Nib TipsAgent flow

Nib Tips — agent flow

An agent can tip any page over the same x402 rail it uses for unlocks. The only branch is whether the hub can resolve the creator.

All routes are canonical bare hub routes. Testnet host testnet-api.nibgate.xyz, mainnet api.nibgate.xyz. Amounts are USDC decimal strings; on-chain values are 6-decimal base units.

0. Try to resolve the creator

curl -s 'https://testnet-api.nibgate.xyz/hub/resolve?url=https://theinkwell.testnet.nibgate.xyz/writing/x' # → { "success": true, "wallet": "0x…", "confidence": 0.9, "source": "hub-index" }
  • wallet present → resolved → use the settled flow.
  • success:false / no wallet → unresolved → use the held flow.

A. Settled tip (resolved creator)

Get the challenge

curl -s https://testnet-api.nibgate.xyz/hub/tips/challenge \ -H 'content-type: application/json' \ -d '{"contentUrl":"https://theinkwell.testnet.nibgate.xyz/writing/x","amount":"0.05","recipient":"0xCreator","paymentRail":"transfer"}' # → accepts[0].payTo = creator payee, nibgate.feeBps, nibgate.protocolFee

Pay

Transfer the amount in USDC to accepts[0].payTo (or pay the Gateway challenge). With the Circle Agent Stack CLI:

circle services pay "https://testnet-api.nibgate.xyz/hub/tips/challenge" --address <agent-wallet> --chain ARC-TESTNET

Record the settled tip

curl -s https://testnet-api.nibgate.xyz/hub/tips/verify \ -H 'content-type: application/json' \ -d '{"contentUrl":"https://theinkwell.testnet.nibgate.xyz/writing/x","amount":"0.05","recipient":"0xCreator","txHash":"0x…","walletAddress":"0xAgent","paymentRail":"transfer"}' # → { "success": true, "receipt": { "status": "settled", … } }

No hold, no refund — the creator was paid directly.

B. Held tip (unresolved / external creator)

Get the box

curl -s https://testnet-api.nibgate.xyz/hub/tips/hold \ -H 'content-type: application/json' \ -d '{"contentUrl":"https://ext.example/post","amount":"0.05","domain":"ext.example","paymentRail":"transfer"}' # → { "holdStatus": "challenge", "box": "0x…" }

Fund the box

Transfer amount USDC to box. The box is a deterministic no-key address; funds are safe even if it has no code yet.

Record the held tip

curl -s https://testnet-api.nibgate.xyz/hub/tips/hold \ -H 'content-type: application/json' \ -d '{"contentUrl":"https://ext.example/post","amount":"0.05","domain":"ext.example","paymentRail":"transfer","txHash":"0x…","walletAddress":"0xAgent"}' # → { "holdStatus": "held", "tip": { … } }

C. Refund a held tip (payer only)

An agent that paid a held tip can reclaim it (full amount, no fee) until the creator claims.

Sign a control message

personal_sign (EIP-191) with the paying wallet:

Nibgate tip refund Domain: ext.example Wallet: 0xagent Issued: 2026-09-28T00:00:00.000Z

Ask the hub to relay the refund

curl -s https://testnet-api.nibgate.xyz/hub/tips/refund \ -H 'content-type: application/json' \ -d '{"domain":"ext.example","payer":"0xAgent","message":"Nibgate tip refund…","signature":"0x…"}' # → { "success": true, "amount": 0.05, "refundTx": "0x…" }

A 202 pending-settlement response means the Circle Gateway credit is still settling — retry shortly. 404 means nothing is held for that payer/domain.

Reconcile against the ledger

curl -s 'https://testnet-api.nibgate.xyz/hub/ledger?type=tips&limit=50'

type: "tip" rows carry amount, payerWallet, payeeWallet, txHash, status. Refunds appear as negative refunded rows so totals net out. Machine payers are recorded identically to browser users.

Check pending tips for a domain

The public lookup works for any site, whether or not it is registered with Nibgate. Use the API host for the network you want to inspect:

curl -s 'https://testnet-api.nibgate.xyz/hub/tips/held?domain=https%3A%2F%2Fext.example%2Fpost' # → { "success": true, "domain": "ext.example", "tips": [], "count": 0, "total": 0 }

The endpoint normalizes www, matches the exact host (subdomains are distinct), and returns at most the latest 100 tip rows alongside a count and amount across all matching pending tips. Mainnet data is at https://api.nibgate.xyz/hub/tips/held?domain=<domain>. The browser checker is available at https://nibgate.xyz/pending-tips and https://testnet.nibgate.xyz/pending-tips.

Titles and images are only as complete as the payer/extension payload or matching indexed content. JEV enrichment does not guarantee metadata for every external page.

Machine-readable indexes

  • https://api.nibgate.xyz/openapi.json — the tip routes with schemas (tag Tips)
  • https://nibgate.xyz/discovery.md — payer/agent guide
  • https://api.nibgate.xyz/mcp — MCP tools over the same data

Payment confirmation and safe retries

SDK 0.4.40 and wallet 0.4.31 support Arc mainnet (eip155:5042, https://api.nibgate.xyz) and Arc testnet (eip155:5042002, https://testnet-api.nibgate.xyz). Install @nibgate/sdk@latest and @nibgate/wallet@latest. Configure the application network and matching Hub together; an npm tag does not configure the network automatically.

A wallet transaction hash or Gateway signature means a proof was submitted, not that the Hub recorded a successful tip. A standalone SDK tip without a Hub verification response returns status: 'pending'. Only a successful Hub response confirms settled (resolved tip) or holdStatus: 'held' (funded hold).

On an interrupted response, keep the original proof and exact request fields, including the network, amount, payee and content metadata. Retry verification with that same proof; never send a second payment to repair a missing receipt. The matching completed proof returns HTTP 200 with replayed: true and its existing receipt, without another Tip row or another Gateway settlement. Reusing a proof with different request fields is rejected. Legacy proofs without the new verified binding fail closed.

HTTP 409 payment-proof-already-used means the proof is reserved or recorded with a different or unverifiable binding. HTTP 409 payment-verification-pending means its durable reservation has not completed. Stop automatic payment attempts; inspect the existing transaction/receipt and reconcile ambiguous settlement with the operator. Pending reservations are not automatically cleared or settled again. A transport or server error after submission is not evidence that no payment occurred. An unconfirmed direct-transfer receipt returns HTTP 402; retrying its read-only verification is safe. If a facilitator settlement is lost before database completion, the stored proof and transaction require reconciliation. Held-tip claim/refund relays have their own outcome checks.

Google wallet compatibility: wallet 0.4.31 checks already-authorized accounts before SIWE, closes the AppKit sheet before the embedded signature prompt, and configures Reown’s Arc RPC routes on both networks. This avoids overlapping dialogs and Magic iframe restrictions on direct Arc RPC hosts. Nibgate’s application RPC proxies remain read-only; wallet signing still requires user approval.

Last updated on