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

stage16-digital-entitlement.py

TEXT FILE

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

Download / RawBack to folder
Python · 21 lines
1import sqlite3
2
3def grant(db, order, buyer, product):
4    with db:
5        db.execute('INSERT OR IGNORE INTO grants VALUES (?,?,?)',(order,buyer,product))
6        row = db.execute('SELECT buyer,product FROM grants WHERE id=?',(order,)).fetchone()
7        if row != (buyer,product):
8            raise ValueError('order binding conflict')
9        return row
10
11db=sqlite3.connect(':memory:')
12db.execute('CREATE TABLE grants(id TEXT PRIMARY KEY,buyer TEXT NOT NULL,product TEXT NOT NULL)')
13assert grant(db,'o1','b1','p1') == grant(db,'o1','b1','p1')
14try:
15    grant(db,'o1','b2','p1')
16except ValueError:
17    pass
18else:
19    raise AssertionError('binding changed')
20assert db.execute('SELECT count(*) FROM grants').fetchone()[0] == 1
21db.close()
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