Shipping x402 payments inside an on-chain credit protocol
How Credow used Algorand TEAL logic and x402 payments to make corporate credit allocation an on-chain primitive — and why the yield vault was the part that made it win.
Credow is my 1st place project from FusionX (IEM Kolkata), and it's the one that made me care about x402: a corporate credit allocation protocol on Algorand where departments *claim* their spend allowance through x402 payments, and any unclaimed credit accrues yield in an on-chain vault.
The premise starts from a boring budgeting problem. Companies hand out spend allocations in spreadsheets. Unused budget sits idle while teams that need it chase a manager for more. There's no clean primitive for "here's a pool of credit, take what you need, and the rest earns something." Web3 was the wrong tool for spreadsheets, but it's the right tool for exactly this: a distribution-and-reclamation protocol.
Why x402, and not a wallet flow
The obvious build is a dApp: departments approve claims in a wallet, sign a transaction, wait for a multisig. That's the path of least resistance and the worst UX. In a hackathon you can't assume your "corporate departments" have MetaMask open.
x402 changes the shape of the interaction: the claim *is* a payment. A department (or the agent acting on its behalf) requests credit, and the x402 payment flow — HTTP 402 "Payment Required," paid, retried — completes the claim. No custody step, no gas ceremony, no separate wallet ritual. The claim and the payment are one atomic event.
That mattered to the judges more than I expected. It turned the protocol from "an on-chain ledger that happens to have a UI" into "a payment primitive you can call from a server." The demo told the story: request, pay, credit lands, done — in a loop that a backend could run unattended.
The TEAL side
On Algorand, the allocation and reclamation rules live in TEAL smart contracts. The key invariant is that a claim is only valid against a department's *remaining* allowance — over-claiming must be impossible, not just discouraged. The contract tracks the allocation and the claimed balance per department, and the vault accumulates what was never claimed by the close of the period.
The yield vault is what won it
A credit pool that just disappears is a budget, not a protocol. Credow's vault is the differentiator: unclaimed allowances don't go to zero — they accrue yield. So there's an economic reason for the system to be efficient, and a concrete, visible output ("here's what the idle credit earned") that a board can point at. It's the difference between a ledger and an instrument.
What I'd do differently
The React 19 front end and Supabase backend were solid but standard. The thing worth doing again, bigger, is the agent story: x402's real power is that non-human callers can pay. The next version would ship a first-class "department agent" that claims, reconciles, and pays on its own schedule — turning the protocol into something that runs without a human clicking *claim*.