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-distributed-tracing.py

TEXT FILE

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

Download / RawBack to folder
Python · 21 lines
1from secrets import token_hex
2from dataclasses import dataclass
3import re
4
5@dataclass(frozen=True)
6class Span:
7    trace: str
8    span: str
9    parent: str | None = None
10
11def child(parent=None):
12    if parent is None:
13        return Span(token_hex(16), token_hex(8))
14    if not re.fullmatch('[0-9a-f]{32}', parent.trace) or not re.fullmatch('[0-9a-f]{16}', parent.span):
15        raise ValueError('invalid context')
16    return Span(parent.trace, token_hex(8), parent.span)
17
18root = child()
19a, b = child(root), child(root)
20assert a.trace == b.trace == root.trace
21assert a.parent == root.span and a.span != b.span
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