Architecture Overview
The TRTH Protocol splits responsibilities between deterministic on-chain rules and operational off-chain services. On-chain code (Solidity 0.8.24) encodes supply caps, epoch schedules, randomness integration, genesis accounting, liquidity bootstrap, and fee recycling. Off-chain services (Node / TypeScript) observe the chain, index state, run keeper automation, and expose read APIs for clients. Together they form a system where users interact through wallets and apps, while the protocol’s economics and randomness remain verifiable on Base.
System diagram
Section titled “System diagram”
Use the diagram together with the sections below to see how TrueBitcoinToken (TRTH) connects to EpochRewardsV1, Genesis, LiquidityBootstrap, FeeSink, VRF plumbing, and the off-chain service stack.
On-chain layer
Section titled “On-chain layer”Smart contracts enforce the non-negotiable rules: 21,000,000 TRTH maximum supply, role-gated minting into emission, genesis, and LP bootstrap buckets, and optional balance sync hooks so rewards logic can react to transfers, mints, and burns. EpochRewardsV1 drives 7-day epochs with base, bonus, and king-style rewards, integrates Chainlink VRF v2.5 (via ChainlinkVrfWordAdapter), and supports claims and carry between periods. Genesis accepts deposits in USDC on Base, models referrals and influencer tiers, and supports batch distribution. LiquidityBootstrap performs one-shot Uniswap V3 position creation. FeeSink collects fees and routes TRTH buyback and burn through V3FeeSinkSwapAdapter. ProtocolTimelock (OpenZeppelin TimelockController) provides delayed governance for sensitive role and parameter changes.
Off-chain layer
Section titled “Off-chain layer”Off-chain components do not mint TRTH or override chain state. The orchestrator is a keeper service: it advances epochs, requests VRF, sweeps bonus flows, and finalizes king outcomes. The indexer ingests chain events into a database — transfers, holder balances, epoch snapshots, and eligibility — so the UI stays responsive without scanning the full chain on every request. The proof-api serves epoch, eligibility, and chain-derived state to frontends and integrations as a read-only HTTP API.
Why this split matters
Section titled “Why this split matters”Keeping consensus-critical rules on-chain means anyone can audit caps, roles, and reward math. Off-chain services add availability and UX: faster queries, automated progression of multi-step epoch/VRF lifecycles, and operational monitoring — without becoming a trusted source of randomness or supply.