About
## Wave 1 submission
Foundation & Core Contract Development Focus: Establish development environment, design encrypted payroll logic, and deploy base contracts locally.
🧱 What We Accomplished
- Environment Setup - Initialized a Hardhat project with the Fhenix Hardhat plugin to simulate FHE operations locally. - Installed @cofhe/sdk, @reineira-os/sdk, and dependencies for encryption/decryption. - Configured network profiles for local FHE simulation and Fhenix Sepolia testnet. - Contract Architecture - Designed PayrollFactory.sol – a factory that deploys individual EncryptedPayroll instances per organization. - Implemented EncryptedPayroll.sol with: - euint64 for encrypted salary amounts. - Mapping of employee addresses to encrypted salary data. - Encrypted payment schedules stored as arrays of euint64 timestamps. - Added access control using Fhenix’s FHE library to ensure only authorized roles (employer, employee, auditors) can perform certain operations. - Encrypted Data Storage - Employer registers employees and encrypts salary amounts using the employee’s public key. - Used FHE.asEuint64 to store encrypted values on-chain. - Implemented a simple encrypted balance system: total payroll budget encrypted with the employer’s key. - Local Testing - Wrote unit tests for: - Encrypted salary storage and retrieval. - Access control (only employer can add/update salaries). - Basic arithmetic on encrypted values (e.g., checking that total payroll does not exceed budget). - All tests passed in the local FHE simulation environment.
🔧 Challenges Faced
- Gas Costs of FHE Operations - Each FHE.asEuint64 call consumes significant gas. We had to batch operations and store encrypted data in efficient structures to avoid hitting block limits. - Key Management - Deciding how to handle public keys on-chain without exposing them to everyone. We opted to store a mapping of employee addresses to their public key, but this still makes keys visible. We’ll revisit this in Wave 2. - Understanding FHE Type Constraints - FHE types (euint etc.) have limited operations; comparisons and arithmetic are possible but must be done carefully. We had to refactor some logic to avoid unsupported operations.
📚 Lessons Learned
- Simulation is essential – The Hardhat plugin allowed us to iterate quickly without deploying to a testnet for every change. - Privacy-by-design forces new patterns – Traditional access control (e.g., OpenZeppelin’s Ownable) works, but we must also consider encryption keys as a separate layer of permission. - Start with minimal features – Getting the core encryption and storage working first validated the approach before adding complexity.
🏁 Milestones Achieved
- Hardhat project with Fhenix plugin and Privara SDK integrated. - Factory and payroll contracts with encrypted storage. - Unit tests covering all basic encrypted operations. - Local deployment and end-to-end test of storing an encrypted salary.
From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.





