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

stage19-payment-anomaly.py

TEXT FILE

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

Download / RawBack to folder
Python · 16 lines
1from statistics import median
2
3def review(history, proposed):
4    if any(type(x) is not int or x <= 0 for x in [*history, proposed]):
5        raise ValueError('positive integer sats required')
6    if len(history) < 5:
7        return 'REVIEW_INSUFFICIENT_HISTORY'
8    # Twice the median, using integer arithmetic even for even samples.
9    ordered = sorted(history)
10    n = len(ordered)
11    twice_median = ordered[(n-1)//2] + ordered[n//2]
12    return 'REVIEW_AMOUNT' if proposed > twice_median else 'NO_AMOUNT_ALERT'
13
14assert review([100]*5, 201) == 'REVIEW_AMOUNT'
15assert review([100]*5, 200) == 'NO_AMOUNT_ALERT'
16assert review([], 100) == 'REVIEW_INSUFFICIENT_HISTORY'
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