LPsLux Proposals
Privacy
LP-9404

Shielded Pool

Final

Fixed-denomination shielded deposit and withdrawal pool on EVM chains, with a Poseidon Merkle tree of commitments and a nullifier set preventing double spends

Category
LRC
Created
2025-12-01

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:

PoolDenomination
Pool A1 LUX
Pool B10 LUX
Pool C100 LUX
Pool D1,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

  1. Nullifier hash is derived from a secret known only to the depositor. Brute-forcing is infeasible.
  2. Fixed denominations prevent amount-based deanonymization.
  3. The Merkle root must be a recent valid root (checked against stored history of 100 roots).
  4. 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

ResourceLocation
Pool contractgithub.com/luxfi/standard/contracts/privacy/ShieldedPool.sol
Proof verifiergithub.com/luxfi/standard/contracts/privacy/Verifier.sol
CLI deposit toolgithub.com/luxfi/cli/cmd/privacy/
  • 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 (C) 2024-2026, Lux Industries Inc. All rights reserved.

Licensed under the MIT License.