Shielded Pool

The GoDark shielded pool is the collateral privacy layer for the exchange. It lets users deposit USDC, trade against private collateral commitments, and withdraw through ephemeral recipient addresses without publishing a readable per-user balance or trade history on-chain.

The design gives evaluators two things to inspect:

What It Provides

The shielded pool is designed around four goals:

GoalWhat it means
Collateral privacyDeposits become private note commitments before trading. Public observers do not see a per-user balance ledger.
Private settlementTrades update private notes rather than publishing readable price, size, direction, or counterparty data.
Programmatic custody controlsToken movement is gated by Solana programs, proof checks, and program-derived authorities rather than operator discretion.
Evaluator visibilityPublic events and aggregate balances allow third parties to monitor solvency and activity without seeing user-level trading data.

Mental Model: Public Tokens, Private Notes

There are two ledgers:

  1. Public Solana ledger — SPL token balances. Public movement happens when funds enter the pool or leave it.
  2. Private note ledger — opaque commitments and nullifiers. Trading, transfers, and settlement mutate this private state without moving SPL tokens for every match.

When a user deposits USDC into their Dynamic wallet, GoDark automatically shields the collateral for trading. The visible deposit is converted into a private note commitment inside the shielded pool. From that point forward, the trading layer works with commitments, not a readable per-user balance account.

Technologies Used

The shielded-pool stack uses standard privacy and Solana primitives where possible, with custom circuits only where the exchange-specific settlement logic requires them.

LayerTechnologyHow GoDark uses it
Base chainSolanaFinal settlement, SPL token custody, public transaction ordering, and program execution.
Token custodySPL Token accounts + Program Derived Addresses (PDAs)Deposited collateral is held in aggregate program-controlled vault accounts rather than operator wallets.
Compressed private stateLight ProtocolStores shielded note leaves and enforces commitment/nullifier uniqueness in compressed state.
Note commitmentsPoseidon commitmentsRepresents private collateral notes using hash commitments over note fields such as asset, amount, owner key, and randomness.
NullifiersPoseidon nullifiersMarks a private note as spent without revealing the original commitment owner or note contents.
ZK proving systemGroth16 over the BN254 scalar fieldVerifies shield, transfer, settlement, and ghost-withdrawal transitions with compact on-chain proofs.
Circuit familiesShield, transfer, match, and withdraw circuitsEnforce ownership, conservation of value, valid note spends, and valid output creation for each operation type.
Private matchingMPC committee using Shamir-style secret sharingMatches encrypted order flow without any single node seeing the complete orderbook or user order.
Batch authorizationThreshold signingRequires committee quorum approval before settlement batches are submitted on-chain.
Withdrawal privacyEphemeral recipient addressesGhost withdrawals release funds to fresh recipient addresses designed to reduce public linkability to the user's Dynamic wallet.

The docs intentionally describe these technologies at the integration and invariant level. Circuit source, verifier-key operations, deployment keys, and exploit-specific audit details are not published in public docs.

Fund Flow

PhasePublic token movementPrivate state change
DepositUSDC enters the pooled vault from the user's wallet flow.A one-time deposit authorization is created.
ShieldNo additional token movement.A private note commitment is added to the commitment tree.
Trade or transferNo SPL movement.Existing notes are nullified and new commitments are created.
WithdrawUSDC leaves the pooled vault to an ephemeral recipient address.A private note is consumed by publishing its nullifier.

This separation is the core privacy property: tokens move publicly at the edges, while the middle of the lifecycle is private-ledger arithmetic.

What Observers Can and Cannot See

OperationPublicly observableHidden from observers
DepositA token deposit occurred into the pool flow.The future commitment that deposit becomes after shielding.
ShieldAn opaque commitment was appended.Owner, amount, and note randomness.
Trade / transferNullifiers and new commitments were emitted.Trade size, price, direction, ownership, and counterparty mapping.
Ghost withdrawA fresh recipient address receives tokens from the pool.The user's identity, prior note history, trading path, and source commitment.

The pool does not claim that public token movements disappear. Deposits and withdrawals still settle on Solana. The privacy guarantee is unlinkability: by default, withdrawals use fresh ephemeral recipient addresses so observers can see that funds left the aggregate pool, but should not be able to trace that output back to the user's Dynamic wallet, prior note history, trading path, or counterparties.

Conservation and Solvency

For each supported mint, the pool is built around a simple solvency invariant:

Aggregate SPL in the pooled vault equals the sum of all unspent private notes for that mint.

The system enforces this through layered checks:

Third-party evaluators can reason about the public aggregate vault balance, emitted commitment/nullifier events, and the private-note accounting model without needing access to user-level trading data.

Security Controls

The shielded pool uses defence in depth rather than relying on a single control:

LayerPurpose
Proof verificationState transitions require proof-backed ownership, arithmetic, and conservation checks.
Commitment and nullifier uniquenessThe compressed state layer prevents duplicate commitments and repeated spends.
Program-bound custodyVault release paths are bound to the shielded-pool program and PDA-signed authorities.
Circuit and version bindingProofs are scoped to a specific operation type and protocol version.
Operational kill switchesDeposits, withdrawals, transfers, matching, and sponsored withdrawals can be paused independently.
Monitoring and event hygienePublic events are minimized, and monitoring tracks pool health, activity, and anonymity-set conditions.

These controls are deliberately independent. A failure in one layer should not silently bypass custody, proof validity, uniqueness, and operational response controls at the same time.

Audit and Operational Posture

GoDark has run an internal shielded-pool security review covering proof flow, custody boundaries, event privacy, operational controls, and off-chain logging. The highest-risk remediation work has been prioritized around fund safety, privacy leakage, and production-deployment guardrails.

Public-facing posture:

Disclosure Boundary

This page intentionally describes the model, invariants, and trust boundaries without publishing every internal implementation detail. GoDark does not expose full exploit narratives, deployment keys, verifier-key operational procedures, or low-level circuit internals in public docs.

For adjacent context, see Deposit Funds, Settlement, Privacy & Encryption, and MPC Committee Architecture.