hackquest logo

KLINK

KLINK: the agent wallet for 0G. Agents get an API key with zero on-chain power. A Solidity policy contract enforces caps, allowlists, and limits per-tx, so leaked keys can't drain the wallet.

Videos

Description

KLINK, The Agent Wallet for 0G Tagline: Agents that can't go rogue.

The problem. AI agents are spending real money on-chain, and they're getting drained. Not by key theft, by social engineering. Someone tweets a Morse-coded message at an agent and $170K walks out. A poisoned tool response convinces it to approve a transfer. The wallets aren't being hacked; the decision-making is. Every one of these wallets has the same flaw: the agent holds a key that can move everything.

The solution. KLINK is a wallet where the agent never holds authority to drain it. Policy lives on-chain. Three actors, three blast radii:

  • Owner (MetaMask or any EVM wallet): master authority, holds the keys, sets the rules.

  • Backend (session keypair): bounded signer, can only act within policy.

  • Agent (API key only): zero on-chain power. Just a token. No private key, no signing authority, no path to the master.

If the API key leaks, and it will, the attacker can spend up to the daily cap, only to allowlisted addresses, until the human revokes. That's the whole blast radius.

Why 0G. 0G is the chain built for AI agents, and KLINK uses the full stack:

  • 0G Chain is the policy floor. AgentWallet.sol is deployed to 0G mainnet (chain id 16661) at 0x339A659b4922EF815CF0405F70DC804E71C93c96. Every spend, session add, and revoke goes through it. The on-chain validator reverts on any cap, allowlist, or expiry violation. Agents physically cannot move funds outside their session's bounds, regardless of what the backend does.

  • 0G Storage holds the audit trail. Every audit log row mirrors to 0G Storage as a JSON blob via @0gfoundation/0g-storage-ts-sdk, and the merkle root hash is persisted next to the Postgres row. Anyone with the hash can reconstruct the trail without trusting Klink. The audit log survives the backend.

  • 0G Compute is the inference layer. POST /v1/spend/inference lets agents call models on 0G Compute under the same on-chain caps. Klink bills the provider via on-chain transferToken first (which must be in the session's allowlist, or the tx reverts), then calls the inference broker. 0G Compute becomes a safe-to-call API for autonomous agents.

The single line: the on-chain policy floor makes the rest of the 0G stack safe for agents to call.

What's live.

  • AgentWallet.sol deployed on 0G mainnet with per-tx caps, daily caps, allowlists, expiry, and revocation.

  • Backend with session-key signer and the policy gauntlet on every spend path.

  • Owner dashboard (fund, set rules, view audit trail, revoke).

  • SDK and REST endpoint so any agent framework (Eliza, LangChain, custom) can plug in with an API key and spend within bounds.

  • 0G Storage-backed audit trail with verifiable hashes.

  • 0G Compute inference, gated by the same on-chain rules.

  • Split audit log: 0G Chain history for what executed, off-chain log for what got denied (the "policy blocked 4 attempts" dashboard line is the actual security signal).

The bet. Everyone is racing to give agents more autonomy. The hard problem isn't autonomy, it's bounded autonomy. That's the gap KLINK fills, and 0G is the only chain where the bounds can be enforced cheaply, verifiably, and across the full agent stack: signing, storage, and compute.

Progress During Hackathon

<p>Started the hackathon with the concept and finished with a working end-to-end deployment on 0G mainnet.</p><ul><li><p><strong>Policy contract (Solidity, deployed on 0G mainnet):</strong> per-transaction cap, rolling daily cap, recipient allowlist, expiry, and owner-only revocation. Every spend route goes through the same on-chain gauntlet, and violations revert.</p></li><li><p><strong>Vault and session-key architecture:</strong> owner deploys a vault from MetaMask, backend holds a bounded session keypair, agent only ever sees an API key. Three actors, three blast radii, implemented and tested.</p></li><li><p><strong>Backend and SDK:</strong> Node service that authenticates agent API keys, applies off-chain pre-checks, and submits transactions through the session signer. Lightweight SDK so any agent framework (Eliza, LangChain, custom loops) can plug in with a few lines.</p></li><li><p><strong>Owner dashboard:</strong> fund the vault, set and edit policy, view live transaction history, and revoke the agent or session key in one click from MetaMask.</p></li><li><p><strong>Split audit trail:</strong> 0G chain history as the source of truth for what executed, Postgres log for what got denied. The "policy blocked N attempts" view is live.</p></li><li><p><strong>Funding paths:</strong> direct native and ERC-20 transfers into the vault working today. Fiat on-ramp scoped but not shipped.</p></li><li><p><strong>Attack simulation:</strong> ran the Morse-tweet and poisoned-tool-response scenarios against our own agent. Spend attempts outside policy reverted on-chain. Within-policy spends settled in well under a second on 0G.</p></li></ul><p><strong>What's not done yet:</strong> yield integration with a 0G DeFi protocol (manual only for now, by design), and the fiat bridge.</p>

Tech Stack

Solidity
Ethers
Web3

Fundraising Status

<p>Pre-seed, actively raising.</p><p>KLINK is bootstrapped to date. The hackathon build (mainnet contract, backend, SDK, dashboard) was shipped by the core team with no outside capital. We are now opening a pre-seed round to take KLINK from a working mainnet primitive to the default agent wallet on 0G.</p><p><strong>What the round funds:</strong></p><ul><li><p>Security audit and formal verification of the policy contract before broad mainnet rollout.</p></li><li><p>Core team expansion (Solidity, backend, DevRel) to support integrations.</p></li><li><p>SDK coverage across major agent frameworks (Eliza, LangChain, AutoGen, custom runtimes) and reference integrations with 0G ecosystem projects.</p></li><li><p>Fiat on-ramp, yield routing, and multi-agent policy primitives on the product roadmap.</p></li><li><p>Developer growth: docs, sample agents, hackathon sponsorships, and a builder grants pool inside the 0G ecosystem.</p></li></ul><p><strong>Why now:</strong> the agentic AI economy is moving onto 0G faster than wallet infrastructure can keep up. Every agent that ships without bounded authority is a future drain headline. KLINK is the missing primitive, and the window to become the default is open right now.</p><p><strong>Open to:</strong> pre-seed checks from crypto-native funds, AI infra angels, and strategic partners in the 0G ecosystem. Warm intros through the 0G Foundation, Hack VC network, or direct DM all welcome.</p>

Team LeaderKKLINK Project
Sector
DeFiNFTAIGaming

Builders Also Viewed