CipherPay

Encrypted invoicing with FHE — amounts and recipients hidden on-chain, only parties can decrypt.

About

## Wave 1 submission

Deployed a working encrypted invoicing protocol on Ethereum Sepolia using Fhenix CoFHE.

7 smart contracts deployed and functional on Sepolia 25+ FHE operations: arithmetic (add, sub, mul, div), comparison (eq, gte, min, max), logic (select, and, or), decryption, randomEuint64, access control (allow, allowSender, allowThis, allowGlobal) 6 encrypted types: euint64, euint32, euint8, euint128, eaddress, ebool 5 invoice types: standard (auto-settle), multi-pay (multiple payers), recurring (escrow deposit + periodic claim), vesting (time-locked), batch (CSV import) Real ETH through payable escrow — auto-settle to creator, refund all payers on cancel Encrypted tax calculation, platform aggregates, recipient access control, on-chain payment proofs, bill splitting, per-user analytics 14-page React frontend, all data from chain — no backend, no localStorage CoFHE SDK encryption (~9 sec) with EIP-712 permit-based decryption E2E test suite with 2 wallets on Sepolia

## Wave 2 submission

Anonymous Invoice Claim The biggest privacy addition this wave. Creator enables anon mode on an invoice — payer pays without their address ever touching on-chain storage. • Nullifier = keccak256(deviceSecret ‖ invoiceHash) — device secret lives in localStorage, never sent anywhere • Contract stores only the nullifier hash — no msg.sender, no InvoicePaid event with address • Double-spend protected without knowing who paid • Creator sweeps funds via sweepAnonPool() — ETH arrives to creator wallet with zero link to individual payers • New page: /app/anon-claim

Shielded Balance Pool

Breaks amount correlation on Etherscan. Payer pre-funds a bucket (0.001 / 0.01 / 0.1 ETH), then the actual payment tx has msg.value = 0 — Etherscan shows no ETH transfer. • depositShielded() → payInvoiceShielded() — contract debits internally • Invariant enforced: sum(shieldedBalance[users]) == contract.balance — verified by 11 Hardhat tests

Donation Invoice Type

• New invoice type (TYPE_DONATION = 4). No target amount, no FHE.gte threshold — all payments accepted. Creator settles whenever they want.

Checkout Embed

• Merchants add one <script> tag + CipherPay.open() — FHE encryption runs in a sandboxed iframe, parent page sees only cipherpay:paid event. No wallet SDK on the merchant's page. /checkout/:hash embeddable widget • Auto-routes to shielded path when shieldedBalance >= bucket • Live demo on /app/build

Security & Hardening

• Migrated from deprecated FHE.decrypt() → allowPublic + decryptForTx + publishDecryptResult (Fhenix deprecation April 13) • ACL CI script (audit-acl.cts) — blocks any unauthorized FHE.allowGlobal in CI T• HREAT_MODEL.md — 6 adversary types, explicit NOT-hidden list • Permit UX: first-time explainer modal, distinguishes missing / expired / rejected states • Removed legacy cofhejs@0.3.1 deps

## Wave 3 submission

Batch Cipher Private payroll / batch airdrops with per-recipient encrypted amounts. • New contract: BatchCipher.sol • Creator uploads CSV with up to 100 recipients • Each row stores its own euint64 encrypted amount • FHE.allow(amount, recipient) gives each recipient access only to their own row • Recipient A cannot decrypt Recipient B’s amount • Creator can cancel batch and reclaim all unclaimed ETH • New UI page: /app/batch

CipherDrop

Encrypted eligibility-gated airdrops. • New contract: CipherDrop.sol • Drop threshold is encrypted: nobody sees the required minimum balance • Eligibility check uses FHE.gte(claimerBalance, encryptedMinBalance) • Claim amount is selected with FHE.select(isEligible, amount, zero) • Ineligible users receive zero without reverting, so status is not leaked through tx behavior • Nullifier prevents double claims • Two-phase decrypt flow with allowPublic + publishDecryptResult • New UI page: /app/cipherdrop

Milestone Escrow

Private milestone funding where exact progress stays hidden. • New contract: MilestoneEscrow.sol • Creator sets encrypted total + 25/50/75% thresholds • Contract computes public progress tier with chained FHE.select() • UI shows only tier labels like <25%, 25–50%, 50–75%, >75% • Exact collected amount and total target remain encrypted • Beneficiary and creator can decrypt scoped values via permit • New UI page: /app/milestone-escrow

FHE Recurring Scheduler

Encrypted recurring payment schedule / FHE clock. • New contract: RecurringScheduler.sol • Frequency stored as encrypted euint8 • Next due block stored as encrypted euint64 • Due check uses FHE.gte(currentBlock, encryptedNextDue) • Payment trigger is Chainlink Automation compatible • Schedule cadence is not visible on Etherscan • New UI page: /app/recurring-scheduler

## Wave 4 submission

