The multi-chain payment infrastructure for humans and AI agents. Non-custodial crypto payments, escrow, web wallet, Lightning, x402 protocol, and Stripe β all in one platform.
coinpayportal.com Β· Docs Β· SDK Β· Discord
CoinPay is a non-custodial payment gateway that lets merchants accept crypto, Lightning, and card payments. It's designed for both traditional e-commerce and the agent economy β AI agents can create wallets, send payments, manage escrows, and pay for APIs autonomously.
- 7 blockchains: Bitcoin, Bitcoin Cash, Ethereum, Polygon, Solana, USDC (ETH/POL/SOL/Base)
- Non-custodial: Funds go directly to merchant wallets β no intermediaries
- Real-time processing: Instant payment detection and forwarding
- 0.5% platform fee: Automatically deducted during forwarding
- QR codes: BIP21/EIP-681/Solana Pay URIs for one-tap wallet opens
- Webhook notifications: Real-time payment callbacks
- Instant payments: Sub-second settlement via Lightning
- BOLT12 offers: Static payment endpoints β no invoice management
- Greenlight nodes: Managed CLN nodes for merchants
- Near-zero fees: Fractions of a cent per payment
- Trustless escrow: Hold funds until both parties are satisfied
- Multi-chain: BTC, ETH, POL, SOL escrow support
- Token-based auth: No accounts needed β unique tokens for each party
- Recurring escrow: Automated periodic escrow creation (subscriptions, rent, etc.)
- Auto-refund: Expired funded escrows automatically refunded on-chain
- Dispute resolution: Built-in dispute flow with evidence submission
- Shareable links:
/escrow/manage?id=xxx&token=yyyfor both parties
- No signup, no KYC: Create a wallet instantly in the browser
- Multi-chain: BTC, ETH, SOL, POL, BCH + USDC addresses
- Client-side encryption: Private keys never leave the browser
- Send & receive: Full transaction support across all chains
- Seed phrase backup: Standard BIP-39 mnemonic with encrypted export
- API-first: REST API + SDK for programmatic access (AI agents, bots)
- Transaction history: Full tx history with explorer links
- HTTP-native machine payments: Paywall any API route with HTTP 402
- Multi-chain facilitator: The only x402 implementation supporting BTC, ETH, SOL, POL, BCH, USDC (4 chains), Lightning, and Stripe
- SDK middleware: Express/Next.js middleware β set a USD price, buyers pick their chain
- Client library:
x402fetch()wrapsfetch()β handles 402 β pay β retry automatically - Facilitator API:
/api/x402/verifyand/api/x402/settleendpoints - Built for agents: AI agents pay for API calls with any crypto or Lightning
// Merchant: paywall a route
app.get('/api/premium', x402({ amountUsd: 5.00 }), (req, res) => {
res.json({ data: 'premium content' });
});
// Client: pay automatically
const response = await x402fetch('https://api.example.com/premium', {
paymentMethods: { base: { signer: wallet } },
});- Stripe Connect: Merchant onboarding with Connect Express
- Card + crypto: Accept both card and crypto on the same checkout
- Escrow mode: Card-funded escrows with Stripe as payment method
- Payouts: Automated merchant payouts via Stripe
- Decentralized identifiers:
did:web:coinpayportal.com:merchant:<id> - 7-dimension trust vectors: Economic, Productivity, Behavioral, Delivery, Reliability, Accountability, Compliance
- ActionReceipt schema: Cryptographically signed receipts from escrow settlements
- Cross-platform portability: Reputation travels with your DID across platforms (e.g. ugig.net)
- Embeddable badges: SVG trust badges for external sites
- Anti-gaming: Diminishing returns + 90-day recency decay
- Platform Action API: External platforms submit reputation signals
- NPM package:
@profullstack/coinpay - Full CLI:
coinpay payment create,coinpay escrow create,coinpay wallet create,coinpay x402 test - ESM module: Import directly into Node.js applications
- AI agent skill: Feed
/skill.mdto any AI agent for autonomous operation
- Node.js 18+ and pnpm
- Supabase account
- RPC provider accounts (Alchemy, Infura, or public nodes)
git clone https://github.com/profullstack/coinpayportal.git
cd coinpayportal
pnpm install
cp .env.example .env.localConfigure your .env.local with the required credentials:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Encryption
ENCRYPTION_KEY=your_32_byte_encryption_key
# RPC Providers
BITCOIN_RPC_URL=https://your-bitcoin-rpc
ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
POLYGON_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Platform Fee Wallets
PLATFORM_FEE_WALLET_BTC=your_btc_address
PLATFORM_FEE_WALLET_ETH=your_eth_address
PLATFORM_FEE_WALLET_POL=your_pol_address
PLATFORM_FEE_WALLET_SOL=your_sol_address
# Tatum API (exchange rates)
TATUM_API_KEY=your_tatum_api_key
# Webhook
WEBHOOK_SIGNING_SECRET=your_webhook_secret
# Greenlight / Lightning (optional)
GL_NOBODY_CRT=/path/to/client.crt
GL_NOBODY_KEY=/path/to/client-key.pem
# Stripe (optional)
STRIPE_SECRET_KEY=sk_live_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
Run the dev server:
pnpm devnpm install @profullstack/coinpayimport { CoinPay } from '@profullstack/coinpay';
const client = new CoinPay({ apiKey: 'cp_live_xxxxx' });
// Create a payment
const payment = await client.payments.create({
businessId: 'biz_123',
amount: 100,
currency: 'USD',
blockchain: 'eth',
});
// Create an escrow
const escrow = await client.escrow.create({
chain: 'sol',
amount: 500,
depositorAddress: 'So1...',
beneficiaryAddress: 'So2...',
expiresIn: '7d',
});
// Create a web wallet
const wallet = await client.wallet.create({ password: 'secure' });
// β { id, addresses: { btc, eth, sol, pol, bch } }# Payments
coinpay payment create --amount 100 --currency USD --blockchain eth
coinpay payment status --id pay_xyz
# Escrow
coinpay escrow create --chain sol --amount 500 --depositor So1... --beneficiary So2...
coinpay escrow release --id esc_123 --token rel_xxx
# Web Wallet
coinpay wallet create
coinpay wallet send --chain eth --to 0x... --amount 0.1
# x402
coinpay x402 test --url http://localhost:3000/api/premium
coinpay x402 status
# Reputation
coinpay reputation profile did:web:coinpayportal.com:merchant:123- API Reference β Full REST API documentation
- SDK & CLI β Node.js SDK and CLI reference
- x402 Integration β x402 payment protocol guide
- Architecture β System design overview
- Database Schema β Supabase schema reference
- Security β Security best practices
- CPTL PRD β Reputation protocol design document
- Platform Integration β Integrate CPTL reputation
- Frontend: Next.js 16 + TypeScript + TailwindCSS
- Backend: Next.js API Routes (serverless)
- Database: Supabase (PostgreSQL) with Row-Level Security
- Blockchain: Self-hosted wallet generation, multi-RPC failover
- Lightning: Greenlight (CLN) managed nodes
- Testing: Vitest β 2,800+ tests
- CI: GitHub Actions with automated build + test
coinpayportal/
βββ docs/ # Documentation
βββ src/
β βββ app/
β β βββ api/
β β β βββ auth/ # Authentication
β β β βββ payments/ # Payment endpoints
β β β βββ escrow/ # Escrow endpoints
β β β βββ lightning/ # Lightning endpoints
β β β βββ reputation/ # DID & trust endpoints
β β β βββ x402/ # x402 facilitator (verify/settle)
β β β βββ ...
β β βββ dashboard/ # Merchant dashboard
β β βββ web-wallet/ # Non-custodial wallet UI
β β βββ escrow/ # Escrow management UI
β β βββ x402/ # x402 dashboard
β β βββ reputation/ # DID & trust profile
β βββ components/
β βββ lib/
β β βββ blockchain/ # Multi-chain providers
β β βββ lightning/ # Greenlight + LNbits
β β βββ payments/ # Payment processing
β β βββ web-wallet/ # Wallet SDK (keys, signing, fees)
β β βββ reputation/ # Trust engine
β β βββ crypto/ # Encryption
β βββ types/
βββ packages/
β βββ sdk/ # @profullstack/coinpay (SDK + CLI)
βββ supabase/
βββ migrations/ # Database migrations
pnpm test # Run all 2,800+ tests
pnpm test:watch # Watch mode
pnpm test:coverage # Coverage report
pnpm build # Production build- Private keys encrypted at rest (AES-256)
- Client-side key generation for web wallet (keys never leave browser)
- Row-Level Security on all Supabase tables
- API key + JWT authentication
- Rate limiting on all endpoints
- Webhook signature verification
- Replay protection on x402 payments (nonce-based)
- Multi-chain payments (BTC, BCH, ETH, POL, SOL, USDC)
- Non-custodial web wallet
- On-chain escrow with auto-refund + recurring
- Lightning Network (BOLT12 via Greenlight)
- x402 payment protocol (multi-chain facilitator)
- DID reputation protocol (CPTL)
- SDK & CLI
- Subscription plans & entitlements
- Stripe card payments (in progress)
- x402 Solana signature verification
- CPTL Phase 3 β Anti-collusion engine
- CPTL Phase 4 β ZK proofs, cross-chain anchoring
- Mobile SDK
- WooCommerce / Shopify plugins
- Fiat off-ramp
Contributions welcome! See CONTRIBUTING.md.
MIT β see LICENSE.
- Docs: coinpayportal.com/docs
- Discord: discord.gg/U7dEXfBA3s
- Email: support@coinpayportal.com
- Issues: GitHub Issues
Built with β€οΈ by Profullstack Inc