PayMate project.
A full-stack Web3 invoicing application for creating USDC payment links, verifying settlement on GOAT Testnet3, and recording freelancer reputation on-chain.
Project structure
The repository contains two independent parts that work together.
web/Next.js landing page, dashboard, docs, payment checkout, and the /api/* invoice, settlement, and reputation routescontracts/Hardhat project containing the PayMate reputation registryRun the project
- Install and run
cd web npm install npm run dev - Open the application
Visit
http://localhost:3000. The API health endpoint ishttp://localhost:3000/api/health.
Required configuration
Copy web/.env.example to web/.env.local and set the deployment-specific values.
OPENAI_API_KEYOptional intelligent draftingOPENAI_MODELDrafting model nameRPC_GOAT_TESTNETGOAT Testnet3 RPCUSDC_TOKENSettlement token addressREPUTATION_CONTRACTDeployed registry addressPRIVATE_KEYAuthorized reputation issuerDATABASE_URLPostgres connection string for invoice storage (e.g. Neon)NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDOptional — enables the WalletConnect connector for mobile/QR walletsBackend endpoints
/api/healthService health/api/invoices/draftGenerate a reviewable intelligent draft/api/invoicesCreate an approved invoice/api/invoices?freelancer=0x…List wallet invoices/api/invoices/{id}Load one invoice/api/pay/{id}/settleGet 402 requirements or verify payment/api/reputation/{address}Read reputation dataThe API checks transaction success, USDC token address, recipient wallet, and transferred amount before marking an invoice paid.
Application pages
/Product landing page/dashboardInvoice and reputation workspace/pay/{invoice-id}Client wallet checkout/docsProject documentationPayMateReputation.sol
The issuer records a completed job only after verified payment. Anyone can read a freelancer’s completed jobs, total settled value, and score.
recordJob(address freelancer, uint256 amountUsd)
getReputation(address freelancer) returns (Rep)Deploy from the contracts/ directory with the configured GOAT Testnet3 RPC and issuer key.
PayMateReputation0xc2072cc0007cA8fcB84bdA09cFE20014559285BDTestUSDC0xeF9Ea814f011289E28f1c87FE8E0C0F68Aa82446No official Circle USDC exists on GOAT Testnet3 yet, so USDC_TOKEN currently points at a self-deployed 6-decimal test ERC-20 (contracts/contracts/TestUSDC.sol) with an open faucet() for testing.
Production checklist
- Reputation contract deployed on GOAT Testnet3.
- Test settlement token deployed (no official USDC on this testnet yet).
- Persistent invoice storage on Postgres (Neon) — replaced the earlier SQLite-on-serverless-disk approach, which didn't persist between requests.
- ERC-8004 agent identity registration — the registry only exists on GOAT mainnet, not Testnet3.
Frequently asked questions
PayMate is on-chain invoicing and settlement software for independent workers. It creates payment requests, collects payment as a direct wallet-to-wallet USDC transfer via the x402 protocol, verifies that transfer on-chain, and records a portable ERC-8004 reputation credential for the freelancer.
Stripe and PayPal custody the funds and settle to a bank account days later; PayMate never touches the money — payment is a direct wallet-to-wallet transfer the client's own wallet signs. A plain crypto payment link proves a transfer happened but leaves no durable record of trust; PayMate turns every verified settlement into a portable, on-chain reputation credential (ERC-8004) that follows the freelancer across platforms.
x402 is a protocol built on the HTTP 402 Payment Required status code: a server can describe exactly what payment it needs (token, amount, recipient) and a client can fulfill it programmatically, after which the server verifies the on-chain result. PayMate's settlement endpoint returns a 402 with those requirements, then verifies the resulting transaction's token, recipient, amount, and receipt status before marking an invoice paid.
ERC-8004 is an on-chain identity/reputation standard. PayMate's registry contract records a freelancer's completed job count, total settled volume, and trust score on every verified payment — a credential the freelancer owns and can carry to any other application, instead of a review buried in one platform's database.
No. PayMate cannot move a client's funds. Every payment is a direct wallet-to-wallet USDC transfer that the client's own wallet signs; PayMate only verifies that the transfer already happened correctly.
GOAT Network (Testnet3, chain ID 48816) for the current build. Settlement uses a 6-decimal test USDC token; the reputation registry is deployed on the same network.
