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

stage14-replay-ledger.py

TEXT FILE

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

Download / RawBack to folder
Python · 17 lines
1# SPDX-License-Identifier: 0BSD
2import sqlite3, tempfile
3from pathlib import Path
4
5def claim(path,sender,request_id,expires,now):
6    if type(expires) is not int or not now < expires <= now+300:
7        return False
8    with sqlite3.connect(path) as db:
9        db.execute('CREATE TABLE IF NOT EXISTS seen(sender TEXT, id TEXT, PRIMARY KEY(sender,id))')
10        cur=db.execute('INSERT OR IGNORE INTO seen VALUES (?,?)',(sender,request_id))
11        return cur.rowcount == 1
12
13with tempfile.TemporaryDirectory() as d:
14    p=Path(d)/'ledger.db'
15    assert claim(p,'a','r1',110,100)
16    assert not claim(p,'a','r1',110,100)
17    assert not claim(p,'a','r2',99,100)
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