About
## Wave 1 submission
In Wave 1, I focused on validating the core idea of private lending and building a working end-to-end encrypted flow.
links -
visit - http://walnut-finance.vercel.app/ Explainer video - https://youtu.be/VF7ACZPrmc0 Github repo - http://github.com/Iam-jayant/walnut
We built a functional prototype of Walnut with the following: - A clean landing page that communicates the concept of privacy-first lending - A working app interface with dashboard, deposit, borrow, and demo flows - Wallet connection and network handling (Sepolia)
End-to-end encrypted pipeline:
- user inputs are encrypted in the browser - encrypted values are sent to the smart contract - contract stores only encrypted state - data is fetched and decrypted locally using permit-based access
We implemented:
>> CoFHE-based smart contract using encrypted types >> Frontend integration using @cofhe/react for encryption and decryption >> Permit-based access control for decrypting user-specific data >> Clear UI states for network mismatch, missing permit, and decryption status
We also focused heavily on demo reliability: - Eliminated mock data and ensured all values come from the contract - Added system status indicators (wallet, network, permit) - Handled failure states to avoid silent errors during demo
This wave validates that private state, computation, and controlled decryption work correctly in a real application flow.
## Wave 2 submission
In this wave, Walnut moved from prototype to a complete private lending flow with stronger on-chain logic and better reliability.
Links
Live app: http://walnut-finance.vercel.app Explainer video: https://youtu.be/DEMIBMNoKy4 Contract: https://sepolia.etherscan.io/address/0xD6792922Bca01d34E543cf241D4B3474207d2594
What I have implemented :
>> Completed private lending lifecycle: deposit, borrow, repay, and withdraw are now wired end-to-end.
>> On-chain constraints added:
Borrow limits and LTV checks are enforced in contract logic, not only in UI.
>> Encrypted risk visibility:
The health factor is computed privately and shown through a permit-based decryption flow.
>> Liquidation flow expanded:
Request-based liquidation checks and follow-up settlement path were added for async decrypt workflows.
>> Sealed-bid liquidation auction added: open auction, submit encrypted bids, select the winner, finalize the settlement, and emit the winner's outcome.
>> ENS multi-wallet support:
Linked wallets can be registered, and collateral can be aggregated in an encrypted flow.
>> Frontend reliability improvements:
reduced repeated signing prompts when permit/data already exists, improved wallet reconnect behavior on reload, and clearer status/error handling.
>> Testing and quality:
contract test coverage expanded for lending, auction, and ENS-linked flows.
Wave 1 validated the encrypted lending feasibility. This wave makes Walnut significantly closer to production protocol behavior: encrypted state, enforceable on-chain rules, and real multi-step private lending operations.
## Wave 3 submission
Live App: https://walnut-finance.vercel.app Demo: https://youtu.be/FoOr5KGSRqI Smart Contract (WalnutV1): https://sepolia.arbiscan.io/address/0x04c998DD105E444570ba1eCACB3F5524D5695aA0#code -------------------------------------------------- ๐ WAVE 3 โ WHAT SHIPPED -------------------------------------------------- ๐ Encrypted Credit Scoring Repayment history stays encrypted on-chain as euint128. CoFHE decrypts the count via FHE.requestDecrypt callback and maps it to a 5-tier credit system (70%โ90% LTV) without ever exposing raw history. Your credit score is built from data nobody can read.
โ๏ธ Sealed-Bid Liquidation Auctions
Liquidators submit encrypted penalty bids. WalnutV1 uses FHE.select to find the minimum bid in ciphertext. The onWinnerSelected callback (onlyCoFHE) settles the auction โ winner address revealed, bid amounts never. MEV bots see nothing. Borrowers get the best available deal.
๐ค P2P Lending with Encrypted Terms
Lenders post offers with encrypted APR, size, and tenor. FHE.allow gates read access โ terms stay hidden until a borrower matches. Third parties see offers exist, nothing more. Selective disclosure by design.
๐ ENS Multi-Wallet Collateral Aggregation Users link wallets under an ENS name. WalnutV1 sums encrypted collateral across wallets via FHE.add without linking them publicly on-chain.
๐ฅ Encrypted Health Factor
Health factor is computed on encrypted collateral and debt. The protocol never stores or emits the plaintext value. onLiquidationResult fires via onlyCoFHE callback โ the result lives only in execution scope.
โ๏ธ Full Async Decrypt Architecture
Every protocol action that requires a plaintext result (liquidation, auction winner, credit tier) uses FHE.requestDecrypt with onlyCoFHE-guarded callbacks. No manual poll-and-submit. No self-calls. No plaintext in any event. Ever.
-------------------------------------------------- WAVE 3 vs WAVE 2 --------------------------------------------------
Network: Ethereum Sepolia โ Arbitrum Sepolia Contract: WalnutWave2b โ WalnutV1 (clean rewrite) SDK: cofhejs (deprecated) โ @cofhe/sdk v0.5.1 Credit Scoring โ 5-tier, 70โ90% dynamic LTV Sealed Auctions โ FHE.select, onlyCoFHE callback P2P Lending โ Encrypted terms, selective disclosure Async Callbacks Partial โ Full onlyCoFHE architecture Pool Counters โ Encrypted totalPoolCollateral/Debt Pause Mechanism โ Deposit/borrow gated, always repay
----------------------------
SUMMARY ----------------------------
Wave 3 ships a complete rewrite on Arbitrum Sepolia with Five FHE primitives that cannot exist on transparent rails: credit scoring from encrypted history, sealed-bid auctions where amounts never surface, P2P terms hidden until match, wallet aggregation without on-chain links, and liquidation checks where the health factor never leaves the ciphertext. Every decrypt callback is guarded by onlyCoFHE.
Aave proved that lending works on-chain. Walnut proves it works without anyone seeing anything.
## Wave 4 submission
Live App: https://walnut-finance.vercel.app Demo: https://youtu.be/b7JnQKpLCNM Smart Contract (WalnutV2): https://sepolia.arbiscan.io/address/0xaEBF0CD234779DA76cD2F938Fdd029F80b6F98da#code
-------------------------------------------------- ๐ WAVE 4 โ WHAT SHIPPED --------------------------------------------------
๐ฐ Real Token Collateral + Chainlink Oracle WalnutV2 accepts real ERC20 deposits. WalnutPriceOracle reads Chainlink AggregatorV3Interface feeds with staleness validation to convert token amounts to USD. That USD value is encrypted via FHE.asEuint128 and added to _collateral[user]. Individual position size stays encrypted from that point forward. MockUSDC is identical in interface to real USDC โ mainnet is an address swap, zero contract changes.
๐ช FHERC20 โ Encrypted Stablecoin
Borrowers receive wUSDC โ a WalnutFHERC20 token where balanceOf() returns a euint128 handle. Only a valid permit holder can unseal their balance. Mint and burn are restricted to WalnutV2 via onlyMinter. The LTV check runs entirely in FHE before mint executes. Silent reject if breached โ no revert, no position leak.
๐ On-Chain Interest Accrual
Interest computed at repayment using elapsed seconds and 8% APR, multiplied against encrypted debt principal via FHE.mul. The interest amount itself stays encrypted. Overpayment handled: actualBurn = min(repayAmount, totalOwed).
๐ Privara Private Settlement
Repayment produces two Arbiscan transactions: the WalnutV2 repay (wUSDC burned, debt updated in ciphertext) and a Privara escrow settlement (interest routed to treasury privately). Neither transaction contains a readable amount.
-------------------------------------------------- WAVE 4 vs WAVE 3 -------------------------------------------------- Collateral โ Real ERC20 (MockUSDC, WETH) Borrow โ WalnutFHERC20 wUSDC (encrypted balance) Price โ Chainlink AggregatorV3 + staleness check Interest โ On-chain accrual at repayment (8% APR) Settlement โ Real Privara escrow (two Arbiscan hashes) Contracts โ WalnutV2 + FHERC20 + Oracle + MockUSDC Tests โ 55 passing across all four Wave 4 contracts
----------------------------
SUMMARY ---------------------------- Wave 3 proved five FHE primitives that cannot exist on transparent rails. Wave 4 makes those primitives handle real money. A user deposits real USDC. The protocol encrypts it via Chainlink. They borrow wUSDC โ a real encrypted token with a real balance they can decrypt with their permit. Interest accrues on-chain against the encrypted principal. Repayment burns wUSDC and settles interest privately through Privara. Two Arbiscan links. Zero plaintext amounts.
Aave proved that lending works on-chain. Walnut proves it works without anyone seeing anything. Wave 4 proves it works with real tokens.
## Wave 5 submission
Live App: walnut-finance.vercel.app Demo: https://youtu.be/zb2FVYq8C58
WalnutLending: https://sepolia.arbiscan.io/address/0x786e919d305a012B9006bbd644a07E29029498b5 WalnutFHERC20: https://sepolia.arbiscan.io/address/0xe5cDaf3DfC5C721b2dE05494c73a7Bb2739501d9 WalnutPriceOracle: https://sepolia.arbiscan.io/address/0x27b0afF49b042C1d57Cce5af46D7290860B7565D MockUSDC: https://sepolia.arbiscan.io/address/0x58484E5a0745bAfFb30CBc7267690bE11a9ee7B3
-------------------------------------------------- WAVE 5 โ FINAL BUILD ------------------------------------------------- > Concurrent multi-loan architecture with isolated principal and interest tracking > Client-driven FHE synchronization using FHE.verifyDecryptResultSafe > ReentrancyGuard + CEI throughout protocol > Ghost-loan protection and pending-state recovery > Oracle hardening with validation and staleness checks > Source-verified contracts on Arbitrum Sepolia
QUALITY :
> 100% TypeScript strict compliance, zero build warnings > Full Hardhat e2e tests simulating client-driven FHE sync loop โ all passing > All contracts source-verified on Arbiscan
FHE-Native Features :
> Encrypted Lending Positions โ collateral, debt, and health factors stored as encrypted values > Private Credit Scoring โ repayment history updates credit tiers without exposing borrower history > Sealed-Bid Liquidations โ liquidation bids remain encrypted until auction resolution > P2P Lending Marketplace โ lenders publish encrypted APR, size, and tenor terms > ENS Wallet Aggregation โ multiple wallets contribute collateral without public linkage > Confidential Stablecoin (cUSDC) โ FHERC20-based encrypted borrow asset
----------------------------
SUMMARY ---------------------------- > Wave 1 validated the encrypted lending concept. > Wave 2 completed the lending lifecycle. > Wave 3 added five FHE primitives that cannot exist on transparent rails. > Wave 4 attached real tokens and Privara settlement. > Wave 5 hardens the architecture, corrects the CoFHE decryption model, and ships the product layer.
A user can now deposit USDC, hold multiple concurrent encrypted loans, repay by loan index, watch interest settle privately via Privara, and track their credit tier progressing without their repayment history ever surfacing.
The contract is reentrancy-proof, the CoFHE patterns are correct, and the documentation is production-grade.
Five waves. One protocol. Encrypted positions, concurrent loans, sealed-bid liquidations, private credit scoring, Privara settlement - live on Arbitrum Sepolia.
Aave made lending transparent. Walnut makes lending confidential. Positions, debt, health factors, repayment history, and liquidation bids remain encrypted while protocol rules continue to execute on-chain. Confidential Finance powered by FHE.
Prizes
- Wave 1 grant ยท 500 USDC
From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.





