PAY.ID โ Programmable Payment Policy
Define rules for payments ยท Enforced on-chain ยท No server needed
PAY.ID lets you control who can pay you, how much, and under what conditions โ enforced automatically on-chain.
Use cases:
- Only accept stablecoins (USDC, USDT)
- Set spending limits ($10โ$500)
- Require KYC verification
- Block payments from blacklisted addresses
- Time-based policies (business hours only)
Quick Start: What do you want to do?โ
| I want to... | Start here |
|---|---|
| Test a payment (pay someone) | Simple Usage โ โ 5-minute test |
| Integrate into my dApp | Quick Start โ โ React or Node.js |
| Set up payment rules (receive payments) | Quick Start โ โ Merchant setup |
| Understand how it works | Core Concepts โ โ Deep dive |
How It Worksโ
Context โ Rules (WASM engine) โ Decision โ Proof (EIP-712) โ On-chain Verify
| Step | What Happens |
|---|---|
| Context | Payment details: who's paying, what token, how much, when |
| Rules | Your rules evaluated in a WASM sandbox โ deterministic, auditable |
| Decision | ALLOW โ
or REJECT โ |
| Proof | If ALLOW, an EIP-712 signed proof is generated (payer signs with their wallet) |
| Verify | Smart contract checks the proof, then executes the transfer or reverts |
The contracts never run your rules on-chain โ they only verify the signed proof. This keeps gas costs low.
Choose Your Integration Pathโ
Path A โ React / Frontend (payid-react)โ
Install one package, wrap your app in a provider, and use a single hook. Recommended for most dApps.
import { usePayIDFlow } from 'payid-react'
function CheckoutButton() {
const { execute, status, txHash } = usePayIDFlow()
return (
<button onClick={() => execute({
receiver: '0xMerchant...',
asset: '0xUSDC...',
amount: 50_000_000n, // 50 USDC
payId: 'pay.id/my-store',
})}>
{status === 'idle' && 'Pay 50 USDC'}
{status === 'proving' && 'Sign in wallet...'}
{status === 'success' && 'โ
Paid!'}
</button>
)
}
Path B โ Node.js / Backend (payid)โ
For servers, APIs, automated bots, and ERC-4337 bundlers. The server wallet signs proofs.
import { createPayIDServer } from 'payid/server'
import { Wallet } from 'ethers'
const payid = createPayIDServer({
signer: new Wallet(process.env.PRIVATE_KEY!),
})
const { result, proof } = await payid.evaluateAndProve({
context, payId, payer, receiver, asset, amount,
verifyingContract, ruleAuthority, chainId, blockTimestamp,
})
โ Server Guide โ
The 4 Core Conceptsโ
๐ชช 1. Payment Identity (pay.id/yourname)โ
Not just a wallet address โ it carries your payment rules. When someone pays pay.id/my-store, PAY.ID automatically fetches and evaluates the rules attached to that identity.
๐ 2. Rules (JSON configs)โ
Rules define your payment policy. They are stored on IPFS with their hash committed on-chain. Three formats: SimpleRule, MultiConditionRule, NestedRule. โ Rule Basics โ
๐ 3. Decision Proof (EIP-712)โ
Every approved payment generates a cryptographic receipt signed by the payer's own wallet. No trusted third party needed โ the blockchain verifies it.
โ๏ธ 4. On-chain Enforcementโ
Smart contracts verify the proof (never execute rules). This keeps contracts simple and cheap to audit.
What PAY.ID Is NOTโ
| โ Not | โ But |
|---|---|
| A wallet | A policy layer for payments |
| A payment gateway | A cryptographic proof generator |
| A custodian | An identity + rules protocol |
| A blockchain or L2 | Works on any EVM chain |
Packagesโ
| Package | Description | Install |
|---|---|---|
payid | Core SDK โ rule engine, proof generation | npm i payid ethers |
payid-react | React hooks โ wallet integration | npm i payid-react wagmi viem ethers |
What's Newโ
- ๐ Platform ร PAY.ID Bridge โ Seamlessly blend any platform's milestone escrow with PAY.ID's reputation & policy layer. Composite scoring, policy-gated escrow, and one-liner setup.
- ๐๏ฟฝ Platform Adapters โ Plug in your own reputation/escrow system or unplug PAY.ID's defaults. Perfect for platforms that already have
MilestoneManagerandReputationContract. - ๏ฟฝ๐ก๏ธ VRAN Reputation โ Decentralized trust layer. Check merchant reputation and blacklist status before paying.
- ๐ฆ Bank / QRIS Bridge โ Use PAY.ID as a policy oracle for fiat payment rails (QRIS, SWIFT, SEPA).
- โ๏ธ Configurable Storage Resolver โ Override the storage indexer URL via SDK options instead of global variables.
Live Testnetsโ
Choose a testnet to start building:
| Network | Chain ID | Currency | Faucet |
|---|---|---|---|
| Arbitrum Sepolia | 421614 | ETH | Get ETH โ |
| 0G Galileo | 16602 | A0GI | Get A0GI โ |
| Sepolia | 11155111 | ETH | Get ETH โ |
| Base Sepolia | 84532 | ETH | Get ETH โ |
| Polygon Amoy | 80002 | MATIC | Get MATIC โ |
Contract addresses: See full list โ
Getting Startedโ
New to PAY.ID? Start here:
| Step | Link |
|---|---|
| 1. Test a payment in 5 minutes | ๏ฟฝ Simple Usage โ |
| 2. Integrate into your app | โก Quick Start โ |
| 3. Learn how rules work | ๐ Rule Basics โ |
Already familiar?
| Goal | Link |
|---|---|
| All React hooks (20+) | โ๏ธ React Integration โ |
| Backend / Node.js | ๐ฅ๏ธ Server Guide โ |
| Core concepts deep dive | ๐ Core Concepts โ |