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

stage11-micropayment-aggregation.py

TEXT FILE

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

Download / RawBack to folder
Python · 17 lines
1def aggregate(entries):
2    seen = set()
3    totals = {}
4    for event_id, payee, sat in entries:
5        if event_id in seen or type(sat) is not int or sat <= 0:
6            raise ValueError('invalid obligation')
7        seen.add(event_id)
8        totals[payee] = totals.get(payee,0) + sat
9        if totals[payee] > 21_000_000*100_000_000:
10            raise ValueError('amount overflow')
11    return totals
12
13if __name__ == '__main__':
14    assert aggregate([('a','merchant',3),('b','merchant',7)]) == {'merchant':10}
15    try: aggregate([('a','m',3),('a','m',3)])
16    except ValueError: pass
17    else: raise AssertionError('duplicate accepted')
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