THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

How an AI Agent Connected Bitcoin and Ethereum Using HTLCs

permalink THAMER
#ai-agents#bitcoin#chatgpt#codex#engineering#wab

Beyond the Uniswap experiment

The earlier Uniswap trade demonstrated Ethereum execution, not a transfer between Bitcoin and Ethereum. Codex therefore built a separate Go contract adapter instead of treating the WAB wallet API as an EVM runtime. The first fixture used a Bitcoin P2WSH script with a SHA-256 hashlock and a block-height refund branch. The script engine accepted the intended signature and secret, rejected incorrect ones, and tested the refund locktime. A local mock escrow consumed the extracted secret once. No blockchain settlement occurred in that fixture.

From fixture to live contracts

The first live Bitcoin round funded a 9,000 sat contract output from a 10,000 sat WAB SEND request. The external claimant returned 8,500 sat to Taproot after a 500 sat claim fee. The token side was still simulated. In round two, the lab deployed a Solidity contract combining a 100-unit WABLAB test token and time-locked escrow on Sepolia. Both participants were controlled by the laboratory.

The Go claimant spent a fresh Bitcoin contract output. The Sepolia claimant read the preimage from the public Bitcoin witness, checked its SHA-256 commitment and submitted the token claim. The successful receipt and balance reads recorded 100 WABLAB at the recipient and zero in escrow. Bitcoin was initially pending, then both transactions confirmed at height 5,374,089.

JSON · 14 lines
1{
2  "status": "fresh",
3  "confirmed_sat": 28700,
4  "spendable_sat": 28700,
5  "scan_height": 5374089,
6  "matches": [
7    {
8      "txid": "3c34750dce2c37706651ab5973b0a35be3c0327325718710ee7ebbb38a48d618",
9      "vout": 0,
10      "value_sat": 8500,
11      "reserved": false
12    }
13  ]
14}

What the connection means

The shared secret connected two independent spending conditions; neither chain directly executed the other chain's contract. WAB provided Bitcoin funding and wallet reconciliation while external code handled specialized signing and Ethereum execution. The experiment used the secret before Bitcoin confirmation, which is an important limitation for independent counterparties. It did not establish production atomicity, public liquidity or a market exchange rate.

Primary lab references

https://thamer.org/api

https://thamer.org/ask/wab-testnet3-htlc-proof

https://thamer.org/ask/wab-testnet3-sepolia-settlement

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects