BlockPay

A hackathon prototype for sending USDC to saved wallet contacts through the MoonPay widget, with a gas fee comparison.

HackHounds 3.O

🎓 SRMIST, Delhi-NCR

📌 Delhi, India

🚀 24 hours Hackathon Project

What it is

BlockPay is a prototype for cross-border payments with stablecoins. A user connects a crypto wallet, saves other wallet addresses as named contacts, and pays a contact in USDC, a stablecoin pegged to the US dollar. A dashboard compares estimated transfer fees on three networks.

Three people built it in 24 hours at HackHounds 3.0.

How it works

The code is an npm workspace with two packages. frontend/ is a Next.js 15 app. blockchain/ is a Hardhat project.

The payment flow has four steps:

  1. The user connects a wallet through wagmi. The app supports injected wallets, MetaMask and Coinbase Wallet on Ethereum, Sepolia, Polygon and Arbitrum.
  2. The user adds a contact: a name and a wallet address. The server saves it in PostgreSQL through Prisma, keyed by the owner's address and the contact's address.
  3. On the pay page, the user picks a contact and enters an amount in USD. The app opens the MoonPay buy widget, with USDC as the currency and the contact's address as the destination wallet.
  4. When MoonPay reports the transaction as complete, a server action records the sender, recipient and amount in the Payment table. The history page lists those rows.

The dashboard reads estimated fees from wagmi for Ethereum, Polygon and Arbitrum. It converts them to USD with CoinGecko prices and sorts the networks from cheapest to most expensive. If the price request fails, it falls back to fixed prices.

What I built

I built the contact list, the create-contact action and the saving of payment records. I also updated the payment form and the initial app scaffold. A teammate (kryyo1441) built the MoonPay integration and the payment form. Sundaram built the Prisma schema, the payment history on the dashboard and the bottom dock.

Design decisions

Delegate the money movement to MoonPay. Payment and fiat conversion happen inside the MoonPay widget, which buys USDC straight into the recipient's wallet. The app does not run its own payment contract. This keeps the prototype small. The trade-off is a dependency on a third-party service for the part of the flow that handles money.

Identify users by wallet address. There is no separate login. Contacts belong to the connected address, and the Contact table uses the owner and contact addresses as its composite key. The server actions do not verify a wallet signature. A production version would need that check (inference from the code).

Typed contract bindings. wagmi.config.ts runs the wagmi CLI with the Hardhat plugin to generate typed ABIs from blockchain/. The only contract there is Hardhat's sample Lock.sol. The repository includes deploy and interact components for it, but the dashboard page does not use them.

Challenges

One of the biggest challenges we encountered was the lack of 1-to-1 fiat-pegged tokens on testnets. Stablecoins like USDC and USDT are crucial for cross-border payments. Their absence or unreliable availability on test networks made testing real-world scenarios difficult.

To work around this, we had to map the testnet tokens to real ones. That introduced inconsistencies when simulating real-world liquidity and exchange rates. It also made it harder to validate transaction flows under realistic conditions.

Run it locally

Prerequisites: Node.js, npm and a PostgreSQL database. The frontend reads DATABASE_URL and NEXT_PUBLIC_MOONPAY_API_KEY from frontend/.env.

  1. Clone the repository and install dependencies from the root.

    git clone https://github.com/Crew-object-Object/BlockPay.git
    cd BlockPay
    npm install
    
  2. Create the database tables.

    cd frontend
    npx prisma migrate dev
    cd ..
    
  3. Start the frontend.

    npm run dev
    

Reference

AreaChoiceUsed for
FrameworkNext.js 15, React 19, TypeScriptPages and server actions
StylingTailwind CSS, shadcn/uiInterface
Walletswagmi, viemConnection, fee estimates
PaymentsMoonPay React widgetUSDC purchase to the recipient
DataPostgreSQL, PrismaContacts and payment history
ContractsHardhat, Solidity 0.8.28Sample contract and generated ABIs

Outcome

  • BlockPay was built at HackHounds 3.0, a Major League Hacking event in Delhi, on 2025-02-27. The team had three members and did not place.
  • The repository has 23 commits, all between 2025-02-27 and 2025-02-28, from three contributors.

Liked BlockPay? Here's my background.

Full-stack TypeScript, shipped to real users.