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

stage18-payment-integrity.py

TEXT FILE

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

Download / RawBack to folder
Python · 15 lines
1import hashlib
2import json
3
4def digest(wallet, net, destination, amount_sat, request_id):
5    if net not in ('main', 'test') or type(amount_sat) is not int or amount_sat <= 0:
6        raise ValueError('invalid intent')
7    if not all(type(x) is str and x for x in (wallet, destination, request_id)):
8        raise ValueError('missing identity')
9    return hashlib.sha256(json.dumps(['payment/v1', wallet, net, destination, amount_sat, request_id], separators=(',', ':')).encode()).hexdigest()
10
11if __name__ == '__main__':
12    a = digest('wallet-A', 'test', 'fixture', 1000, 'req-1')
13    assert a != digest('wallet-A', 'main', 'fixture', 1000, 'req-1')
14    assert a != digest('wallet-A', 'test', 'fixture', 1001, 'req-1')
15    assert a != digest('wallet-A', 'test', 'fixture', 1000, 'req-2')
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