PayLoop

A Buy Now Pay Later system that allow merchants to capture payments in recurring way from users

PayLoop

Created At

HackMoney 2026

Project Description

PayLoop is a recurring payment protocol that allows uses cases like subscriptions, Buy Now Pay Later, and recurring dividends distributions. PayLoop utilizes Merkle Proofs to provide a trustless approach to allow payments collections. In this submission we build a BNPL smart contract and necessary backend and SDK and Widget that allow easy integration into any eCommerce website and be the Klarna equivalent of Web3. PayLoop offers gasless and easy onboarding and UX/UI using Circle Wallets as users need only an email address to join as either merchants or end users. The contracts are deployed through a Factory contract deployed on Arc Testnet allows also for merhcants to deploy their BNPL contract for their eCommerce store in gasless way. Our solution is chain agnostic and can be deployed on any chain and users can send and receive their funds on any chain. The protocol is drafted as an ERC that will be submitted for review that defines the interface and main motivation and required functionlity.

How it's Made

PayLoop is built as a Turborepo monorepo with pnpm workspaces, containing 6 interconnected packages designed for seamless eCommerce integration. Smart Contract Architecture (Built using Solidity 0.8.24 in Hardhat) Factory Pattern: We implemented BNPLFactory.sol that deploys individual MerchantBNPL.sol contracts for each merchant. This ensures complete isolation as each merchant's BNPL payments are secured in their own contract, enabling independent upgrades and simplified auditing. The contracts are deployed on Arc L1 Testnet. Gas-Optimized Recurring Payments: The MerchantBNPL contract handles automated recurring installment collection with a carefully designed architecture:

  • Struct Packing: The Order struct fits in just 2 storage slots by using uint96 for amounts, uint32 for timestamps, and uint8 for installment counts Contracts enable trustless automated collection while maintaining merchant fund security
  • Custom Errors: We use custom errors (InsufficientBalance, PaymentNotDue) instead of require strings for additional gas savings Merkle-Verified Payment Schedules (ERC Draft): We designed IMerkleVerifiedSchedule — an interface for trustless recurring payments where the entire payment schedule is committed on-chain as a Merkle root. Each payment is verified via Merkle proof, ensuring:
  • Tamper-proof schedules: Neither party can modify agreed payment amounts/dates
  • Gas efficiency: Only the root is stored on-chain; individual payments verified via ~3 hashes
  • Dispute resolution: Any party can prove the exact committed schedule
  • Flexible extensions: Subscriptions can be extended with new Merkle roots while preserving history Backend & Credit Scoring (NestJS v10 + MongoDB) The API implements a state mirroring pattern — blockchain is source of truth, MongoDB mirrors for fast queries. We integrated a 3rd Party Credit Scoring API from Blockchain Bureau's on-chain credit scoring to assess creditworthiness before BNPL enrollment, with the backend fetching scores based on wallet transaction history.

Widget SDK: 3-Line Integration The PayLoop widget makes integration trivially easy for any e-commerce site:

import { PayLoopWidget } from '@payloop/widget';

<PayLoopWidget merchantId="your-merchant-id" amount={9999} // $99.99 in cents onSuccess={(orderId, txHash) => console.log('Paid!', orderId)} />

That's it — 3 lines of code to add BNPL to any website. The widget handles:

  • Payment plan selection (Pay in 2, 3, 4, or 6)
  • Wallet connection (MetaMask or Circle Passkeys)
  • USDC approval and order creation
  • Transaction confirmation and callbacks

Using Circle Modular Wallets Integration: Users can pay with just email + fingerprint/Face ID — no MetaMask required (even though we have it integrated). The SDK abstracts wallet types behind a unified WalletAdapter interface, enabling gasless transactions via Circle's Smart Accounts with Passkey authentication.

TypeScript SDK for Custom Integrations, we have built an easy to integrate SDK: const client = new PayLoopClient({ merchantId: 'xxx' }); await client.connect(); const order = await client.createOrder({ amount: 100_000000n, installments: 4 });

The SDK provides full programmatic control for developers who need custom checkout flows.

background image mobile

Join the mailing list

Get the latest news and updates

PayLoop | ETHGlobal