DEV Community

Baris Sozen
Baris Sozen

Posted on

Week 13: a second team is now running an AI agent on atomic HTLC swaps. Here is what that validates.

Title: Week 13: a second team is now running an AI agent on atomic HTLC swaps. Here is what that validates.
Tags: mcp, ai, cryptocurrency, blockchain

For most of this spring, the map of the agent economy had a strange gap. Wallets to hold keys. Rails like x402 to move value. Marketplaces and reputation so an agent knows who to trust. And then, at the exact moment two parties settle a trade, a custodian: an escrow contract, an evaluator, a referee holding the money while a decision gets made.

We have spent thirteen weeks arguing that the settlement layer does not need a referee, because a hash-time-locked contract can hold neither side and still guarantee the trade. This week, a second team shipped a live agent that makes the same argument in code. That is worth stopping on.

The signal that mattered this week

KaleidoSwap released KaleidoAgent, described as a self-sovereign trader agent on Bitcoin Layer 2s. It is fully non-custodial. It runs a Lightning and RGB wallet, executes atomic HTLC swaps on the KaleidoSwap DEX, runs DCA and portfolio strategies, manages Lightning channel liquidity, and acts as an interactive wallet assistant. The reasoning layer is an LLM (Claude or OpenAI) driving the kaleido CLI and the wallet primitives underneath.

Read that list again through a settlement lens. An autonomous agent, deciding what to trade, and executing the trade over a primitive where no third party ever holds the funds. That is the exact shape of the thing we have been building. Different network, same bet.

Why the mechanism is the same

KaleidoSwap earlier completed what it described as the first atomic swap of an RGB asset on the Lightning Network mainnet, using tUSDT, an RGB20 version of USDT, over real Lightning channels. The detail that makes it atomic is the one that makes every HTLC atomic:

The payment hash remains identical across both legs of the swap. Paying the wrapped invoice creates a Hash Time-Locked Contract in the Lightning channel, and the HTLC locks the payment behind two conditions: either the correct preimage is revealed before the timeout, or the payment fails and funds return.

One secret. Two legs. Claiming one leg reveals the preimage that claims the other. Miss the timeout and both sides get their money back. No party sits in the middle deciding whether the trade was fair, because the chain is not judging fairness. It is checking whether the asset arrived under a condition both sides agreed to in advance.

This is the same primitive underneath Hashlock. If you have read our earlier posts on escrow-with-a-judge versus atomic locks, this is the atomic-lock camp gaining a second independent implementation, driven by an agent, in the wild.

Where we are the same, and where we diverge

The honest version of a comparison names both the overlap and the edges.

Same: non-custodial, hash-time-locked, agent-driven. Both approaches let an AI agent initiate and settle a swap where no custodian ever holds the funds.

Different: scope and topology. KaleidoAgent is single-network by design. It lives on Bitcoin Layer 2, moving BTC, stablecoins, and RGB assets over Lightning. That is a clean, deep, vertically integrated stack, and it is genuinely impressive engineering.

Hashlock is cross-chain by design. The atomic settlement runs across chains, and the current status is specific: Ethereum mainnet is live end to end today; Sui contracts are deployed and CLI-tested with gateway wiring in progress; Bitcoin is validated on signet with mainnet pending. On top of the settlement primitive sits a sealed-bid RFQ layer, so two agents that hold assets on different chains can request a quote, price it privately, and settle the resulting trade atomically. KaleidoSwap solves trustless trading inside one network's asset universe. We are solving trustless trading between them.

Neither framing makes the other wrong. They are different layers of the same idea, and the fact that both exist is the point.

The week, split in two

If you zoom out to the whole week, the agent economy divided cleanly along one line: who holds the money at the moment of settlement.

The custody camp shipped an enormous amount in June. MetaMask Agent Wallet, Coinbase for Agents, OKX.AI with identity and reputation and escrow, Kustodia turning its Arbitrum escrow into MCP tools an agent can call in plain language. Every one of them is real progress, and every one of them holds the asset, or routes it through an evaluator, at some point during settlement. For hiring an agent to do subjective work, that referee makes sense: someone has to judge whether the deliverable was good.

The no-custody camp is smaller, but this week it stopped being a camp of one. KaleidoAgent on Bitcoin L2, Hashlock across chains: two live approaches, both refusing to put a custodian in the settlement path, both leaning on the same math. When two teams reach for the same primitive independently, without coordinating, that convergence is usually a sign the layer is right rather than the pitch being loud.

What we shipped

Building in public means reporting the unglamorous progress too. This week on our side: our listing on DefiLlama merged, our volume methodology page is live and taking review traffic, and the MCP server (hashlock-tech/mcp, scoped) continues its steady climb on npm. No new chain went live; Ethereum mainnet remains the only end-to-end live network, and we will keep saying exactly that until Sui and Bitcoin mainnet earn the word.

The question we keep coming back to

The custody camp's answer is a referee who holds both sides' money and rules on the trade. The no-custody camp's answer is a hash and a timeout that hold neither. This week made the second camp a little less lonely.

If you are building agents that trade assets and not just pay for tasks, which do you want sitting between them: a party you have to trust, or a condition the chain can check? Tell me where you land, and why.

Top comments (0)