Two Chains, One Thread
stealthCORE and stealthPRIVATE are two independent blockchains that converge into a single shared processing thread — ensuring deterministic timekeeping and enabling near-instant cross-chain swaps.
Why Single-Threaded?
Network timekeeping demands both chains share the exact same clock. A single combined thread for messaging + production + validation eliminates clock drift and deadlock risks. Compute-heavy operations (ZK proofs, signatures, feework) are parallelized in worker threads, then fed synchronously back into the main loop.
Public Consensus Layer
Independent blockchain handling public transactions with feework-based validation. Has its own block format, QPRegistry coupling, and signature scheme. Blocks arrive into the shared thread synchronously.
Privacy-Preserving Layer
Independent blockchain processing zero-knowledge proofs for confidential transactions. Separate protocol, separate block format — but shares the same processing thread and clock as stealthCORE.
One Thread, Both Chains, Same Clock
The key architectural decision: a single thread handles P2P messaging, block production, and validation for both stealthCORE and stealthPRIVATE. This is not a merged chain — they are two separate protocols running on one shared execution loop. This eliminates deadlocks, ensures deterministic timekeeping, and makes cross-chain swaps nearly instant. Compute-heavy operations (ZK proofs, signature checks, feework) are dispatched to parallel worker threads, with results fed synchronously back into the main loop.
Processing Flow
Block Arrives from Either Chain
A new stealthCORE or stealthPRIVATE block is received via P2P. Both chains feed into the same combined thread synchronously — two separate protocols, one entry point.
Dispatch Heavy Validation to Workers
The main thread dispatches compute-intensive work to parallel workers: ZK proof verification for PRIVATE blocks, feework and signature checks for CORE blocks.
Synchronous Result Collection
Workers complete and results are fed back synchronously into the combined thread, preserving deterministic ordering and the shared clock across both chains.
Update Registry & State
QPRegistry updates, staker records, and block confirmations are processed in-thread. Single-threaded access means no locking or deadlocks for either chain's registry.
Produce & Broadcast (Per Chain)
The shared thread produces a new block for whichever chain's turn it is and broadcasts it. Both chains tick on the same clock, enabling near-instant cross-chain swaps without cross-process coordination.