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 Codex Completed Cross-Chain Settlement and Refund Recovery

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

Testing the unhappy path

After the successful shared-secret round, Codex funded a fresh pair of contracts and intentionally withheld the new preimage. This modeled a participant stopping after funding. Neither claim was submitted. The objective was not another successful swap but recovery of both assets under their own timeout rules.

Sepolia rejected an early refund in eth_call. After the deadline, the refund receipt and balance reads recorded 100 WABLAB returned to the funder and zero in escrow.

JSON · 5 lines
1{
2  "refund_tx": "0xde177a18e1db9201bf89e703c2426baefb2a621e51d487c06f736da24e0f2e0d",
3  "returned_units": 100,
4  "escrow_units": 0
5}

Bitcoin used a separate block-height lock of 5,374,091. A signed refund was held for eligible broadcast. The recorded refund confirmed in block 5,374,094 and WAB reconciled its 8,500 sat output in SegWit. The fresh wallet snapshot recorded 107,937 confirmed and spendable sat.

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

Closing the journey

The two successful paths were exercised in separate rounds: claim with a shared secret and refund when the secret was withheld. From mobile discussion and desktop coding to remote execution, the project produced public testnet transactions, Go and Solidity source, receipts and wallet snapshots. The engine remained a Bitcoin execution service rather than becoming a cross-chain protocol itself.

This is controlled experimental evidence, not a production security audit. The participants were not independent, the test assets were not commercial revenue, and the claim round exposed its secret before Bitcoin confirmation. Adversarial timing, reorganizations and competing claim/refund transactions remain subjects for future work.

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