Bliq
A custodial cryptocurrency wallet operating natively inside Discord for the TON ecosystem and Gram token. Built with an asynchronous, double-entry ledger backend to handle real-time community microtransactions, off-chain tipping, and automated on-chain deposit tracking.
Implementation Scope
Implemented & Operating
- ― Discord Slash Commands: Native tipping, off-chain user transfers, and live balance inquiries inside Discord servers.
- ― Off-Chain Ledger: Immutable double-entry book keeping. Atomic commits with zero rounding drifts and instant execution.
- ― TON & Gram Deposits: Automated deposit ingestion via continuous RPC polling with dedicated user memo routing.
- ― HMAC Secured API: Decoupled architecture. Discord bot worker and private ledger API authenticate via signed payloads.
Planned & Roadmap
- ― On-Chain Withdrawals: Automated hot-wallet payout pipeline with batching, gas estimation, and manual review triggers.
- ― Web Dashboard: Standalone SvelteKit dashboard with Discord OAuth2 for transaction histories and exportable CSV statements.
- ― Jetton Swaps: Direct DeDust / STON.fi DEX integration for in-chat token swapping without leaving Discord.
- ― Hardware Multisig Payouts: Cold-storage reserve rebalancing via TonConnect multisignature approvals.
Architecture & Security
Click any node in the pipeline to inspect data flow and security guarantees.
Fastify API
Validates signatures and authorization headers. Enforces idempotency via unique request tokens before passing execution to the ledger engine.
HMAC-SHA256 request verification, timestamp drift check, rate limiting
Core Security Mechanisms
Foundational safeguards protecting balances and state transitions against theft, replays, and race conditions.
HMAC-SHA256 Signatures
Inter-service traffic between the bot worker and Fastify API is signed with timestamped HMAC payloads, discarding replayed or tampered commands.
Scoped API Boundaries
The core ledger API rejects external public traffic. Only authenticated internal workers with explicitly scoped credentials can initiate transfer jobs.
Atomic Ledger Transactions
Transfers use database-level atomic blocks (SELECT ... FOR UPDATE) preventing concurrency anomalies and partial state
commits.
Strict Idempotency Keys
Every mutation carries a deterministic idempotency key. Network dropouts or Discord button spam never result in duplicate debit/credit actions.
Secret & Key Isolation
The Discord bot process has zero database credentials or on-chain keys. Hot-wallet seeds and sensitive signing infrastructure remain strictly air-gapped from the front-facing bot.
Double-Credit Protection
TON on-chain deposits are guarded by unique constraints on tx_hash and logical time (lt), making duplicate crediting impossible.