Documentation

Build on Solinkify

One settlement layer to charge (and pay) for datasets, APIs, content, and checkouts, whether the customer is a person or an autonomous AI agent. Five pillars, one on-chain program on Solana.

Overview

Solinkify is a Web3 ecosystem on Solana with five product pillars backed by a single Anchor program, one escrow model, and one fee-split router. The recipient always keeps 99%; a flat 1% protocol fee is split on-chain.

Program IDA8qSJCS2uxxnEMdCcpjX2L8hUUMydoeCi5xq5qvzS22B
NetworkSolana Devnet (current)
Protocol fee1% flat · 0.8% with a $SINKY discount
StablecoinsUSDC · USDT (6 decimals)
EscrowProgram-owned PDAs, never end-user wallets
Base APIhttps://api.solinkify.com

The SDK suite is live on npm (@solinkify/gate, gate-sdk, mcp, gate-proxy, pay, depin) and on PyPI (solinkify-gate). E-commerce marketplace listings (WordPress / OpenCart / PrestaShop) are deferred to pre-mainnet.

How it works: the money flow

Every payment settles on-chain. 99% goes to the recipient; the 1% fee is split by route:

DestinationJalur A (direct)Jalur B (via node)
Recipient99%99%
Relay node0.375%
Epoch pool0.375%
Treasury0.9%0.15%
Team0.1%0.1%
  • Jalur B → A fallback: if no active relay node/epoch, the fee falls back to the Jalur A split automatically.
  • $SINKY discount: stake ≥ 500 SINKY and your total fee drops to 0.8% (every share ×0.8).
  • Escrow + anti-replay: funds route through a program PDA; verification is one-shot, bound to endpoint + amount + mint.

Gate: the AI paywall

Block AI scrapers with an x402 paywall; ethical agents auto-pay in stablecoins. This is agentic payments end to end: machines discover the price, pay, and consume, with no human account in the loop. It ships as one core with thin adapters for every stack, and the 402 manifest speaks x402 v2 (CAIP-2 networks, the PAYMENT-REQUIRED wire header).

Install

bash
npm install @solinkify/gate

Next.js (middleware)

ts
// middleware.ts
import { protectFromAI } from "@solinkify/gate";

export const middleware = protectFromAI({
  wallet: "YOUR_CREATOR_WALLET",   // receives 99%
  price: 0.001,                     // per request (USDC)
  endpointId: "my-blog",            // your on-chain endpoint
  detection: "basic",               // basic (SEO-safe) | strict | strict+
});

export const config = { matcher: "/:path*" };

On devnet also pass tokenMint: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU" (devnet USDC); the default is mainnet USDC. The setup page fills this in for you.

Express

ts
import { protectFromAIExpress } from "@solinkify/gate/express";

app.use(protectFromAIExpress({
  wallet: "YOUR_CREATOR_WALLET",
  price: 0.001,
  endpointId: "my-api",
}));

Runs on (almost) any stack

Adapters: Next.js · Express · Cloudflare Workers · Astro · SvelteKit · Hono · Nuxt · Remix · Fastify · Lambda@Edge · generic Fetch. Plus Python (WSGI/ASGI), a WordPress plugin, a Kong plugin, and a reverse proxy for any site (PHP/Ruby/static/legacy) with no code changes.

Python (Flask / Django / FastAPI)

bash
pip install solinkify-gate
python
# WSGI (Flask / Django). ASGI variant: solinkify_gate.asgi
from solinkify_gate import GateConfig
from solinkify_gate.wsgi import SolinkifyGateMiddleware

app.wsgi_app = SolinkifyGateMiddleware(app.wsgi_app, GateConfig(
    wallet="YOUR_CREATOR_WALLET",
    price=0.001,
    endpoint_id="my-api",
))

WordPress · Kong · any site (proxy)

WordPress

  1. Copy the plugin into wp-content/plugins/ (single file, no build).
  2. Activate it in Plugins.
  3. Set your wallet + price in the plugin settings.

Kong Gateway

  1. Copy sdk-gate-kong/kong/plugins/solinkify-gate to Kong’s Lua path.
  2. Enable the solinkify-gate plugin.
  3. kong restart.

Any site (proxy)

  1. npm i -g @solinkify/gate-proxy
  2. Write gate.config.json (wallet, price, upstream).
  3. Run it, or use Nginx auth_request / Caddy forward_auth.

What Gate blocks

A 2-tier, SEO-safe detector classifies every request. Real humans and browsers always pass; only bots hit the 402. User-agents are verified against official IP ranges, so a spoofed “Googlebot” from a fake IP is still blocked.

