explaingit

imoleayo0/confidential-lending

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 5/5LicenseSetup · hard

TLDR

A demo lending app on Zama's fhEVM that encrypts collateral, debt, and health factor on-chain so liquidation bots can only see a true or false result.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Study how fully homomorphic encryption can hide DeFi lending positions on-chain.

USE CASE 2

Deploy the CollateralVault contract to Sepolia testnet and run its test suite.

USE CASE 3

See how EVA avoids expensive encrypted division when computing a health factor.

USE CASE 4

Run the Next.js frontend to deposit and borrow against encrypted collateral.

What is it built with?

SolidityTypeScriptNext.jsfhEVMHardhat

How does it compare?

imoleayo0/confidential-lending0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyhardmoderatemoderate
Complexity5/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires Hardhat, a Sepolia RPC key, and separate frontend setup with wallet connect and Alchemy keys, uses a mock price oracle, not production-ready.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

EVA is an experimental lending application built on Zama's fhEVM, a blockchain technology that lets smart contracts compute directly on encrypted data. It is a demo project built for a developer program, aimed at a specific problem in existing crypto lending platforms: on services like Aave or Compound, everyone's collateral amount, debt, and health factor are fully visible on the public blockchain. The README states that automated bots scan this public data constantly and can act against a user's position the moment it becomes risky, and cites billions of dollars extracted this way. EVA's approach is to encrypt the collateral amount, debt amount, and health factor for each user using fully homomorphic encryption, so the smart contract can still calculate whether a position should be liquidated without ever revealing the underlying numbers to anyone watching the blockchain. Only a single true or false answer, whether liquidation should happen, is made publicly readable. The project explains a technical workaround it uses: instead of dividing two encrypted numbers to compute a health factor, which is expensive under this encryption scheme, it rearranges the comparison so no division is needed. The project includes a Solidity smart contract for the encrypted collateral vault, and a Next.js frontend that handles the browser side encryption before anything is sent to the blockchain, plus wallet connection tooling. It is currently deployed only on the Sepolia test network, not a live network with real funds. The README is explicit about its limitations: the price used to value collateral is set manually by the contract owner rather than coming from a real price feed, and there is a plaintext emergency withdrawal function included only for demo purposes. Both are clearly labeled as things a production version would need to replace. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Explain how EVA hides collateral and debt on-chain using Zama's fhEVM without revealing amounts.
Prompt 2
Walk me through deploying the CollateralVault contract to Sepolia with Hardhat.
Prompt 3
Why does EVA avoid dividing encrypted numbers when computing the health factor, and how does it work around it?
Prompt 4
Help me set up the Next.js frontend and connect a wallet to test EVA locally.

Frequently asked questions

What is confidential-lending?

A demo lending app on Zama's fhEVM that encrypts collateral, debt, and health factor on-chain so liquidation bots can only see a true or false result.

What language is confidential-lending written in?

Mainly TypeScript. The stack also includes Solidity, TypeScript, Next.js.

What license does confidential-lending use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is confidential-lending to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is confidential-lending for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.