
Project
Redshift
prototype
What it does
Lets users purchase items using SOL through a custodial wallet system. The backend creates invoices, derives per-user Solana PDA wallets, and queues payment orders into Redis. A concurrent worker picks up jobs and executes a 3-step on-chain multisig flow: (1) create a transaction proposal, (2) collect 5 owner approvals, and (3) transfer funds to a treasury wallet. A terminal UI (TUI) provides real-time monitoring of the entire pipeline — service health, job stages, wallet balances, on-chain signatures, and live logs — with the ability to start/stop backend, worker, and script processes via hotkeys.
Problem
Processing Solana payments in a custodial setting requires multi-signature authorization to prevent single-point-of-failure theft. Without a multisig pipeline, a single compromised key could drain all user funds. Additionally, there's no visibility into the payment lifecycle once an order is placed — operators need real-time observability into queued jobs, approval progress, and on-chain confirmations.
Approach
Modular Rust workspace split into 5 crates: (1) **backend** — Actix-Web REST API handling user/item/order/invoice creation and PDA wallet derivation, (2) **services** — shared library for Diesel ORM models, Solana utility functions (wallet creation, funding, multisig transaction lifecycle), Redis job queue, and database connections, (3) **worker** — Tokio-based concurrent job processor with semaphore-limited parallelism that executes the create→approve→transfer pipeline and publishes events via Redis Pub/Sub, (4) **tui** — Ratatui-powered terminal dashboard with async pollers for health checks, queue depth, Redis pub/sub events, and process management, (5) **script** — load-testing utility that generates mock orders. On-chain logic uses two Anchor programs: a wallet contract for PDA management and a multisig contract implementing create_transaction, approve (×5 owners), and transfer instructions with PDA-seeded accounts.
Highlights
- Full multisig payment pipeline: create → approve (5 owners) → transfer, entirely on Solana Devnet
- Per-user PDA wallets derived deterministically from user IDs via program-owned PDAs
- Concurrent job processing with Tokio semaphore (5 parallel jobs) and Redis RPOP batching
- Real-time TUI dashboard (Ratatui) with service health monitoring, job stage tracking, wallet balances, and live log streaming
- Redis Pub/Sub event bus connecting worker pipeline stages to the TUI for real-time observability
- Process orchestration from TUI — start/stop backend, worker, and script processes via hotkeys with stdout capture
- Anchor-based on-chain multisig contract with owner verification, approval tracking, and majority-based execution
- Custodial wallet auto-funding: backend checks PDA balance and tops up before order processing
- Diesel ORM with PostgreSQL for persistent order/user/item storage with UUID primary keys
- Custom Anchor discriminator builder for manual instruction construction from the Rust client