AgentPay Firewall

Short Description

AgentPay Firewall lets Sellers create protected Algorand x402 payment links and lets Buyers review, authorize, and verify payments without giving up wallet custody.

Inspiration

x402 makes internet-native payments programmable, but a fixed-price API endpoint is still developer infrastructure rather than a complete payment product.

A real Seller needs to decide how much to charge and where the funds should go. A Buyer needs to understand the exact amount, recipient, network, asset, and expiration before approving anything in a wallet.

AgentPay Firewall adds this missing product layer: the Seller creates the payment request, the Buyer receives a signed checkout link, and the x402 challenge must match the agreed payment terms.

What It Does

AgentPay Firewall provides two focused experiences:

  • Seller workspace: Enter a payment title, USDC amount, Algorand receiving address, and description, then generate a signed payment link valid for seven days.
  • Buyer checkout: Open the link, verify the amount, recipient, asset, network, and expiration, connect Pera Wallet, and authorize the payment.

Every payment request is signed using HMAC-SHA256. Modifying the amount, recipient, or any other protected field invalidates the link.

A valid checkout resolves to a dynamic x402-protected resource. Its PAYMENT-REQUIRED challenge is generated from the same Seller-signed terms, preventing the checkout and payment request from silently disagreeing.

Direct x402 Integration

The dynamic protected resource follows this format:

https://agentpay-firewall.vercel.app/api/x402/pay?request=<signed-token>

It uses @x402/express, @x402/core, and the @x402/avm exact payment scheme.

An unpaid request returns HTTP 402 with an x402 v2 PAYMENT-REQUIRED challenge for Algorand Testnet USDC ASA 10458941. Verification and settlement are routed through the GoPlausible facilitator.

The hosted smoke test creates a real Seller request, resolves the Buyer checkout, decodes the deployed challenge, verifies the amount, recipient, network, scheme, and asset, and confirms that a tampered token is rejected.

npm run smoke:checkout

How We Built It

  • React, TypeScript, and Vite for the Seller and Buyer interfaces
  • Vercel serverless functions for payment-link creation and x402 resources
  • HMAC-SHA256 signed and expiring payment-request tokens
  • @x402/express, @x402/core, @x402/avm, and @x402/fetch
  • Pera Wallet for Buyer-controlled authorization
  • GoPlausible for AVM verification and settlement
  • Vitest and hosted smoke tests for deterministic validation

Verified Settlement

The official AVM payment path has completed a real settlement on Algorand Testnet.

A funded Pera Wallet Buyer paid 0.001 USDC through the GoPlausible facilitator. The transaction was confirmed at round 66373009.

View the verified transaction on AlgoKit Lora

This transaction verifies live settlement using the same Algorand network, USDC asset, amount, and Seller address shown in the product demo. The dynamic Seller-link route is independently verified by the hosted checkout smoke and mismatch assertions.

Challenges

The main challenge was transforming an engineer-facing policy prototype into a payment product that ordinary Sellers and Buyers could understand.

The interface had to present Seller configuration, Buyer review, wallet authorization, dynamic HTTP 402 generation, and settlement evidence as one continuous flow without weakening the underlying protocol guarantees.

Another challenge was preserving a strict custody boundary. AgentPay Firewall never receives private keys and never signs payments on behalf of the Buyer. The Buyer remains in control through Pera Wallet.

What We Learned

Protocol correctness alone does not create a usable payment product.

x402 becomes understandable when Seller intent, Buyer consent, wallet authorization, and settlement evidence are presented together. A signed payment link provides the bridge between protocol infrastructure and a workflow real users already understand.

What's Next

  • Persistent Seller accounts and payment dashboards
  • Reusable checkout templates
  • Payment status webhooks
  • Idempotency and replay-protection records
  • Buyer and Seller receipt history
  • Algorand Mainnet production configuration
  • Optional spending policies for autonomous AI-agent Buyers

Built With

React, TypeScript, Vite, Vercel, Express, HMAC-SHA256, @x402/express, @x402/core, @x402/avm, @x402/fetch, Pera Wallet, Algorand Testnet, GoPlausible, and USDC ASA 10458941.

Links

Built With

Share this project:

Updates

posted an update —

Major Update: AgentPay Firewall Is Now a Two-Sided x402 Payment Product

AgentPay Firewall has evolved from an engineer-facing policy prototype into a complete Seller-to-Buyer payment experience on Algorand.

What’s new

  • Seller workspace: Sellers can configure the USDC amount, receiving address, title, and payment description.
  • Signed payment links: Each request becomes a tamper-resistant checkout link with a seven-day expiration.
  • Buyer checkout: Buyers can review the exact payment terms and connect Pera Wallet before authorizing payment.
  • Direct x402 integration: The signed request maps to a live x402 v2 PAYMENT-REQUIRED challenge using @x402/avm.
  • Settlement evidence: The official AVM payment path has completed a verified USDC transaction through the GoPlausible facilitator on Algorand Testnet.
  • Automated verification: Hosted smoke tests validate the amount, recipient, network, asset, payment scheme, and token tamper protection.

The central product principle remains simple: Seller intent, Buyer consent, the x402 challenge, and the settlement receipt must all agree.

Try the product:
https://agentpay-firewall.vercel.app/

View the verified transaction:
https://lora.algokit.io/testnet/transaction/SEQAUK2K5SHHLUA35273OWDNCXXWVODYUUKPZUHQ6JZ2WPQEQWDQ

Source code:
https://github.com/FeeeeelixWong/agentpay-firewall

Log in or sign up for Devpost to join the conversation.

Submission history