Shielded Pool
Fixed-denomination shielded deposit and withdrawal pool on EVM chains, with a Poseidon Merkle tree of commitments and a nullifier set preventing double spends
Abstract
This LP defines a shielded pool contract for EVM chains that enables private deposits and withdrawals. Users deposit LUX or ERC-20 tokens into the pool, receiving a commitment note. Withdrawal requires a zero-knowledge proof that the user knows the note preimage and a valid nullifier. The pool maintains a Poseidon Merkle tree of commitments (LP-4350) and a nullifier set for double-spend prevention.
Motivation
On a public chain, a payment discloses the payer's entire balance history to the payee, forever. The shielded pool separates the two halves of a transfer: a deposit that says nothing about who will spend it, and a withdrawal that proves the right to spend without saying which deposit it came from. Fixed denominations and a relayer path close the two side channels — amount and gas payment — that would otherwise re-link them.
Specification
Deposit
function deposit(bytes32 commitment) external payable;
The user computes commitment = Poseidon(value || nullifier_secret || blinding) off-chain and submits it. The contract inserts the commitment into the Merkle tree and accepts the deposit.
Withdrawal
function withdraw(
bytes calldata proof,
bytes32 root,
bytes32 nullifierHash,
address recipient,
uint256 amount,
bytes32 relayerFee
) external;
The proof demonstrates: (1) the user knows a commitment in the tree at root, (2) the nullifier hash matches, (3) the amount matches the committed value. The contract verifies the proof, checks the nullifier has not been used, marks it as spent, and transfers funds.
Fixed Denominations
The pool operates with fixed denomination sets to prevent amount-based correlation:
| Pool | Denomination |
|---|---|
| Pool A | 1 LUX |
| Pool B | 10 LUX |
| Pool C | 100 LUX |
| Pool D | 1,000 LUX |
Compliance Association Sets
Unlike fully anonymous systems, the pool supports optional compliance association sets. A depositor may include a compliance proof binding their deposit to a DID (LP-10093) without revealing which specific deposit is theirs to external observers.
Rationale
The anonymity set is exactly the set of unspent commitments in one denomination pool, which is why denominations are fixed rather than arbitrary: an arbitrary amount is a unique fingerprint, and a pool of unique fingerprints hides nothing. Keeping a bounded history of recent roots lets a proof built a few blocks ago still verify, without letting an arbitrarily stale root be replayed.
Security Considerations
- Nullifier hash is derived from a secret known only to the depositor. Brute-forcing is infeasible.
- Fixed denominations prevent amount-based deanonymization.
- The Merkle root must be a recent valid root (checked against stored history of 100 roots).
- Relayer fees are deducted from the withdrawal amount to enable gas-less private withdrawals — a withdrawal paid for by a fresh EOA would otherwise link the recipient to whoever funded that EOA.
Reference
| Resource | Location |
|---|---|
| Pool contract | github.com/luxfi/standard/contracts/privacy/ShieldedPool.sol |
| Proof verifier | github.com/luxfi/standard/contracts/privacy/Verifier.sol |
| CLI deposit tool | github.com/luxfi/cli/cmd/privacy/ |
Related LPs
- LP-8000 — Z-Chain, the network's ZK and privacy chain
- LP-4350 — the ZK-friendly hash used for commitments and the tree
- LP-9405 — encrypted balances, the complementary privacy model
- LP-9402 — private swaps
Copyright
Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.
Licensed under the MIT License.