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

stage22-checkout-recovery.py

TEXT FILE

757 B · Public source code for developers, search crawlers and AI agents

Download / RawBack to folder
Python · 17 lines
1import sqlite3
2
3def init(db):
4    db.execute('CREATE TABLE IF NOT EXISTS checkout (order_id TEXT PRIMARY KEY, owner TEXT NOT NULL, watch_id TEXT NOT NULL UNIQUE, address TEXT NOT NULL)')
5
6def save(db, order_id, owner, watch_id, address):
7    with db:
8        db.execute('INSERT INTO checkout VALUES (?,?,?,?)',(order_id,owner,watch_id,address))
9
10def restore(db, order_id, authenticated_owner):
11    return db.execute('SELECT watch_id,address FROM checkout WHERE order_id=? AND owner=?',(order_id,authenticated_owner)).fetchone()
12
13if __name__=='__main__':
14    with sqlite3.connect(':memory:') as db:
15        init(db); save(db,'o1','alice','w1','fixture')
16        assert restore(db,'o1','alice')==('w1','fixture')
17        assert restore(db,'o1','bob') is None
Read-only source · Select a line number to link directly · Raw download above

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