← Work

Solidity

Homomorphic ERC-20 (fhEVM)

CodeMongerrr/CRC20-Token-Standards

An ERC-20 whose balances and transfers stay encrypted on-chain, built on Zama's fhEVM. Hardhat and TypeScript test suite against dockerized fhEVM nodes.

Fully homomorphic encryption lets the contract compute on ciphertext directly, so a balance can be debited and credited without any point at which the plaintext value exists on-chain. The interesting constraint is that ordinary Solidity control flow leaks information: a branch on an encrypted comparison is itself a disclosure, so the arithmetic has to be written branch-free over encrypted types.

SolidityfhEVMHardhatTypeScriptDocker

View source on GitHub →

← All work