Loops HouseNEAR Payment Guard

NEAR HACKATHON
Links
Team
1 member- MAOwner
Marley
Overview
To let an AI agent pay for things, people hand it a wallet key. That key is all-or-nothing, and a spending limit only caps the loss; it does not ask whether the payment should happen. NEAR Payment Guard is a NEAR contract that holds the money and releases it only when two checks both pass: a spending policy (per-payment, rolling 24h and per-counterparty caps) and a fresh risk verdict from ChainWard, signed with ed25519, that the destination is safe to pay. The agent holds only a NEAR function-call access key. By protocol that key cannot attach a deposit or call any other contract, so even a fully compromised agent can only ask the guard to pay and be refused. The guard pays only the deposit address inside a 1Click quote whose signature it verifies, and it releases funds as an mt_transfer inside NEAR Intents, so the money can land on Base or BNB Chain. Existing guards limit how much an agent spends or restrict it to paying its owner; this one lets an agent pay a stranger because it checks the stranger first. Reproduce it with no account, keys or funds: npm test and cargo test check the signing format across TypeScript and Rust, and npm run test:sandbox runs nine scenarios (paid, sanctioned address refused, replay, tampered destination, swapped deposit address, stale verdict, drained budget, wrong method, direct transfer impossible) against the compiled contract in a local sandbox. Limits: NEAR Intents has no testnet, so the sandbox uses a stub and synthetic quotes, plus one real 1Click quote fixture; the live verdict route is not yet provisioned. ChainWard is an existing Base product; the NEAR contract, signing format and demo were built in the window. Most code was written by Claude under human direction.