ModeBlocksAllows
basic (default)AI crawlerssearch engines + humans (SEO-safe)
strictAI crawlers + search engineshumans only ⚠ hurts SEO
strict++ headless/scraper UAs, optional datacenter IPshumans only

AI crawlers (blocked in basic & strict): OpenAI GPTBot / ChatGPT-User / OAI-SearchBot, Anthropic ClaudeBot, Google Gemini, PerplexityBot, Amazonbot, ByteDance Bytespider, CommonCrawl CCBot, Diffbot, and more. Search engines (only blocked in strict): Googlebot, Bingbot: allow-listed by default so your SEO stays intact.

Payment modes

  • Pay-per-request: lock → verify → release 99%.
  • Pre-paid balance: deposit once; the backend debits per request (no per-request signature).
  • Subscription: buy time-based access; header until expiry.

The AI agent side

An ethical agent auto-pays a 402 with the agent SDK:

ts
import { GateClient } from "@solinkify/gate-sdk";

const client = new GateClient({
  wallet: agentKeypair,
  rpcUrl: "https://api.devnet.solana.com",
  maxPricePerRequest: 0.01,   // budget cap (USDC)
});

const { response, via, paymentId } = await client.fetchProtected(url);
const content = await response.text();
if (via === "payment" && paymentId) await client.release(paymentId);

Use from MCP (Claude, Cursor, any MCP host)

The @solinkify/mcp server turns all of this into tools any MCP-capable agent can call: no code, just a wallet and hard spending caps. One config unlocks the whole ecosystem, the agent can pay Gate paywalls (gate_fetch, prepaid, subscriptions), search and buy DataHub datasets (datahub_buy), settle Pay store checkouts (pay_checkout), and buy straight from Blink links shared on X (social_buy_blink), all on the same rails.

json
{
  "mcpServers": {
    "solinkify": {
      "command": "npx",
      "args": ["-y", "@solinkify/mcp"],
      "env": {
        "SOLINKIFY_WALLET_PATH": "/path/to/agent-keypair.json",
        "SOLINKIFY_MAX_PAYMENT_USD": "1",
        "SOLINKIFY_DAILY_CAP_USD": "10"
      }
    }
  }
}

Want to see the whole flow live before wiring anything up? The 5-minute agentic-payments walkthrough pays a real x402 paywall on this site with devnet USDC.

Agent authorization model

Moving money was never the hard part; scoped, revocable authority is. An agent never touches your main wallet here, it runs on its own keypair funded only with what it is allowed to spend:

  • Scoped budget: a per-payment cap (SOLINKIFY_MAX_PAYMENT_USD) and a daily ceiling (SOLINKIFY_DAILY_CAP_USD) are checked fail-closed before any transaction is signed, in every tool. The wallet's own balance is the outer bound.
  • On-chain scoped budget (Gate): prepaid balances deposit once into a program-owned account and are debited per request at on-chain prices. withdraw_prepaid pulls the remainder back at any time, that is the kill switch.
  • Buyer-side trust: dataset search results carry a signed-attestation flag and a 0-100 quality score, and agents can leave verified-purchase reviews (datahub_review), so unattended buying decisions run on verifiable signals, not listings alone.

The agent also self-identifies via User-Agent so gated sites answer with a clean 402 instead of being scraped. Delegated on-chain spend authority (allowance + revoke enforced by the program itself) is on the pre-mainnet contract roadmap. No install step: npx pulls it straight from npm.

Pay: crypto checkout

Accept USDC/USDT from customers. One hosted checkout is the core; every channel is a thin adapter that creates a session and redirects to it.

Embeddable widget (no backend)

html
<script src="https://cdn.solinkify.com/solinkify-pay.js"></script>
<button data-solinkify data-merchant="YOUR_WALLET"
  data-amount="9.99" data-currency="USD" data-token="USDC"
  data-order="ORDER-123" data-return="https://store.com/thanks">
  Pay with Crypto
</button>

Server SDK (any Node backend)

bash
npm install @solinkify/pay
ts
import { SolinkifyPay } from "@solinkify/pay";

const pay = new SolinkifyPay();
const session = await pay.createCheckoutSession({
  merchantWallet: "YOUR_WALLET",
  amount: 9.99, currency: "USD",     // non-USD is FX-converted
  orderId: "ORDER-123", tokenMint: "USDC",
  returnUrl: "https://store.com/thanks",
});
res.redirect(session.checkoutUrl);   // hosted checkout
// later: (await pay.getSession(session.sessionId)).status === "paid"

Raw HTTP (any language)

