Cypherpunk exploration of Fully Homomorphic Encryption that compares dev experience on Inco and Fhenix. See README on GH.
It's night in unnamed cypherpunk city and an undercover spy meets an informant in the corp district. Police checkpoints are on high alert as usual, but they will let the spy go through.
Each policeman chooses a predefined condition for a spy to satisfy to pass, their decisions are private and completly independent. Checkpoint can decide to let everybody in red jackets to pass (but not green), or only let motorcyclists by. Policemen are free to update their requirements at any moment. Only the spy knows all conditions set at checkpoints so he can find his way in unnamed cypherpunk city.
==========================================================
See README on GH. I programmed a smart contract and verified the correctness by running tests with deployments on corresponding testnets.
State:
uint32 secretRequirements
encodes 4 bytes.checkpointAddresses
can modify the corresponding
byte of secret requirements (starting from least significant).spyAddress
can view secretRequirements
offchain.Functions:
setSecretRequirement
allows checkpoint address to set their byte to any value.
It checks that the value fits in a byte and updates the encrypted
state using bit operations.getSecretRequirements
allows spy to view the encrypted state.Tests:
See README on GH. Was hacking solo so no UI. Using FHE stacks Inco and Fhenix to develop, deploy and test private smart contracts. Everything done with hardhat based on the template repos of Inco and Fhenix. Was testing Inco locally in a GitHub codespace before full deployment on the testnet. All test transactions can be seen on thestnet explorers.