Fee Module Self-funding platform fee where even the rate is encrypted — only the owner ever sees it. • New contract: FeeModule.sol • Fee rate stored as euint64 feeBps — nobody on Etherscan can read what the platform charges • Per-invoice fee computed via FHE.mul(amount, feeBps) / 10000 — arithmetic on ciphertext, never decrypted • Net amount derived with FHE.sub(amount, fee) and routed back to the creator • Fees accumulate into platformRevenue: euint64 via FHE.add — running total stays encrypted • Aggregate revenue exposed only through FHE.allowGlobal(platformRevenue) — individual fees never leak • Two-phase sweep: requestRevenueSweep → off-chain decryptForTx → publishSweepResult → ETH transferred to owner • Owner can rotate feeBps at any time — old fees already collected stay locked in their original encryption • Rate-change events emit only the timestamp; the new rate ciphertext handle remains private

Merchant SDK — @cipherpay/sdk

Stripe-like developer experience for accepting FHE-private payments. • New package: sdk/ directory, publishable as @cipherpay/sdk • Node client: CipherPay.charge({ amount, currency: 'ETH', invoiceId }) — one call to create a private invoice • React hook: useCheckout(invoiceHash) → { pay, status, txHash, error } — zero FHE boilerplate for the integrator • React hook: useShieldedBalance() → deposit, withdraw, balance — manages the msg.value=0 payment bucket • Webhook server: CipherPayWebhooks relays InvoicePaid / InvoiceSettled events to any HTTPS endpoint • Embeddable widget: /checkout/:hash works standalone and inside a sandboxed iframe via postMessage • Auto-routes to the shielded path when shieldedBalance >= amount — payer never reveals msg.value • TypeScript types shipped: Invoice, ChargeRequest, WebhookEvent, ShieldedDeposit • Drop-in: <script src="cipherpay.js" data-invoice="0x..."> + CipherPay.open() — one line for web2 merchants

Privacy Analytics

Aggregate platform metrics without exposing any individual transaction. • New UI page: /app/privacy-analytics • Reads platformVolume and platformInvoiceCount via FHE.allowGlobal handles • Owner-side decrypt of aggregates only — never per-user breakdowns • Merkle invoice-existence proofs: prove an invoice was created at block N without revealing amount or parties • Differential-privacy explainer panel: shows how encrypted noise is layered onto published aggregates • Per-field visibility matrix: every encrypted column mapped to who can decrypt it under which permit • No tracking, no analytics SDK, no off-chain database — every number on the page comes from FHE handles • Educational layer: judges and integrators can see at a glance what FHE hides vs what stays public

## Wave 5 submission

The five-wave arc lands here. CipherPay is now a confidential payroll rail on Fhenix CoFHE — one product that lets an employer or DAO pay many people on-chain while every salary stays encrypted as euint64 ciphertext. Wave 5 turned a feature-rich invoicing showcase into a sharp, judge-checkable payroll rail.

What shipped this Wave (every item verifiable on-chain):

  • ConfidentialPayrollToken.sol — a new FHERC-20 confidential stablecoin. euint64 balances; transfers clamp to balance via FHE.select so they never revert in a way that leaks whether the sender had funds. Salaries are paid in a price-stable, fully encrypted token instead of volatile ETH.
  • PayrollAnchor.sol — a new on-chain Merkle anchor making invoice-existence proofs publicly verifiable without revealing amounts or parties. Backed by a real client-side keccak256 Merkle tree (src/lib/merkle.ts) — replaces the prior placeholder commitment.
  • cipherpay-sdk@0.1.0 published to npm — one install, Stripe-grade DX: cp.runPayroll({ recipients }) FHE-encrypts every salary and creates a BatchCipher payroll batch in one transaction. Real HMAC-SHA256 webhook verification, working useCheckout React hook. https://www.npmjs.com/package/cipherpay-sdk
  • Privara / ReineiraOS integration — @reineira-os/sdk wired into a new in-app page on Arbitrum Sepolia: create, fund and redeem confidential-USDC escrows as a second payroll-settlement rail. Multi-chain wagmi (Sepolia + Arbitrum Sepolia) with in-app network switching.
  • Full redeploy — all 15 contracts redeployed on Ethereum Sepolia from a fresh deployer via one canonical scripts/deploy-all.cts (dependency-aware order). Addresses in deployments/eth-sepolia.json and wired into the app, SDK, README and tests.
  • Three new app surfaces — PayrollToken (encrypted balance · send · issuer mint), PrivaraSettlement (Arbitrum escrows), and a Proof page at /app/proof linking every contract to Etherscan as judge-facing evidence.
  • Mocks removed — fake Merkle commitment, stub verifyWebhook, throwing useCheckout hook, and the unsubstantiated differential-privacy claim — all replaced with real implementations or honest copy.
  • Verification — 67/67 on-chain E2E tests passing against the new deployment (e2e-test.cts 35/35 + test-all-flows.cts 32/32, real FHE on Sepolia) plus 13 contract unit tests (PayrollAnchor + ConfidentialPayrollToken guards).
  • SECURITY.md — honest self-audit (reentrancy, FHE ACL bypass, nullifier replay, ciphertext-handle collision) with disclosed open items rather than hidden ones.

After five waves CipherPay is: 15 contracts on Sepolia · 57+ FHE operations · multi-chain (Sepolia + Arbitrum Sepolia) · SDK on npm · 67/67 E2E verified · zero mocks — every claim provable on-chain.

Live app: https://cipherpayy.vercel.app · Proof page: https://cipherpayy.vercel.app/app/proof · GitHub: https://github.com/kravadk/cipherpay

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

No public repo linked, so we can't tell.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.