DEV Community

Baris Sozen
Baris Sozen

Posted on

Anatomy of a BTC Collateral Vault: Native Bitcoin as Agent Collateral, No Wrap, No Bridge, No Custodian

Two numbers landed this week that belong side by side.

First: CoinDesk reported that x402, Coinbase's agent payment protocol, has processed more than 165 million payments this year on a cumulative volume just over $50 million. Do the division: the average agent payment is about 30 cents, and roughly 99% of it settles in USDC. Second, from Chainalysis's June study of the same protocol: transfers over $1 made up about 49% of the value moved in early 2025 - and roughly 95% a year later.

Read together, they say the agent economy's payment layer is high-count and micro-value, while the value itself is concentrating in a shrinking share of larger transfers. Binance said the same thing with its Agent OS cap sheet two weeks ago: agent x402 payments capped at $20 a day, swaps allowed $50,000 a day. Payments are micro. Trades are the money.

And trades, unlike API micropayments, need collateral. An agent taking on a forward obligation, borrowing against a position, or holding one leg of a multi-leg trade has to back that promise with something its counterparty can verify and, on default, actually reach. So today's deep dive is about the best collateral in crypto and the construction that lets an agent post it without handing it to anyone. We call it a BTC Collateral Vault. This is the anatomy.

The collateral problem, stated precisely

Bitcoin is the deepest, most liquid, most widely held asset in the ecosystem. It is also the asset most stranded from where agent trades settle. Today an agent that wants BTC to back an obligation on another chain has two routes, and both re-custody the coins:

  • Wrap it. A custodian takes the BTC and mints a claim token on the settlement chain. The collateral is now an IOU whose integrity depends on auditing the custodian.
  • Bridge it. A validator set or multisig locks the BTC and relays a message. The locked pool is a honeypot, and bridge history is the argument; no specific incident needs naming.

Either way, the agent's "bitcoin collateral" stops being bitcoin the moment it becomes useful. The vault's design goal is blunt: the BTC never leaves Bitcoin, is never represented by a minted token, and never touches a custodian. The only thing that crosses chains is a hash.

The three parts

A BTC Collateral Vault is a hash time-locked contract pointed at a new job. Three mechanisms, all enforced by script rather than by promise:

  1. A hashlock. The coins release only to a party presenting the preimage of a hash. Nobody can move them early, including us - there is no "us" in the spend path.
  2. A timelock. If the obligation is never settled, the agent reclaims its own BTC after a deadline. The refund is a property of the script, not a favor from a keeper.
  3. A cross-chain binding. The settlement contract on the other chain - live end-to-end on Ethereum mainnet today - is keyed to the same hash. Claiming the settlement leg reveals the secret, and that revealed secret is exactly what unlocks the Bitcoin. One preimage settles both sides, or neither side moves.

The script shape

The canonical form of a hash-time-locked output on Bitcoin is two spend paths behind one conditional:

OP_IF
    OP_SHA256 <hash_of_secret> OP_EQUALVERIFY
    <claim_pubkey> OP_CHECKSIG
OP_ELSE
    <timeout> OP_CHECKLOCKTIMEVERIFY OP_DROP
    <refund_pubkey> OP_CHECKSIG
OP_ENDIF
Enter fullscreen mode Exit fullscreen mode

The IF branch is the settlement path: preimage plus the claimant's signature. The ELSE branch is the refund path: after <timeout>, the agent's own key suffices. That is the entire trust model. There is no third branch for an operator, an oracle, or an emergency admin, which means there is also no third branch to attack, subpoena, or prompt-inject.

Two engineering details carry most of the safety weight, and they are worth knowing even if you never write a line of Script:

The hash function is the interoperability layer. SHA-256 is the common denominator: native in Bitcoin Script and cheap on EVM chains. Using the same digest on both legs is what makes "one preimage, both sides" literally true across two very different virtual machines.

Timeouts form a staircase, not a line. The settlement-leg timeout must expire before the Bitcoin-side timelock, with real margin. The party who learns the preimage on the settlement chain needs enough remaining time to use it on Bitcoin, where confirmation is measured in blocks, not milliseconds. Compress that margin and you build a race condition into your own collateral; pick it lazily and you lock capital longer than the trade needs. Timeout parameters are the tuning knob of the whole construction, which is why they are parameters and not constants.

What it honestly costs

We would rather list the costs than have you discover them. Capital is locked for the duration of the window - a locked UTXO earns nothing while it waits, and we have written before about the option value that lockup gives away and what closing it costs. Bitcoin L1 confirmation times bound how tight the timeout staircase can be. And an HTLC's security assumes the hash function stays sound and the chains keep producing blocks - stated because a trust model you cannot state is a trust model you cannot check.

What you get for those costs: the failure mode is "trade did not happen, everyone refunded," never "one side got paid and the other holds a claim on a custodian."

Status, stated plainly

Chain discipline is part of the product, so here is the exact surface: the BTC Collateral Vault mechanism is validated on Bitcoin signet, mainnet pending. The atomic settlement leg is live end-to-end on Ethereum mainnet today. Our Sui contracts are deployed and CLI-tested, with gateway wiring in progress - not live. Nothing in this post is rounded up.

Agents reach all of it the same way they reach an exchange connector now: an MCP server - hashlock-tech/mcp (scoped) on npm, six tools, v0.6.0. The walkthrough of the agent's flow covers the sequence end to end, and the formal settlement model is on SSRN. Docs: hashlock.markets.

The question

The payment layer just proved agents transact at massive count and tiny size, and the value data says the money is concentrating in fewer, larger movements. Those movements will need backing. If your agent could post native bitcoin as collateral - no wrap, no bridge, keys never leaving the agent - what would you have it back first: a forward, a loan, or one leg of a multi-leg trade? And if you would still reach for wrapped BTC instead, tell me why - that answer is the most useful one in the thread.

Top comments (0)