The Problem
Most DeFi projects rush to ship a UI. The underlying state management is an afterthought—wallet balances are derived on the fly, transactions have no canonical record, and there is no operator path for reviewing or reversing money-state changes.
When the system breaks (and it will), there is nothing to audit. No paper trail. No recovery path.
This client was building a blockchain-backed banking platform and needed the opposite of that.
What Was Built
Stealth Trails Bank is a production-oriented monorepo that treats correctness and auditability as the core product, not an afterthought.
The architecture separates three distinct surfaces:
- Customer web — account management, deposit requests, wallet view
- API — business logic, identity, state transitions
- Operator/worker paths — internal review, approval/denial, execution
This separation ensures that no customer action directly mutates money state. Every deposit goes through an intent → review → execution pipeline with a full audit record at each step.
The Deposit Flow
The deposit workflow is the heart of the system:
- Customer submits a deposit intent via the web app
- Intent is persisted with status
PENDING_REVIEW - Operator reviews the intent in an internal dashboard and approves or denies
- Approved intents are picked up by a background worker that broadcasts the transaction on-chain
- Worker tracks broadcast status, handles failures, and reports final confirmation
Every state transition writes an audit record. If a deposit is in BROADCAST_FAILED state, the runbook is clear: inspect the audit log, resubmit with the same idempotency key, or escalate to manual resolution.
Wallet Projection Repair
Ethereum wallet balances are derived from on-chain events, but local projections can drift—missed events, reorgs, failed ingestion. Rather than hoping for the best, the system includes projection repair tooling: a set of CLI commands that re-derive wallet state from the chain and reconcile it against the local database.
This is the kind of defensive infrastructure most crypto projects skip. It's the difference between a demo and a banking system.
Key Engineering Decisions
Intent-first deposits. Customers express intent; operators execute. This gives the business full control over risk exposure without requiring smart contract complexity for every edge case.
Prisma over raw SQL. The schema evolves fast in early-stage systems. Prisma's typed migrations and query builder reduced schema drift and made the audit log schema easy to extend as requirements changed.
Runbooks as part of the deliverable. Wallet repair, deposit flow recovery, and operator review procedures are all documented in the repo. Operational clarity is part of the architecture.
Scope
- ✓Customer identity, account lifecycle, and wallet projection repair tooling.
- ✓Deposit transaction intent request flow with internal operator review and approval/denial.
- ✓Worker-driven execution, broadcast tracking, and failure reporting for deposits.
- ✓Docs and runbooks for wallet repair, deposit flows, and operational review.
- ✓Deliberate workflow design: correctness and auditability before UI polish.
Waqas Raza
AI-Native Full-Stack Engineer. Top Rated on Upwork · $180K+ earned · 93% job success. I build production AI agents, LLM systems, Web3 platforms, and full-stack applications.
Hire me on Upwork