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

stage23-account-free-donations.py

TEXT FILE

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

Download / RawBack to folder
Python · 20 lines
1import secrets, hashlib
2
3def digest(token):
4    return hashlib.sha256(token.encode('ascii')).hexdigest()
5
6class Sessions:
7    def __init__(self): self.records={}
8    def create(self, address, now, ttl=900):
9        if type(ttl) is not int or ttl <= 0: raise ValueError('invalid ttl')
10        token=secrets.token_urlsafe(32)
11        self.records[digest(token)]=(address,now+ttl)
12        return token
13    def lookup(self, token, now):
14        row=self.records.get(digest(token))
15        return row[0] if row and now < row[1] else None
16
17if __name__ == '__main__':
18    s=Sessions(); token=s.create('fixture',100,10)
19    assert token not in s.records and s.lookup(token,109)=='fixture'
20    assert s.lookup(token,110) 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