GhostPay.
GhostPay is an enterprise-grade confidential payroll system built natively on Fhenix using Fully Homomorphic Encryption (FHE). Designed to close the institutional adoption gap caused by public blockchain transparency, GhostPay computes salaries, budget validations, and employee balances directly on-chain using encrypted numerical types (euint32), ensuring company compensation remains confidential while preserving public verifiability.
- Role
- Smart Contract & Privacy Engineer
- Domain
- Fully Homomorphic Encryption (FHE) · Confidential EVM · Fhenix Network · CoFHE Contracts · Private Payroll
System at a glance
What the system does
On-chain encrypted arithmetic (euint32)
Client-side encryption via @cofhe/react
Gasless cryptographic viewing permits
Factory-deployed company payroll vaults
Architecture flow
From intent to verified state.
- 01
A company administrator deploys an isolated payroll vault using the GhostPayFactory smart contract.
- 02
Employee salaries are encrypted in the browser using the Fhenix CoFHE stack before submitting the transaction.
- 03
The contract receives encrypted payloads (InEuint32) and stores them as on-chain encrypted states (euint32).
- 04
When payroll executes, the contract performs homomorphic addition (FHE.add) to verify budget solvency on-chain.
- 05
Employees sign gasless cryptographic permits, allowing only their authorized wallet to decrypt balances via FHE.allowSender.
01 / Homomorphic computation
Direct on-chain execution over encrypted values
Computing over encrypted balances without off-chain provers or decryption leaks.
Native confidential EVM types
Leverages Fhenix's euint32 and euint64 types to store balances and salary rates without exposing plaintext values to nodes or mempools.
Homomorphic arithmetic
Performs arithmetic operations (such as summing total payroll or adjusting balances) directly on encrypted ciphertext using FHE.add().
Eliminating off-chain ZK overhead
Unlike zero-knowledge systems that require heavy off-chain provers, FHE allows developers to write standard Solidity business logic executed by the FHE coprocessor.
02 / Edge encryption
Client-side data protection before transaction dispatch
Encrypting sensitive salary figures at the browser boundary.
Browser-based encryption
Uses @cofhe/react hooks (useEncrypt) to encrypt salary figures in the client browser before submitting blockchain transactions.
Encrypted input encapsulation
Transforms plaintext numbers into verified InEuint32 ciphertext payloads bound to the recipient contract address.
Preventing transaction snooping
Ensures RPC relays and mempool sniffers cannot inspect salary terms or deposit amounts during transaction propagation.
03 / Selective access
Cryptographic permits and granular decryption rights
Permit-based access control protecting employee privacy.
Gasless CoFHE permits
Employees sign an EIP-712-style cryptographic permit to authenticate their identity to the Fhenix threshold decryption network.
Contract permissioning
The smart contract uses FHE.allowSender() to grant read access strictly to the authenticated employee's wallet address.
Private client decryption
Decrypts balance data locally inside the employee's browser session via useDecrypt, ensuring zero server-side exposure.
04 / Contract architecture
Factory deployments and corporate vault isolation
Multi-tenant contract isolation for Web3 companies and DAOs.
Factory pattern deployment
Companies deploy independent GhostPay vault instances via GhostPayFactory, maintaining full organizational segregation.
Vault solvency verification
The contract homomorphically evaluates whether the deposited stablecoin balance covers aggregate payroll before approving distribution.
Safe withdrawal mechanisms
Enables employees to claim their available encrypted balance and withdraw unshielded stablecoins into their designated wallet.