◇ Data flow · the custody boundary

How it's wired.

A message enters at Telegram and only ever reaches the signer through an auth gate. The key sits on the far side of a boundary the chat layer cannot cross.

Telegrammessage in Auth gateID · pwd · OTP Token watcherdetect SPL Splitteratomic multi-send Jupiter swapbest route + gates Signerisolated key CUSTODY BOUNDARY
01 / MODULES

The pieces.

src/bot

Telegram layer

Receives commands, routes them, suggests the closest command on a typo. Holds no keys and makes no signing decisions on its own.

src/auth

The gate

Allowlist, Argon2 credentials, session state, and single-use OTP replay tracking. Every fund-moving path passes through here first.

src/watch · src/swap

Watcher & Jupiter

The token watcher spots incoming SPL across child accounts; the swap module routes to SOL through Jupiter with slippage and price-impact gates.

src/split

Splitter

Parses /send input, resolves aliases against a fixed contacts file or a literal address, validates, and builds one atomic multi-recipient transaction.

src/vault

Signer boundary

One interface, swappable backend: local AES-256-GCM keystore, KMS, or custody. The rest of the app asks it to sign — it never sees the raw key.

src/audit

Ledger

Append-only, hash-chained log of every attempt. verifyAuditChain() re-walks the chain to prove nothing was edited.

02 / A SEND, STEP BY STEP

One command's path.

1 · Parse — /send parsed into amounts + destinations. LLM parsing (optional) can only map to a known alias or literal address.src/split/parser
2 · Auth — numeric ID on the allowlist, active session, fresh OTP that isn't already burned.src/auth
3 · Validate — every recipient resolves to a real address; amounts are within bounds.src/split/validator
4 · Sign — the built transaction crosses the custody boundary to the signer. The key never comes back out.src/vault/signer
5 · Broadcast + log — one atomic transaction sent; the attempt and result append to the hash-chained ledger.src/audit/log