Loops HouseLeash

NEAR HACKATHON
Links
Team
1 member- ALOwner
albertlin.eth
Overview
Leash gives an AI agent a wallet it cannot drain.
A NEAR function-call access key restricts which contract and which methods it may call, but its allowance meters gas, not value: a key limited to a token's ft_transfer can still move the whole balance. So today it is a full-access key or nothing - there is no protocol-level way to say "at most 2 USDC a day, only to these two payees".
Leash closes that gap with NEAR's own primitives. The money sits in an account that holds a contract and, after deployment, zero access keys: nobody can sign for it, and its code can never change. Each agent gets a function-call key restricted to one method, spend, on that account. The contract checks every payment against a rule the agents cannot reach - allow-list, per-transaction cap, per-period budget, time window - and a refusal is a transaction that SUCCEEDS, recording the reason on chain as a NEP-297 event. A panic would roll the explanation back with the payment, so refusing in the open is deliberate.
Two agents are subaccounts of one budget node, so node_of(predecessor) binds them to one ledger with no registry and no channel between them.
Directions are asymmetric. Tightening a rule - lower the cap, drop a payee, pause the account - takes only the admin key and applies instantly: you must be able to stop it the moment you notice. Loosening one, or withdrawing, requires a WebAuthn assertion from a registered passkey, with P-256 verified inside the contract at 33.5 TGas. NEAR has host functions for ed25519 and secp256k1 but not secp256r1, the curve WebAuthn signs with, so that arithmetic runs in the wasm. No server, no oracle, no bridge. A stolen admin key cannot raise a limit and cannot take the money.
Live on NEAR testnet. 218 Rust and 319 JavaScript tests; every claim in the README names the test that proves it, and a test fails if a named one disappears.
Video: https://youtu.be/7FLWybIWORc