SenFund

Turn invoices into USDT payment requests on Whitechain testnet, with simulated conversion and payout

SenFund

Created At

ETHGlobal Mumbai

Project Description

SenFund lets freelancers and small businesses send USD invoices that customers pay in test USDT on Whitechain Sepolia testnet (chain 1874). The merchant creates and signs an invoice in a Next.js workspace, and an LLM drafter can fill it from pasted invoice text. The merchant’s receiving address comes from an ENSv2 name on Ethereum Sepolia, such as merchant.senfund.eth. The customer gets a checkout link to a static page that reads the chain directly, so they can pay with their browser wallet and check the payment even when the merchant’s app is down.

A verified settlement contract records each payment as a public, final event onchain. The merchant never has to trust a processor’s word that the customer paid. A Python backend matches those events to invoices and stores them. It also accepts a pasted transaction hash if a receipt is slow to appear.

After a payment settles, a Chainlink CRE workflow picks a payout provider (for example Mudrex) and records the USD conversion and INR payout. That step is clearly labeled as simulated. Mainnet and live payouts are turned off. Users always sign transactions in their own wallet, and the app never signs on their behalf.

How it's Made

Next.js 16 and React 19 (with Framer Motion) power the merchant workspace. Its catch-all app/api/[...path] route proxies requests to a Python settlement service built on web3.py and eth-account. That service signs each invoice as EIP-712 typed data, stores invoices, and scans Whitechain blocks to match payments to invoices. The Solidity settlement contract is compiled with py-solc-x and verified on the Whitechain Sepolia explorer. It pulls test USDT and accepts each signed invoice only once, which blocks replays.

Whitechain gave us cheap, fast testnet settlement and an official test-USDT token, so every receipt is a public event anyone can verify. ENSv2 on Ethereum Sepolia resolves the merchant’s payout address from merchant.senfund.eth. The checkout checks that name before paying, so rotating the record makes checkout refuse the old address. A Chainlink CRE workflow written in TypeScript (cre/payout) runs after settlement. It picks a payout route, such as Mudrex or a protected P2P fallback, and records a simulated USD-to-INR payout.

The hacky parts:

Checkout is a plain static page with the signed invoice in the link. It reads the chain straight from the browser, so customers can pay and verify while our backend is down. After a restart, the backend scans recent blocks first and catches up on older ones in the background. You can also paste a transaction hash to force a match. For local runs with no testnet, eth-tester and py-evm run a local chain. Each invoice exports an evidence JSON with the transaction hash, block, route and fallback reason, and no personal data.

background image mobile

Join the mailing list

Get the latest news and updates

SenFund | ETHGlobal