HSK Chain Horizon Hackathon Seoul · Track 2: Agent Payments

Give each AI agent a budget it cannot overspend, enforced on HSK mainnet.

The owner sets a daily allowance, a per-payment limit, the shops the agent may pay and a cooldown. The agent must ask the contract before every payment. If the budget says no, the payment is blocked on chain with a plain reason, and only the owner can change the budget.

Watch the demo

89 seconds, captions on screen. Every claim links to a mainnet transaction below. Source code on GitHub

How it works, in three steps

How Leash works Step 1: the human owner sets the agent budget on the contract. Step 2: the agent asks the contract before each payment. Step 3: the contract either allows it and records a receipt, or blocks it with a reason. 1 Owner sets the budget 50 USD a day, 5 USD max per payment, listed shops, cooldown. Only the owner. 2 Agent asks first Every payment starts with requestPayment on the mainnet contract. 3 Allowed or blocked ✓ within budget: owner approves, receipt minted ✕ over budget: reverts with a plain reason
  1. Owner sets the budget. Daily allowance, per-payment limit, listed shops, cooldown. Only the owner key can change it.
  2. Agent asks first. Every payment starts with requestPayment on the mainnet contract.
  3. Allowed or blocked. Within budget: the owner approves and a receipt is minted. Over budget: the call reverts with a plain reason.

What is different

Several agent-payment entries prove that one signed payment matches its quote. Leash is about the budget around all the payments.

A budget per agent, on mainnet

Daily cap, per-payment max, shop list and cooldown live in a verified contract on HSK mainnet, not in a demo server or on testnet.

Owner and agent are two keys

The agent can only ask. The owner alone edits the budget and approves. You can see the two different addresses on Blockscout.

owner 0xbB23…3043
agent 0x186d…e368

A real blocked payment, with its reason

The agent tried 9.00 USD against a 5.00 USD per-payment limit. Mainnet said no, and Blockscout shows the decoded reason.

See the blocked tx →

Live budget, read from mainnet

Read-only. This page calls the contract directly over the public HSK RPC; no wallet, nothing is sent.

Agent 0x186d…e368

reading…
Left today
…
Daily allowance
…
Max per payment
…
Cooldown
…
Listed shop
… 0x5e11…00a1
Payment intents so far
…

Why blocked? Ask the contract

Runs the contract's own check() as a read-only call for this agent. Nothing is spent.

Try 9.00 USD: it is over the 5.00 USD per-payment limit.

All reason codes

    Latest signed receipt

    HSP mock (QA access pending)
    Intent
    …
    HSP flow
    …
    Status trail
    …
    Settle tx
    …
    Signature
    …

      Paying through HSP

      HSP mock (QA access pending) HashKey's HSP QA gateway has not allowlisted us yet. Until it does, the HSP steps run against a mock that follows the documented shapes and checks real signatures. The budget contract and receipts above are real mainnet.

      1. Budget first. requestPayment on the vault. Blocked payments never reach HSP.
      2. Prepare. create_order → prepare_payment returns an EIP-712 payment mandate.
      3. Check before signing. Leash compares the EIP-712 data with the purchase: chain id, token, recipient = listed shop, value = the budget-checked amount. Any mismatch refuses.
      4. One human approval. The owner approves a card built from that checked message and signs in their own wallet; the vault records approve.
      5. Honest status. finalize_payment, then query_payment: payment-safe is shown as "confirming"; "finalized" only after payment-finalized.
      6. Receipt. settle stores hashes of flow_id, payment_request_id, the policy and the HSP tx on chain.

      Roadmap

      • Now Budget contract live and verified on HSK mainnet; owner/agent split; allowed, blocked and settled payments on chain.
      • Next Live HSP QA round trip once our access is allowlisted (no code change needed).
      • Then Several agents under one owner (buyer, data, ops), each with its own budget in the same contract.
      • Later Owner budget editor and spend alerts in a small web app.

      Team

      Dr. Tharun Reddy Kandukuri, individual entrant.

      Hackathon prototype. No financial returns are promised. Leash is non-custodial: it holds no one's keys or funds, and the mainnet contract only reserves budget and records receipts.

      Source code on GitHub: Tharun2075/leash