bash
curl -X POST https://api.solinkify.com/api/gateway/session \
  -H "Content-Type: application/json" \
  -d '{"merchant_wallet":"YOUR_WALLET","amount":9.99,"currency":"USD","order_id":"ORDER-123","token_mint":"USDC","return_url":"https://store.com/thanks"}'
# → { ok, session_id, checkout_url }, then redirect the buyer to checkout_url

Plugins: WooCommerce, OpenCart, and PrestaShop. Set your wallet and go. Manage everything from the Pay console.

Plugin installation

Packages aren’t on the marketplaces yet (pre-mainnet). Install from the plugin folder in the repo, then set your merchant wallet and default token in the plugin settings (backend defaults to api.solinkify.com).

WooCommerce

  1. Copy packages/sdk-pay-woo into wp-content/plugins/.
  2. WP Admin → Plugins → activate Solinkify Pay for WooCommerce.
  3. WooCommerce → Settings → Payments → enable it, set wallet + token.

OpenCart 3.x

  1. Copy packages/sdk-pay-opencart/upload/ into your OpenCart root.
  2. Admin → Extensions → Payments → install Solinkify Pay.
  3. Edit it: set wallet + token, then Enable.

PrestaShop 8.x

  1. Zip packages/sdk-pay-prestashop/solinkifypay.
  2. Admin → Modules → Upload a module → pick the zip.
  3. Configure: set wallet + token.

DataHub: dataset marketplace

List a dataset with a stablecoin price and on-chain access control (x402); buyers (human or AI) unlock it instantly after paying, and you keep 99%. Every purchase path settles through the same pay_spl instruction.

Browse the Marketplace or list an asset from Upload.

Social Commerce: Blinks

Turn any DataHub asset into a one-click checkout for the X timeline. A Blink is a Solana Action; the shareable link is your asset page with auto-buy params:

text
https://www.solinkify.com/book/<asset_id>?autoBuy=true&noEmail=true

Create and share Blinks from the Social console. The underlying Action lives at /api/actions/buy/<asset_id> and settles Jalur B → A.

DePIN / $SINKY: run a node

Stake $SINKY, relay third-party payments, and earn. A node earns three ways: a direct 0.375% per relayed tx, a stake-weighted share of the epoch USDC pool, and daily $SINKY emission.

TierMin stakeMultiplierEmission/day
Lite251.0×0.015 SINKY
Bronze1001.0×0.07 SINKY
Silver5001.5×0.41 SINKY
Gold20002.5×1.92 SINKY
  • Pool weight = stake × multiplier × uptime. Emission = per-tier accrual × uptime (capped ≈ 1,370/day).
  • Lane Lite: run a phone as a node. It connects outbound to the coordinator (ed25519 auth) and is paid off-chain in batches.
  • Stake ≥ 500 SINKY as a creator/merchant to also cut your own fee to 0.8% (7-day unstake cooldown).

Register and track from the Node console. Building tooling? npm install @solinkify/depin ships the tier math, PDAs, and reward formulas that mirror the on-chain program.

API reference

EndpointMethodPurpose
/api/gateway/sessionPOSTcreate a Pay checkout session
/api/gateway/session/:idGETsession detail (checkout + polling)
/api/gateway/session/:id/verifyPOSTconfirm on-chain (fail-closed, anti-replay)
/api/gateway/sessions?merchant=GETlist a merchant's sessions
/api/actions/buy/:idGET/POSTSolana Action (Blink)
/api/books?seller=GETa seller's DataHub assets
/.well-known/solinkifyGETGate discovery document
/api/x402/resourcesGETpublic x402 resource registry

Discovery works at two ranges. Per site, /.well-known/solinkify tells an agent what a given host charges. Across sites, /api/x402/resources is a public registry of x402-priced endpoints: url, price, mint, network, payout wallet and access modes, so an agent can budget before it spends. No key, no account, cached for a minute.

Getting listed is decided by machine, never by agreement. Submit a Gate-protected URL at list an API and Solinkify fetches it as an AI agent: it has to answer a real 402 with a valid x402 v2 manifest, that manifest has to pay the wallet that signed the submission, and settlement has to use a whitelisted stablecoin. The same criteria ship inside every registry response, so anyone can reproduce the check instead of trusting the list.

On-chain

One Anchor program (34 instructions). Key PDAs:

EndpointConfig["gate_endpoint", creator, endpoint_id]
EscrowAccount["gate_escrow", payer, payment_id]
PrepaidBalance["gate_balance", payer, mint]
AssetState["asset", book_id]
NodeOperator["node_operator", operator]
EpochState["epoch_state", epoch_num]
CreatorStake["creator_stake", creator]

Funds are only ever custodied by program-owned PDAs. Fee destinations are pinned on-chain. A caller cannot redirect any part of the fee.