Privacy with CoCo

Shielded Transactions on the Blockchain

CoCo now has a built-in shielded coin pallet that gives you real privacy. Stealth addresses use ECDH key agreement to hide who receives funds — only the intended recipient can detect and claim incoming transfers. Optional audit trail for regulatory compliance.

12 Unit Tests 18 Pallets Privacy Shield Stealth Addresses Nullifier Protection 7 Extrinsics E2E Tested ✅

⚖️ Regulatory Compliance Update

The CoCo shielded-coin pallet originally included a Merkle-tree based mixer pool for deposit/withdraw unlinkability. In May 2026, the mixer component was removed to comply with evolving US and international regulatory guidance on anonymity-enhancing technologies in financial infrastructure.

The stealth address system — which provides recipient privacy via ECDH key agreement without a mixing pool — is fully retained. This means:

This change enables CoCo to serve regulated industries — including unions, businesses, and financial institutions — while maintaining meaningful privacy for legitimate use cases.

How It Works — Stealth Addresses

  1. Register a Stealth Identity

    Any user can register a stealth meta-address consisting of a scan key and a spend key (two public keys generated off-chain). The scan key lets the recipient detect incoming transfers; the spend key authorizes claims. No on-chain link between your public identity and your stealth address.

  2. Send a Stealth Transfer

    The sender looks up the recipient's stealth meta-address and constructs an ephemeral output using ECDH key agreement. A view tag allows the recipient to efficiently scan for their outputs without revealing anything to third parties. The funds are held by the pallet until claimed.

  3. Claim Privately

    The recipient scans on-chain outputs using their scan key. When they find a match, they claim the output by proving the view tag matches. The funds are released to any address they choose. No one else can determine who sent the transfer or who received it.

Key Features

Political & Sensitive Actions

The shielded anonymizer is necessary to anonymize potential political votes or other sensitive actions. The existing privacy layer can be utilized for all other everyday purposes — payments, payroll, supplier confidentiality, and more.

Unlinkable Transactions

Deposit into a shared pool, withdraw to a fresh address. No on-chain link connects the two. Each withdrawal uses a unique nullifier that prevents double-spending without revealing which deposit it came from.

Stealth Addresses

ECDH key agreement generates one-time destination addresses per payment. Only the recipient can recognize incoming funds. No public mapping of addresses to recipients.

Nullifier Protection

Each secret produces a unique nullifier on withdrawal. The nullifier is checked against used nullifiers — double-spending is mathematically impossible without revealing the secret.

Fixed Denominations

Accepted denominations (1, 10, 100, 1,000 COCO) prevent amount-based linkability. All deposits of the same denomination are indistinguishable in the pool.

Withdrawal Delay

A configurable delay (default 10 blocks) prevents front-running attacks. Deposits and withdrawals cannot happen in the same block, ensuring the Merkle root is stable.

Audit Trail (Optional)

When converting shielded COCO back to transparent, users can optionally provide an audit decryption that proves the source of funds to a regulator. KYC’d businesses can comply without breaking privacy for everyone else.

Admin Force Nullify

Root-only emergency function to force-nullify a leaf in the Merkle tree. Used for regulatory compliance or to freeze compromised notes. Transparent governance layer on top of privacy.

Recent Roots Buffer

The last 100 Merkle roots are stored in a ring buffer, protecting against short-chain re-org attacks. Proofs referencing a recent root remain valid even after a reorganization.

Use Cases

Consumer Payments

Pay for goods and services without revealing your full transaction history. Shielded COCO breaks the chain of custody that analysts use to track spending.

Supplier Confidentiality

B2B payments that hide pricing and volume from competitors. Suppliers receive payments via stealth addresses — only the intended recipient knows.

Employee Payroll

Pay salaries in shielded COCO. Employees withdraw to their personal addresses. Salary amounts and frequency stay private between employer and employee.

Regulatory Compliance

Optional audit trail for back-conversion lets regulated businesses prove fund sources to auditors without making all transactions public.

Whistleblower & Humanitarian Aid

Receive funds without exposing identity. Stealth addresses use on-chain ephemeral keys that only the intended recipient can detect and claim.

Business Acquisitions

Large confidential transfers that would normally be visible on a transparent ledger. Shielded COCO keeps business-sensitive transactions off the public graph.

Technical Specifications

Pallet18th pallet in the CoCo Substrate runtime (pallet-shielded-coin)
Extrinsics7 total: deposit, withdraw, register_stealth_address, transfer_stealth, claim_stealth_output, set_denominations, force_nullify
Hash FunctionBlake2-256 for commitments, nullifiers, and Merkle tree nodes
Merkle TreeIncremental fronti er tree, depth 20 (≈1M deposits), frontier-based O(log n) storage
DenominationsFixed: 1, 10, 100, 1,000 COCO (configurable, max 10)
Deposit Fee0.1 COCO per deposit (configurable)
Withdrawal Delay10 blocks default (configurable)
Test Coverage33 unit tests covering deposit, withdraw, nullifier, stealth, Merkle tree, admin
Stealth SchemeECDH key agreement on sr25519, view tag fast filtering (1 byte)
Balance TrackingInternal PalletBalance storage (not exposed via pallet_assets)
RuntimeSubstrate FRAME pallet, compiled to WASM

Try It

# Deposit 10 COCO into the shielded pool
curl -X POST http://localhost:9933 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"shieldedCoin_deposit","params":[10000000000000,"0x...commitment..."]}'

# Register a stealth address
curl -X POST http://localhost:9933 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"shieldedCoin_registerStealthAddress","params":["0x...scan_key...","0x...spend_key..."]}'

# Claim a stealth output
curl -X POST http://localhost:9933 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"shieldedCoin_claimStealthOutput","params":["0x...output_id...","0x...scan_key..."]}'

Tip: Use the CoCo CLI or API client to generate commitments off-chain and submit shielded transactions. Full technical specification available in the docs.