The confidential ERC20 Framework transforms ERC20 tokens into a confidential 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 remains, Confidential ERC20 balances privacy with risk management using an encryption-based approach, specifically fully homomorphic encryption (FHE), allowing operations on encrypted data without decryption.
This implementation is based on the collaborative research between Inco and Circle Research. For more information, see the whitepaper.
Note: This repository is not audited and is intended solely as a proof of concept.
Install pnpm
Before being able to run any command, you need to create a .env
file and set a BIP-39 compatible mnemonic as an
environment variable. You can follow the example in .env.example
and start with the following command:
cp .env.example .env
If you don't already have a mnemonic, you can use this website to generate one.
Then, proceed with installing dependencies - please make sure to use Node v20 or more recent or this will fail:
pnpm install
After installation run the pre-launch script to setup the environment:
sh pre-launch.sh
this generates the necessary precompile ABI files.
To deploy the contracts on the rivest network, run the following command:
pnpm deploy:contracts --network rivest
To run the tests on the rivest network, run the following command:
pnpm test:rivest
- Block explorer: https://explorer.rivest.inco.org/;
- Faucet: https://faucet.rivest.inco.org/;
- RPC endpoint: https://validator.rivest.inco.org.
- Gateway endpoint: https://gateway.rivest.inco.org.