LPsLux Proposals
Privacy
LP-9405

Confidential ERC-20

Final

ERC-20-compatible token whose balances and transfer amounts are FHE ciphertexts, with sufficiency checked homomorphically and decryption available only to the holder

Category
LRC
Created
2025-12-01

Abstract

This LP defines an ERC-20-compatible token where balances and transfer amounts are encrypted under the FHE runtime (LP-4650). The contract stores euint64 encrypted balances. Transfers operate on ciphertexts — the contract verifies the sender has sufficient balance via homomorphic comparison without ever seeing the plaintext values. Only the token holder can decrypt their own balance.

Motivation

Every payroll, treasury movement, and supplier payment made in a public ERC-20 is legible to competitors in real time. Encrypting the balance rather than hiding the transfer keeps the token an ordinary ERC-20 — same interface, same integrations — while removing the amounts from public view. The holder keeps a decryption path to their own balance, and can grant one to a regulator, without making it public.

Specification

Storage

mapping(address => euint64) private encBalances;
euint64 private encTotalSupply;

All balances are encrypted under the global FHE public key. The contract never stores or processes plaintext amounts.

Transfer

function transfer(address to, einput encryptedAmount, bytes calldata inputProof) external;
  1. Caller submits an encrypted amount with a ZK proof that the ciphertext encrypts a valid uint64.
  2. Contract computes: ebool sufficient = FHE.le(encryptedAmount, encBalances[msg.sender]).
  3. Contract computes: encBalances[msg.sender] = FHE.sub(encBalances[msg.sender], encryptedAmount).
  4. Contract computes: encBalances[to] = FHE.add(encBalances[to], encryptedAmount).
  5. If sufficient is false, the subtraction underflows and the transaction reverts.

Balance Query

Only the balance owner can decrypt:

function balanceOf(address owner) external returns (euint64);
function decryptBalance() external;  // triggers threshold decryption callback to msg.sender

Third parties see only ciphertexts. Threshold decryption delivers the plaintext only to the requesting address via an encrypted callback channel.

Compliance Integration

For regulated tokens, the compliance registry can be granted a decryption permission by the token holder, enabling KYC-gated balance visibility without making balances public. Pool-level enforcement of transfer restrictions is LP-9030.

Rationale

Sufficiency is enforced by underflow rather than by branching on sufficient, because a branch taken on encrypted data would have to reveal which way it went. Letting the homomorphic subtraction fail keeps the failure signal at transaction granularity — the transaction reverted — which discloses only what the sender already knew.

Security Considerations

  1. Transfer amounts are never visible on-chain. Only ciphertexts appear in transaction data.
  2. The input proof prevents submitting malformed ciphertexts (e.g., encrypting a negative number).
  3. Metadata leakage: sender, receiver, and timing are still visible. Where the parties must also be hidden, combine with the shielded pool (LP-9404) or private execution on Z-Chain (LP-8000).
  4. Gas costs are higher than plaintext ERC-20 (approximately 10x for transfers due to FHE operations).

Reference

ResourceLocation
ConfidentialERC20 contractgithub.com/luxfi/standard/contracts/privacy/ConfidentialERC20.sol
FHE precompilegithub.com/luxfi/evm/precompile/contracts/fhe.go
  • LP-4650 — FHE runtime, parameter sets, and threshold decryption
  • LP-8200 — encrypted EVM execution
  • LP-9401 — lending over confidential balances
  • LP-9404 — the commitment-based privacy model

Copyright (C) 2025-2026, Lux Industries Inc. All rights reserved.

Licensed under the MIT License.