UsageX

Usage-based payments with off-chain tracking and on-chain USDC settlement.

UsageX

Created At

HackMoney 2026

Project Description

UsageX is a usage-based payment protocol that enables pay-per-use applications without forcing every user action on-chain. Users deposit USDC to open a session, which acts as a credit limit. Actual usage (API calls, minutes consumed, interactions, etc.) is tracked off-chain for instant, gas-free UX. When the session ends, a single on-chain settlement finalizes payments: the consumed amount is transferred to the application treasury and the remaining balance is automatically refunded to the user.

UsageX is designed around session-based accounting and trustless settlement. Off-chain usage is authorized via signed messages from an operator, ensuring that settlement can only occur for verified usage and cannot exceed the user’s deposited balance. Replay protection and nonce-based signatures prevent double settlement and abuse.

To improve usability and safety, UsageX integrates Ethereum Name Service (ENS), allowing users, operators, and treasuries to be referenced using human-readable names instead of raw addresses. This makes usage-based payments more intuitive, auditable, and production-ready.

UsageX demonstrates how modern Web3 applications can achieve Web2-like UX while retaining on-chain guarantees by minimizing transactions and settling only when it matters.

How it's Made

UsageX is built as a session-based, usage-driven settlement protocol using Solidity, Hardhat, and ethers.js. At the core is a smart contract that escrows USDC deposits, enforces per-user credit limits, and finalizes usage with a single on-chain settlement. Users approve and deposit USDC to open a session, while all granular usage events (API calls, time-based usage, interactions) are tracked off-chain to avoid per-action gas costs.

Off-chain usage authorization is inspired by state-channel patterns and aligns with the design philosophy of Yellow Network. Usage is accumulated off-chain during an active session and finalized via a signed settlement message. Each settlement signature includes the user address, consumed amount, nonce, contract address, and chain ID, providing replay protection and preventing over-settlement. On-chain verification ensures that funds cannot be misused and that unused balances are automatically refunded.

The protocol cleanly separates off-chain accounting from on-chain guarantees, demonstrating how instant, Web2-like UX can be achieved while retaining trustless settlement. This architecture minimizes gas usage by reducing multiple interactions into a single settlement transaction.

ENS is integrated at the frontend layer using Ethereum Name Service to resolve human-readable names to addresses and perform reverse lookups. Treasury, operator, and user identities can be represented using ENS names instead of raw addresses, improving usability, safety, and auditability in payment flows.

The project uses a minimal mock USDC contract for local testing, a comprehensive Hardhat test suite covering edge cases and replay protection, Hardhat Ignition for reproducible deployments, and gas reporting to evaluate efficiency. The result is a practical demonstration of how usage-based payments can be built using off-chain accounting, ENS-based identity, and trustless on-chain settlement.

background image mobile

Join the mailing list

Get the latest news and updates