BlocPaie - Gasless Confidential On-Chain Payroll Powered by Zama fhEVM

BlocPaie - Gasless Confidential On-Chain Payroll Powered by Zama fhEVM


Hey Zama community :waving_hand:

I’ve been building BlocPaie — a confidential payroll platform on Ethereum where companies pay contractors while keeping every salary amount, payee identity, and payment status fully encrypted on-chain using Zama’s fhEVM.


The Problem

Every on-chain payment today is fully visible — to validators, indexers, and anyone with a block explorer. For payroll specifically, this is a hard blocker. No company wants employee salaries publicly readable on-chain.


What BlocPaie Does

Companies create payroll vaults, deposit USDC, and register invoices on-chain. The salary amount and payee address are encrypted client-side using @zama-fhe/relayer-sdk before the transaction is ever submitted. The contract stores FHE ciphertexts — nobody, including the contract itself, can read the values in plaintext.

When a contractor executes their cheque, cUSDC is transferred to their wallet (still encrypted). They can then decrypt their balance via Zama’s userDecrypt to verify the amount — visible only to their wallet.

The blockchain acts as an immutable verifiability layer: every payment is timestamped and tamper-proof on-chain, auditable without ever exposing a salary figure.


How Zama fhEVM is Used

  • createEncryptedInput — encrypt salary amount and payee address client-side, bound to the contract and caller address

  • euint64 / eaddress — store encrypted cheque fields on-chain (amount, payee, status)

  • FHE.select — conditionally transfer cUSDC only if the caller is the correct (encrypted) payee, without revealing who that is

  • euint8 error codes — soft error model so the contract can signal failures without reverting on FHE conditions

  • userDecrypt — contractor decrypts their cUSDC balance via Zama KMS, visible only to their wallet

  • publicDecrypt — used in the two-step cUSDC → USDC unwrap flow via the Zama relayer

  • ERC-7984 (cUSDC) — confidential token wrapping USDC, all balances and transfers FHE-encrypted


Wallet & UX

Built on Porto (EIP-7702 smart accounts with WebAuthn passkeys). No MetaMask, no seed phrases — every transaction is signed with Face ID or a hardware key. All gas is sponsored via Ithaca Relay so neither companies nor contractors pay fees.


A Limitation I Hit — Worth Discussing

Zama’s KMS validates userDecrypt requests via secp256k1 ECDSA signatures. Porto wallets use WebAuthn P-256 passkeys, which the KMS can’t verify directly. The workaround is generating a short-lived secp256k1 keypair (decryptViewer) in the browser, granting it on-chain ACL access, using it to sign the KMS request, then discarding it. It works, but it costs an extra on-chain transaction and briefly materialises a secp256k1 key in browser memory.

EIP-1271 support in the KMS would eliminate this entirely — the KMS could call isValidSignature on the Porto smart account and any other EIP-1271 wallet, authorising decryption via the wallet’s own signature scheme with no ephemeral key needed. Would love to hear if this is on the roadmap.


Roadmap

Infrastructure

  • Event indexer — background service listening to on-chain events to keep transaction history reliable regardless of client state

  • Merchant route sponsorship filter — allowlist BlocPaie contract addresses to prevent gas-drain abuse

Privacy & Cryptography

  • ZK audit proofs — cryptographically verify that encrypted on-chain values match invoice hash commitments, without decrypting anything

  • ACL-based auditor access — vault owners grant specific auditors read access to individual cheque handles via TFHE.allow

Product

  • Bulk payroll — register and execute multiple cheques in a single wallet_sendCalls bundle, one passkey tap pays the whole team

  • Recurring invoices — auto-register cheques on a schedule using Porto session keys, no manual approval each cycle

  • Fiat offramp — when a contractor executes a cheque, USDC is automatically converted and pushed to their bank account via Stripe Treasury or Bridge

  • Multi-token support — EURC and DAI vaults alongside USDC

  • Multi-chain — deploy to an L2 once Zama coprocessor support is available


Links

  • :globe_with_meridians: Live demo: frontend-nine-omega-56.vercel.app/

Happy to answer questions on the FHE integration or the EIP-1271 limitation. Excited to be building on Zama!