Skip to main content

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 dAppQuick Start โ†’ โ€” React or Node.js
Set up payment rules (receive payments)Quick Start โ†’ โ€” Merchant setup
Understand how it worksCore Concepts โ†’ โ€” Deep dive

How It Worksโ€‹

Context โ†’ Rules (WASM engine) โ†’ Decision โ†’ Proof (EIP-712) โ†’ On-chain Verify
StepWhat Happens
ContextPayment details: who's paying, what token, how much, when
RulesYour rules evaluated in a WASM sandbox โ€” deterministic, auditable
DecisionALLOW โœ… or REJECT โŒ
ProofIf ALLOW, an EIP-712 signed proof is generated (payer signs with their wallet)
VerifySmart 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>
)
}

โ†’ React Quick Start โ†’


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 walletA policy layer for payments
A payment gatewayA cryptographic proof generator
A custodianAn identity + rules protocol
A blockchain or L2Works on any EVM chain

Packagesโ€‹

PackageDescriptionInstall
payidCore SDK โ€” rule engine, proof generationnpm i payid ethers
payid-reactReact hooks โ€” wallet integrationnpm i payid-react wagmi viem ethers

What's Newโ€‹


Live Testnetsโ€‹

Choose a testnet to start building:

NetworkChain IDCurrencyFaucet
Arbitrum Sepolia421614ETHGet ETH โ†’
0G Galileo16602A0GIGet A0GI โ†’
Sepolia11155111ETHGet ETH โ†’
Base Sepolia84532ETHGet ETH โ†’
Polygon Amoy80002MATICGet MATIC โ†’

Contract addresses: See full list โ†’


Getting Startedโ€‹

New to PAY.ID? Start here:

StepLink
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?

GoalLink
All React hooks (20+)โš›๏ธ React Integration โ†’
Backend / Node.js๐Ÿ–ฅ๏ธ Server Guide โ†’
Core concepts deep dive๐Ÿ“– Core Concepts โ†’