project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

AnyPay

Cross-chain payment settlement app with AI analysis. Any chain, any token, any payment

AnyPay

Created At

ETHGlobal New York 2025

Winner of

Chainlink

Chainlink - Best usage of Chainlink CCIP and/or CCT

Flow Foundation

Flow - Flow Builder Pool Prize

Prize Pool

Project Description

AnyPay addresses the overwhelming complexity and technical barriers that prevent many users from accessing the benefits of blockchain technology and cross-chain payments. The current landscape requires users to understand private keys, seed phrases, multiple wallet extensions, gas fees, network switching, and complex DeFi protocols just to perform basic financial tasks like splitting a dinner bill or settling group expenses. This technical barrier creates a significant adoption gap for many people who could benefit from cryptocurrency's advantages.

Our Web3 payment and expense settlement platform eliminates barriers through three key innovations:

  • Embedded Wallet Creation: Integrates Coinbase's Developer Platform (CDP) for in-app cryptocurrency wallet creation via email or SMS, removing the need for private key management or external wallet extensions.
  • AI-Powered Payment Splitting: Utilizes Google's Gemini AI to understand image and natural language requests, automatically translating complex expense scenarios into structured payment plans with support for equal, item-wise, and custom splits.
  • Cross-Chain Payment Infrastructure: Implements Chainlink's CCIP and PTT protocols for seamless transactions across multiple blockchain networks and various token types.

The versatility of AnyPay extends far beyond simple bill splitting, making it applicable to any scenario involving multiple payees for a single payment. This includes online gambling platforms where multiple players need to contribute to a pot, joint loans on real-world assets where multiple investors share risk and returns, group travel bookings where expenses are split among participants, crowdfunding campaigns where backers contribute to shared goals, and subscription services where costs are distributed among team members.

The business model for AnyPay would operate on multiple revenue streams that align with the platform's core value proposition. At the individual user level, the platform would generate revenue through small transaction fees on cross-chain payments, which vary depending on the complexity of the transaction and the networks involved. These fees would cover network costs and platform maintenance while remaining competitive with traditional payment processors. For enterprise clients, the business model would focus on subscription-based services and volume-based pricing. The key advantage for enterprises is that they can standardize on a single blockchain network and token while their users automatically have their payments bridged to their preferred networks, eliminating the complexity of managing multiple blockchain integrations and allowing enterprises to focus on their core business operations rather than blockchain infrastructure.

How it's Made

I’ll never forget my very first commit to the AnyPay repository. It was a simple boilerplate NextJS application, which served as the foundation for what would eventually become a full fledged product. Let’s break down this product into its nitty-gritties.

The frontend is built with Next.js, utilizing React state management and Tailwind CSS for styling components. The backend is built on the Next.js API routes, using Node.js runtime for server-side execution, and MongoDB for database operations. MongoDB is used for the persistent storage of users and payment documents to connect the client with the server.

The smart contract infrastructure uses Hardhat with Solidity, supporting multiple testnet networks including Ethereum Sepolia, Arbitrum Sepolia, and Base Sepolia.

In terms of partner technology, we integrated Coinbase's Developer Platform, Chainlink, and deployed on Flow's Testnet.

For Coinbase, we integrated their CDP Embedded Wallets to allow us to onboard users who are not web3 native, and don’t have cryptocurrency wallets. This expands our reach tremendously by not limiting our user base to just web3 native users. Additionally, we are using the X402 Payment Protocol to wrap our AI agent API into one that acts as a “seller” using X402. Then, we are creating a CDP Server Wallet for our application that makes microtransactions to pay for this X402 protected AI Agent API, making it the “buyer” for this API. To ensure a seamless user experience, we are utilizing the CDP Data APIs to obtain the token balances of the user before making a payment. We are also implementing the Coinbase OnRamp feature to allow users to fund their accounts in order to make the payments. Overall, the Coinbase technology benefited our product enormously as it eliminated the need to build wallet infrastructure from scratch, made it easier to pay for paid API services and enabled non-crypto users to onboard seamlessly.

Chainlink is the backbone of the payment settlement system. We deployed the CrossChainPaymentSplitterPTT contract across Ethereum Sepolia, Arbitrum Sepolia, and Base Sepolia testnets, leveraging Chainlink's Cross-Chain Interoperability Protocol (CCIP). The contract architecture implements Chainlink's Programmable Token Transfers (PTT) pattern, enabling automatic token conversion where CCIP-BnM is received on the destination chain and instantly converted to USDC to a 1:1 ratio for settlement. The smart contract integration utilizes CCIP's Client.EVM2AnyMessage structure with custom gas limits of 500,000 for cross-chain execution. It implements OpenZeppelin's SafeERC20 library for secure token transfers. We configured chain selectors for each testnet network and implemented automatic fee calculation using CCIP's native token fee structure. The frontend integrates CCIP transaction tracking through message IDs, providing real-time status updates and linking to the CCIP Explorer for cross-chain transaction visibility.

The contract architecture that handles expense creation, contribution tracking, and settlement while the CCIP integration manages cross-chain token transfers, implementing safe transfer patterns with OpenZeppelin's SafeERC20 library and custom error handling, with Ethers.js v5 for frontend blockchain interactions and automatic network detection and transaction routing with fallback mechanisms. The AI-powered debt settlement system integrates Google's Gemini AI through OpenRouter's API wrapper using the gemini-2.5-flash-lite model, implementing function calling to extract structured data from natural language requests for automatic payment plan parsing, using sophisticated prompt engineering that adapts to conversation state and user input, supporting both text and image inputs with photo analysis capabilities.

One thing that we did that was particularly hacky was creating our own API to wrap an existing paid API that did not support X402 payments. Doing this allowed our API to become an official X402 protected “seller”, making it easy for anyone to pay for it using X402 payments. This essentially means that the application is paying its own API in microtransactions to call another paid API service, which in my opinion, is pretty hacky.

background image mobile

Join the mailing list

Get the latest news and updates