whitepaper
whitepaper
Deep Gandhi
Inco
Abstract
This paper presents the Confidential ERC20 framework, which transforms ERC20 tokens into a confi-
dential form that conceals balances and transaction amounts, with optional viewing and transfer rules to
meet regulatory obligations or enhance programmatic risk management. While sender-receiver linkage re-
mains, Confidential ERC20 balances privacy with risk management using an encryption-based approach,
specifically fully homomorphic encryption (FHE), allowing operations on encrypted data without decryp-
tion.
1 Introduction
1.1 Blockchains & Privacy
Blockchain disintermediates traditional finance but falls short on privacy, as its pseudonymous design lacks
the robust confidentiality needed for widespread enterprise and consumer adoption. Advanced analytics
can easily trace transactions, revealing participant identities. With greater blockchain adoption, users often
revert to intermediaries, like centralized exchanges, for privacy, relying on off-chain methods to meet con-
fidentiality requirements. The re-introduction of intermediaries and custodians, however, walks back some
of the disintermediated self-empowerment of the original vision while creating additional potential points of
failure and cost. Privacy is vital for the financial system’s integrity, protecting consumers and businesses
from misuse, identity theft, and fraud. Laws often mandate privacy to secure sensitive information like pay-
roll, vendor payments, and strategic financial data. Financial institutions enforce these protections, as data
breaches can lead to costly investigations, fines, and loss of trust, potentially discouraging economic activity.
Meanwhile, the repercussions on consumers for data breaches of their personal and financial information can
be devastating and almost impossible to fully remediate, particularly in a blockchain context where wal-
let information can expose historical transactions far beyond any immediately exploited transaction, which
could include payments to healthcare providers or involving human rights actors and political dissidents.
1
Anonymity is achieved when the sender/receiver information is private. Confidentiality is achieved when
the amount in the transaction is private.
Anonymity Confidentiality
Public information ? sent $10 to ? Alice sent ? to Bob
Scenarios when Paying your doctor or donating Payroll, supply chain/vendor
needed to a political campaign payments
Examples Tornado Cash Confidential ERC20s
Though anonymity typically provides stronger privacy assumptions than confidentiality, it also can pose
threats from a risk management standpoint, making it easier for bad actors to obfuscate illegal activity.
Conversely, confidentiality is sufficient for many use cases in the financial system: employee payroll, supply
chain vendor payments (where payment amount should not be revealed to vendor competitors), or even P2P
payments (ex. Venmo).
On-chain confidentiality is essential for mass adoption, unlocking new assets, applications, and audiences
for blockchain technology. Given this, Confidential ERC20s, as discussed in this paper, aim to purely achieve
confidentiality to offer a permissionless, programmable, and composable on-chain primitive tailored for EVM
dApps.
The confidential ERC20 framework preserves all core functionalities of the standard ERC20 while adding
features to ensure confidentiality. Designed natively, it enables confidential minting and burning of tokens.
Additionally, it can serve as a wrapper to provide these confidentiality features to existing ERC20 tokens via
2
wrapping and unwrapping mechanisms. Transfer and decryption rules can also be customized for compliance,
allowing flexibility in regulatory contexts.
Key features:
• Encrypted balances: User balances are encrypted, ensuring that only authorized parties, such
as the users themselves or designated regulators, can view them.
• Encrypted transfers: When transferring wrapped assets, transfer amounts between addresses
are encrypted so that the details of the transactions are not exposed to the public.
Enc(pk, m) −→ ct
Decryption: The private key decrypts ciphertext ct back to plaintext m, expressed as:
Dec(sk, ct) −→ m
• Broad Operation Support: TFHE enables a wide range of homomorphic operations, providing
maximum flexibility to accommodate diverse use cases across various industry verticals.
• Exact Computation: Accuracy is critical in scenarios such as decentralized finance (DeFi). TFHE
guarantees exact ciphertext computations, avoiding approximations that could compromise the in-
tegrity of results.
3
• Non-Leveled Structure: Unlike leveled schemes, TFHE does not impose restrictions on the number
of operations, making it ideal for smart contracts where the complexity and number of FHE operations
can vary significantly.
Computational integrity: FHE computation is deterministic, and in the blockchain context, we may
leverage techniques like Zero-Knowledge Proofs (ZKP), fraud proofs, and/or consensus protocols to agree
on computational validity.
• ZKP and computational correctness: Using ZKP to introduce verifiable proofs of the correctness
of FHE computation is a promising avenue of research but is too computationally intensive 5 to be
practical in the near term.
• Fraud proofs in optimistic systems: Fraud proofs in optimistic systems (e.g., roll-ups) support
efficient off-chain computation but require a finality period of at least seven days. This delay poses
challenges in balancing security and user experience, as sensitive encrypted information may be unin-
tentionally revealed or maliciously decrypted during the challenge-response phase, risking data leakage
or financial loss (e.g., unwrapping balances).
• Consensus protocols: Consensus protocols, on the other hand, rely on replicating computation
among distributed participants, which can be resource-intensive but, in exchange, offer verifiability on
the computational integrity and provide instant finality guarantees to the decryption network.
4
– Unique FHE-specific operators such as CMUX/SELECT for conditional assignments, and PNRG
for generating random encrypted integers directly on-chain.
• Integration into the EVM: FHE can be integrated into the EVM at the precompile level or as a co-
processor to existing chains like Ethereum and Arbitrum, enabling confidential tokens (e.g., cUSDC )
to exist across ecosystems.
• Co-processing approach: This approach involves external monitoring of the origin chain and ex-
ecuting the FHE instructions off-chain. Any decryptions happen asynchronously, and the decrypted
value is settled back on-chain via a callback function.
4 Implementation
New functions in ConfidentialERC20Wrapper:
Conversely, the unwrapping process allows users to burn their cERC20 tokens in exchange for an equiv-
alent amount of the original ERC20 tokens. This process also reveals the converted amount back to plain
text.
1 function unwrap ( uint64 amount ) external
User Balance:
A user balance is represented by a mapping between the user address (externally owned account or smart
contract wallet) and euint64. The euint64 data type represents an encrypted 64-bit unsigned integer. The
balanceOf function returns the ciphertext representing the encrypted balance of the requested account, and
the decryption network will verify the access control rules and decrypt it on behalf of the user.
5
1 mapping ( address = > euint64 ) public balances ;
2
3 function balanceOf ( address account ) external returns ( euint64 )
Transfer Amount:
The transfer amount in this framework is represented as an encrypted value, such as euint64. In FHE,
conditional logic (like if/else statements) cannot be directly applied to check balances, as any revert action
would reveal information about the underlying plaintext value. Instead, the encrypted amount is compared
homomorphically against the sender’s balance using TFHE.le to verify if it is less than or equal to the
balance, which returns an encrypted boolean (ebool ). The ebool is then passed into a conditional multiplexer
operation (TFHE.select), which returns the hidden transfer amount if the boolean is true, or an encrypted
zero if false. The sender’s and recipient’s balances are then adjusted based on the result, where the transfer
amount reflects either the actual value or zero, depending on the comparison outcome. To verify the accuracy
of the newly transferred balance, the recipient can request the authority to decrypt their balance and confirm
the correctness of the amount1 .
1 function transfer (
2 address to ,
3 euint64 amount
4 ) external {
5 ebool canTransfer = TFHE . le ( amount , balances [ msg . sender ]) ;
6 euint64 transferValue = TFHE . select ( canTransfer , amount , TFHE . asEuint64 (0) ) ;
7 balances [ to ] = TFHE . add ( balances [ to ] , transferValue ) ;
8 balances [ from ] = TFHE . sub ( balances [ msg . sender ] , transferValue ) ;
9 }
Approval / Allowance:
The allowance function returns the remaining tokens a spender is permitted to spend on behalf of the token
owner, with the value stored and returned in an encrypted format (euint64 ). The approve function authorizes
the spender to transfer a specified amount of tokens on behalf of the token holder, also handling the amount
in encrypted form.
1 function allowance ( address spender ) external view override returns ( euint64 )
2
3 function approve (
4 address spender ,
5 euint64 amount
6 ) external returns ( bool )
7
8 function i n c r e a s e A l l o w a n c e (
9 address spender ,
10 euint64 amount
11 ) external returns ( ebool )
12
13 function d e c r e a s e A l l o w a n c e (
14 address spender ,
15 euint64 amount
16 ) external returns ( ebool )
6
Programmable Decryption Rules
Decryption rules can be programmed at the smart contract level, and the ability to view/decrypt a hidden
balance can be delegated to specific entities such as regulators, government bodies, auditors, or the original
token issuer to fulfill their roles in monitoring compliance and conducting audits.
It’s important to note that viewing access to a ciphertext can be revoked for specific addresses based on
on-chain access rules. However, this may have limited effectiveness, as any decrypted information should be
treated as potentially leaked; for instance, a viewer could retain a copy, making the revocation ineffective in
fully securing the data.
7
6 Extensibility and Composability
Why Choose Confidential ERC-20s
Privacy can be implemented at various levels: as a standalone public or permissioned blockchain, a decentral-
ized application/protocol, or a foundational primitive. Each approach has unique advantages and trade-offs.
We focus on the confidential ERC-20 framework, a highly modular and granular component that serves as a
foundational building block, maximizing composability and extensibility for seamless integration with other
privacy-preserving applications across an ecosystem.
Just as the ERC-20 standard became a foundational layer for decentralized applications like Uniswap
(automated market maker) and Compound (money market), the confidential ERC-20 standard provides a
core primitive for building privacy-preserving applications.
This framework’s ability to support composability over encrypted data makes it exceptionally extensible,
enabling applications to unlock new possibilities while preserving privacy. For instance, users can deposit
an encrypted amount of confidential ERC-20 tokens directly into a private trading or lending platform,
eliminating the need to transfer a plaintext amount and subsequently wrap it within the application—an
approach that would otherwise reveal sensitive information.
8
Defi-related use cases
• Private AMM & Darkpools: Execute private token swaps, where transaction amounts are en-
crypted, preventing frontrunning and protecting trading strategies. The implementation presents in-
teresting challenges that can be further explored in future research.
• Private RWA Tokenization: Tokenize real-world assets with privacy-preserving features, safeguard-
ing sensitive ownership and transaction details.
• Blind auction: Facilitate auctions where the bid remains confidential until the auction concludes,
ensuring a fair and competitive bidding process.
• Private lending: Enable private loans with confidential terms and collateral, preserving borrower
privacy. Potentially support undercollateralized lending by incorporating on-chain credit scores to
assess creditworthiness privately.
7 Conclusion
We introduced the Confidential ERC20 framework as a programmable confidentiality primitive for asset
issuers, application developers, and end users. Issuers and developers can customize features like compliance
rules (decryption and transfer), operational workflows, and other application-specific requirements while
maintaining confidentiality throughout the process. On-chain composability allows for seamless extensibility,
enabling new dApps to emerge and be built on this foundational framework. This primitive combines the
familiar user experiences and financial data privacy of Web2 with the trustlessness and security of blockchain
systems.
8 Acknowledgements
We thank Dan Boneh and Michael Mosier for their contributions to this research.
Works Cited
1. F. Vogelsteller and V. Buterin, “ERC-20: Token Standard,” Ethereum Improvement Proposals, Nov.
19, 2015. [Online]. Available: https://eips.ethereum.org/EIPS/eip-20. Accessed: Sep. 26, 2024.
2. C. Gentry, “A Fully Homomorphic Encryption Scheme,” Ph.D. dissertation, Stanford University, Stan-
ford, CA, 2009. [Online]. Available: https://crypto.stanford.edu/craig/craig-thesis.pdf. Ac-
cessed: Sep. 26, 2024.
3. I. Chillotti, N. Gama, M. Georgieva, and M. Izabachène, “Faster fully homomorphic encryption: Boot-
strapping in less than 0.1 seconds,” Cryptology ePrint Archive, 2016. [Online]. Available: https:
//eprint.iacr.org/2016/870. Accessed: Sep. 26, 2024.
4. I. Chillotti, M. Joye, and P. Paillier, ”Programmable Bootstrapping Enables Efficient Homomorphic
Inference of Deep Neural Networks,” Cryptology ePrint Archive, 2021. [Online]. Available: https:
//eprint.iacr.org/2021/091.pdf. Accessed: Sep. 26, 2024.
5. L. T. Thibault and M. Walter, “Towards verifiable FHE in practice: Proving correct execution of
TFHE’s bootstrapping using plonky2,” Cryptology ePrint Archive, Mar. 15, 2024. [Online]. Available:
https://eprint.iacr.org/2024/451. Accessed: Sep. 26, 2024.
6. J. Lebrun, et al., “ERC 3643 white paper,” Token for Regulated Exchanges White Paper, 2024. [Online].
Available: https://github.com/TokenySolutions/T-REX/blob/main/docs/TREX-WhitePaper.pdf.
Accessed: Sep. 26, 2024.
9
7. Tokeny Sàrl, “onchain-id/solidity: Smart contracts for secure blockchain identities, implementation of
the ERC734 and ERC735 proposal standards,” GitHub, 2024. [Online]. Available: https://github.
com/onchain-id/solidity. Accessed: Sep. 26, 2024.
8. S. Nakamoto, “A peer-to-peer electronic cash system,” Bitcoin.org, 2008. [Online]. Available: https:
//bitcoin.org/bitcoin.pdf. Accessed: Sep. 26, 2024.
9. J. Burleson, et al., “ZKPs and regulatory-compliant privacy,” a16z crypto, 2022. [Online]. Available:
https://api.a16zcrypto.com/wp-content/uploads/2022/11/ZKPs-and-Regulatory-Compliant-Privacy.
pdf. Accessed: Sep. 26, 2024.
10. V. Buterin, “Blockchain privacy and regulatory compliance: Towards a practical equilibrium,” Sep.
9, 2023. [Online]. Available: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4563364.
Accessed: Sep. 26, 2024.
11. J. Beal and B. Fisch, “Derecho: Privacy pools with proof-carrying disclosures,” Cryptology ePrint
Archive, Feb. 23, 2023. [Online]. Available: https://eprint.iacr.org/2023/273. Accessed: Sep.
26, 2024.
12. S. van Schaik, et al., “SGX.Fail: How stuff gets eXposed,” SGX.Fail, Nov. 30, 2022. [Online]. Avail-
able: https://sgx.fail/files/sgx.fail.pdf. Accessed: Oct. 9, 2024.
Appendix
Transfer Rules
Example: transfer rules based on transfer limit, age, and blacklist: Payment dApps can enforce transfer
compliance rules directly within the smart contract. We use a DID registry smart contract, where the user’s
age is encrypted and stored on-chain. This allows token transfers to be programmatically controlled based
on encrypted identity attributes, ensuring compliance is enforced at the contract level rather than off-chain.
Let’s take a scenario in which transfers can be authorized based on a combination of transparent and
encrypted conditions:
• Condition 1 (plaintext): Verify that the addresses involved are not blacklisted.
• Condition 2 (hidden): Ensure the transfer amount is below the limit (20,000 tokens).
• Condition 3 (hidden): Ensure the user is over 18 years old.
Blacklist conditions can be evaluated using plaintext logic, while multiple confidential conditions are
combined through homomorphic logic gates like TFHE.or, TFHE.not, and TFHE.and. These operations return
10
an encrypted boolean (ebool ) that indicates whether all specified conditions are met, preserving privacy
throughout the evaluation process.
Related Work
Blockchain proponents have been strongly associated with privacy from the early days. The Bitcoin whitepa-
per 8 directly mentions privacy, and early private cryptocurrencies like Zcash and Monero demonstrate mar-
ket demand. The blockchain industry has been a test bed for new, promising cryptographic technologies
utilized for privacy, including ZK, TEE, MPC, and FHE. Each technology has different attributes, providing
varied approaches and empowering a range of use cases. Many of these technologies are being tested on
smart contract environments like the EVM to extend privacy to existing users and applications.
ZK and Compliance
Existing ZK compliance tools are often built to provide selective disclosure of funds. Tornado Cash provides
”deposit notes,” which can be later used to generate a report tracing the funds back to the original deposit
address. Zcash, a non-EVM zk-based privacy blockchain, also allows users to generate a viewing key, derived
from the user’s private spend key, that enables viewing the transaction details of a specific shielded address.
The report and viewing key allow users to selectively reveal the source of funds to third parties like regulators
or exchanges, providing a way to prove the legitimacy of funds.
Compliance Landscape
In August 2022, the U.S. Treasury’s OFAC sanctioned Tornado Cash, citing its role in laundering over $7
billion of illicit funds, including cryptocurrency stolen by North Korean hacking groups. The sanctions
prohibit U.S. persons and entities from interacting with Tornado Cash or its associated addresses. The
sanctions are currently being challenged in the U.S. judicial system.
11
Proof of Innocence
New ZK-based privacy protocols have sprung up in reaction to Tornado Cash’s sanctions, iterating on its’
design and seeking to improve compliance. a16z Crypto Research, among others, listed several possible
modifications 9 to Tornado Cash (Burleson et. al). “Proof of Innocence,” protocols like Privacy Pools by
Buterin et. al 10 introduce membership proofs, which prove that a withdrawal is linked to one of several
deposits, and exclusion proofs, which show that a withdrawal does not originate from specific deposits. These
proofs prove “innocence,” without revealing exactly which withdrawal a deposit is linked to. Derecho (Beal,
Fisch) 11 takes this one step further, showing how chained proofs of innocence can be generated when users
transact within a privacy pool. While proofs of innocence are useful, it is unclear whether these proofs would
satisfy regulators.
Regulatory Update
As there are ongoing updates in the regulatory landscape, there may also be an ongoing need to update the
underlying systems to integrate with changes to the regulatory framework. ZK-based privacy systems often
have more rigidity when updating a shielded pool with new logic and mechanisms. Thus, these systems are
innovative but may encounter UX (e.g., user-based proof generation times) and DevEx challenges that are
actively being worked on.
12
Decryption Rules Rigid: Each confidential Flexible: The decryption
transfer includes a proof authority follows decryp-
specifying the recipient’s tion rules specified on-
viewing key. Changing the chain, which can be dy-
viewing key for historical namically updated by the
encrypted data, such as smart contract owner or
delegating access to an au- through governance.
ditor, is not feasible since
the viewing key is set at
the time of proof genera-
tion.
Key Rotation Difficult: Fixed viewing Achievable through re-
keys during proof genera- encryption or homomor-
tion complicate key rota- phic key rotation over
tion. FHE.
Loss of Viewing Key Problematic: Data is en- Flexible: Viewing rules
crypted under a specific can be changed on-chain,
viewing key during proof enabling the delegation
generation and cannot be of decryption to different
changed retroactively. users.
Decryption Revoca- Not feasible within the ZK Key revocation is feasi-
tion framework. ble but limited in effec-
tiveness since any previ-
ously decrypted informa-
tion should be considered
compromised.
Concurrency/Front- State transition proofs Encrypted state can be
running Attack 3 must be generated, which transformed directly.
may lead to state conflicts
if verification occurs over
an outdated state.
Composability over Limited: ZK proofs can- Highly composable: All
Private States not perform state tran- ciphertexts are encrypted
sitions directly on en- under a shared public key,
crypted data. Multi-party enabling seamless compu-
operations without infor- tations across encrypted
mation leakage require ad- data and facilitating pri-
ditional encryption meth- vate dApp interaction.
ods, such as MPC.
Proof Generation Off-chain proof generation Off-chain proof genera-
(Client side) ensures that newly en- tion confirms the integrity
crypted data is correctly of encrypted data and
formed, including data in- the user’s knowledge of
tegrity checks (e.g., suffi- the plaintext, preventing
cient balances) and adher- reuse of identical cipher-
ence to circuit logic (e.g., text as input.
transfer rules).
13
Other Technologies
Emerging projects are using and developing TEE, MPC, and FHE-based systems for privacy. Trusted
Execution Environments, TEEs, are specialized hardware designed and fabricated by manufacturers like
Intel, Nvidia, and others to provide secure and isolated environments for sensitive applications. TEEs are
versatile and performant but have trust assumptions on the manufacturer, supply chain, data center, and
operator as they may be susceptible to various physical attacks 12. Secure Multi-Party Computation, MPC,
are cryptographic methods allowing several parties to compute a function using private inputs jointly. To
date, they have found traction for off-chain infrastructure/tooling use cases like asset custody and embedded
wallets. These systems and technologies are ongoing areas of research and development.
3 An attacker can disrupt a user by front-running transactions. For instance, if Alice generates a proof for her current
encrypted balance and another user, Bob, transfers tokens to her before her transaction is processed, her proof becomes
outdated, causing her transaction to be rejected. Normally, Alice could update her proof and resubmit, but if an attacker
repeatedly floods the network with transfers to Alice’s account, it could render her account effectively unusable due to constant
state changes. It’s worth noting that there are techniques to solve this problem by having a “pending queue” for incoming
balances, or separating a balance into “pending” and “available”, and “rolling up” to the account balances at a later point.
14