TypeScript SDK for private x402 payments on Solana - Groth16 ZK proofs, ElGamal-encrypted amounts, on-chain PDA escrow, agent autopay.
shadowpay-sdk is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on elgamal, elgamal-encryption, groth16, groth16-solana. It currently has 4 GitHub stars and 1 forks, and sits alongside related tools like zkprof, zkprof, CloddsBot, Rustchain, x402-openai-python, x402-client.
Private payments on Solana - as easy as Stripe.
@shadowpay/core, @shadowpay/client, @shadowpay/serverShadowPay makes accepting private, automated x402-style payments on Solana simple. You get on-chain PDA escrow, Groth16 ZK proofs, ElGamal-encrypted amounts, and spending authorizations for agents/subscriptions - all with a simple, high-level API.
† Workers support uses fetch-compatible adapters; see examples.
npm i @shadowpay/core @shadowpay/client @shadowpay/server
# or
pnpm add @shadowpay/core @shadowpay/client @shadowpay/server
import { ShadowPay } from '@shadowpay/client'
const sp = new ShadowPay()
const payment = await sp.pay({
to: '<MERCHANT_PUBKEY>', // your merchant public key
amount: 0.001, // human units
token: 'SOL', // 'SOL' | 'USDC' | 'USDT' | <SPL mint>
wallet: window.phantom, // Phantom / Solflare / Backpack
})
import express from 'express'
import { ShadowPay } from '@shadowpay/server'
const app = express()
const shadowpay = new ShadowPay({ apiKey: process.env.SHADOWPAY_API_KEY! })
app.get('/premium',
shadowpay.requirePayment({ amount: 0.001, token: 'SOL' }),
(req, res) => res.json({ secret: 'Premium content!' })
)
app.listen(3000)
// app/api/premium/route.ts
import { NextRequest, NextResponse } from 'next/server'
import { ShadowPay } from '@shadowpay/server'
const sp = new ShadowPay({ apiKey: process.env.SHADOWPAY_API_KEY! })
export async function GET(req: NextRequest) {
const hdr = req.headers.get('x-payment')
if (!hdr) return NextResponse.json({ error: 'Payment Required' }, { status: 402 })
const ok = await sp.verifyPayment(hdr, { amount: 0.001, token: 'SOL' })
if (!ok) return NextResponse.json({ error: 'Invalid payment' }, { status: 402 })
return NextResponse.json({ secret: 'Premium content!' })
}
Privacy model: No third party (including ShadowPay) can see payment amounts. Sender knows what they paid; facilitators/settlers remain blind.
Program ID: GQBqwwoikYh7p6KEUHDUu5r9dHHXx9tMGskAPubmFPzD (View on Solscan)
shadowpay-sdk/
├─ packages/
│ ├─ client/ # Browser SDK (payment generation, wallet adapters)
│ ├─ server/ # Node SDK (verification, middleware, webhooks)
│ └─ core/ # Shared types/crypto/utils
├─ examples/
│ ├─ nextjs-paywall/
│ └─ express-api/
└─ docs/
| Package | Description | npm |
|---|---|---|
@shadowpay/client |
Browser SDK for making payments | npm |
@shadowpay/server |
Node.js SDK for accepting payments | npm |
@shadowpay/core |
Core cryptographic utilities | npm |
GitHub: https://github.com/Radrdotfun/shadowpay-sdk
app.post('/webhooks/shadowpay',
express.raw({ type: 'application/json' }),
shadowpay.webhooks.handler((event) => {
switch (event.type) {
case 'payment.success':
// handle success
break
case 'payment.failed':
// handle failure
break
case 'payment.refunded':
// handle refund
break
}
})
)
SHADOWPAY_API_KEYdevnet; override via SDK options or envGQBqwwoikYh7p6KEUHDUu5r9dHHXx9tMGskAPubmFPzDpnpm install
pnpm build
pnpm test
Full docs: https://registry.scalar.com/@radr/apis/shadowpay-api/latest
Hide crypto complexity by default. If you want raw primitives (Groth16, ElGamal, Poseidon, nullifiers), they're in @shadowpay/core - but typical apps never need to touch them.
Before
// 50+ lines of proof plumbing and encryption
With ShadowPay
await sp.pay({ to: '<merchant>', amount: 0.001, token: 'SOL', wallet })
@noble/curves@solana/web3.js)PRs welcome! See CONTRIBUTING.md.
git clone https://github.com/Radrdotfun/shadowpay-sdk.git
cd shadowpay-sdk
pnpm install
pnpm build
pnpm -C examples/nextjs-paywall dev
MIT © Radr
devnet. Switch to mainnet-beta when ready.Create encrypted zk-Prof(ile) Pictures with privacy-first photos for the undoxxed by Arubaito
🔒 Create and control encrypted profile photos with zkProf, ensuring privacy and security through zero-knowledge proofs on the Solana blockchain.
Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.
DePIN for Vintage Hardware — Proof-of-Antiquity blockchain where old machines outmine new ones. AI-powered hardware fingerprinting, 15+ CPU architectures, Solana bridge (wRTC). $0 VC.
Drop-in OpenAI Python client with transparent x402 payment support.
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Drop-in OpenAI Typescript client with transparent x402 payment support.
Autonomous AI BD Agent for SolCex Exchange: 24/7 Cross-Chain Token Scoring & Payments 2026
Rust SDK for the x402 payment protocol.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Agent skills for building, shipping, and growing software products