A decentralized platform that enables users to store encrypted cUSDT tokens and perform confidential transfers using Zama's Fully Homomorphic Encryption (FHE) technology.
SecretPlatform provides a complete confidential transaction ecosystem with the following capabilities:
- cUSDT Token: Custom implementation of confidential USDT with wrap/unwrap functionality
- Encrypted Balances: All user balances are stored and processed in encrypted form
- Confidential Transfers: Support for encrypted transfer and transferFrom operations
- Encrypted Deposits: Users can deposit cUSDT with encrypted amounts
- Encrypted Withdrawals: Withdraw any encrypted amount from platform balance
- Secret Transfers: Transfer encrypted amounts to encrypted addresses
- Claim System: Recipients can claim transfers using encrypted claim mechanism
- Purpose: Confidential USDT token implementation
- Base: Extends
ConfidentialFungibleTokenERC20Wrapperfrom OpenZeppelin Confidential Contracts - Key Features:
- Wrap/unwrap regular USDT to confidential cUSDT
- Full confidential ERC20 interface with encrypted transfer methods
- 6-decimal precision for USDT compatibility
- ACL (Access Control List) integration for permission management
- Purpose: Main platform contract managing user balances and transfers
- Key Components:
userBalances: Encrypted balance mapping for platform userstransferRecords: Storage for pending encrypted transferstransferExists: Boolean flags for transfer record existence
- Core Functions:
deposit(): Deposit cUSDT to platform with encrypted amountswithdraw()/withdrawAll(): Withdraw encrypted amounts from platformencryptedTransferTo(): Create encrypted transfers to specified addressesencryptClaim(): Claim pending encrypted transfers
- Framework: Hardhat development environment
- Encryption: Zama FHE (Fully Homomorphic Encryption)
- Supports encrypted operations without decryption
- Maintains privacy throughout transaction lifecycle
- Base Contracts: OpenZeppelin Confidential Contracts
- Network: Ethereum Sepolia Testnet with FHE support
- Frontend: React with TypeScript and Zama SDK integration
| Component | Status | Description |
|---|---|---|
| cUSDT Contract | β Complete | Custom confidential token with wrapper functionality |
| SecretPlatform Contract | β Complete | All core platform features implemented |
| Frontend Application | β Complete | Full Web interface in /app directory |
| Test Suite | β Complete | Contract functionality tests |
| Deployment Scripts | β Complete | Automated deployment to testnet |
- No OpenZeppelin Dependency: Custom implementation instead of relying on
ConfidentialFungibleTokenERC20Wrapper - ACL Integration: Proper access control list management for encrypted data
- Error Handling: Comprehensive error tracking for confidential operations
- Gas Optimization: Efficient FHE operations and minimal on-chain storage
Secret_Platform/
βββ contracts/ # Smart contract source files
β βββ cUSDT.sol # Confidential USDT token implementation
β βββ SecretPlatform.sol # Main platform contract
β βββ MockERC20.sol # Mock USDT for testing
β βββ FHECounter.sol # Example FHE contract
βββ app/ # Frontend application
β βββ src/
β β βββ components/ # React components
β β βββ contexts/ # React contexts (Wallet, ZamaSDK)
β β βββ contracts/ # Contract ABIs and configurations
β βββ package.json
βββ deploy/ # Deployment scripts
βββ test/ # Test files
βββ docs/ # Zama documentation
βββ hardhat.config.ts # Hardhat configuration
- Node.js: Version 20 or higher
- npm/yarn/pnpm: Package manager
- Wallet: MetaMask or compatible Web3 wallet
-
Clone and install dependencies
git clone <repository> cd Secret_Platform npm install
-
Set up environment variables
npx hardhat vars set MNEMONIC npx hardhat vars set INFURA_API_KEY npx hardhat vars set ETHERSCAN_API_KEY
-
Compile contracts
npm run compile
-
Run tests
npm run test -
Deploy to Sepolia Testnet
npx hardhat deploy --network sepolia
-
Navigate to app directory
cd app npm install -
Start development server
npm run dev
- End-to-End Encryption: All sensitive data encrypted using Zama FHE
- Access Control: Comprehensive ACL system for encrypted data access
- No Plaintext Exposure: Amounts and balances never exposed on-chain
- Operator Pattern: Secure delegation system for token operations
- Input Validation: Cryptographic proofs for all encrypted inputs
// Deploy cUSDT with underlying USDT
cUSDT cusdt = new cUSDT(IERC20(usdtAddress));
// Deploy SecretPlatform
SecretPlatform platform = new SecretPlatform(address(cusdt));
// User deposits encrypted amount
platform.deposit(encryptedAmount, inputProof);
// User creates encrypted transfer
platform.encryptedTransferTo(recipient, encryptedAmount, inputProof);
// Recipient claims transfer
platform.encryptClaim();- Network ID: 11155111
- FHEVM Gateway ID: 55815
- Relayer URL: https://relayer.testnet.zama.cloud
- FHE Executor:
0x848B0066793BcC60346Da1F49049357399B8D595 - ACL Contract:
0x687820221192C5B662b25367F70076A37bc79b6c - KMS Verifier:
0x1364cBBf2cDF5032C47d8226a6f6FBD2AFCDacAC
- Zama FHE Documentation: docs/zama_llm.md
- Zama Relayer SDK: docs/zama_doc_relayer.md
- FHEVM Protocol: https://docs.zama.ai/fhevm
- OpenZeppelin Confidential: https://docs.openzeppelin.com/contracts-cairo
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub Issues: Report bugs or request features
- Zama Community: Community Forum
- Discord: Zama Discord
Built with β€οΈ using Zama FHE Technology