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

stage14-message-authentication.py

TEXT FILE

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

Download / RawBack to folder
Python · 15 lines
1# SPDX-License-Identifier: 0BSD
2import hmac, hashlib
3
4def tag(key, message):
5    if len(key) < 32 or len(message) > 8192:
6        raise ValueError('bounds')
7    return hmac.digest(key,b'agent-message-v1\x00'+message,'sha256')
8
9def verify(key,message,signature):
10    return hmac.compare_digest(tag(key,message),signature)
11
12key=bytes(range(32)) # public fixture only
13msg=b'{"request_id":"r1"}'
14assert verify(key,msg,tag(key,msg))
15assert not verify(key,msg+b' ',tag(key,msg))
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