Skip to content
tekuuuPublic

About

Confidential DeFi lending protocol using Zama FHE for encrypted assets operations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nexora — Confidential Lending Protocol

A privacy-preserving money market built on Zama FHEVM, where balances, debts, and collateral stay encrypted on-chain.

Nexora Banner

Solidity FHEVM Standard

Status: active build toward the Zama Developer Program Season 3 (Composable Privacy). The canonical design and roadmap live in NEXORA_MASTER_PLAN.md — that document is the source of truth.


What Nexora is

Nexora is an isolated, single-pair confidential money market (Morpho Blue–style): one collateral asset and one loan asset per market, with immutable risk parameters set at deploy. Supply, borrow, interest accrual, and liquidation run end-to-end inside FHEVM — individual amounts are never revealed.

The ledger is Compound Comet–style and index-based: each position is an encrypted scaled principal, and interest accrues by advancing a single public index. No receipt token is ever the source of truth.

The three FHE design moves

  1. Interest — public indexes + encrypted scaled balances. A user's balance is scaledPrincipal × publicIndex. Interest applies by moving one public number; no per-user encrypted division.
  2. Rates — epoch reveal of quantized totals. Totals accrue encrypted; once per epoch the protocol reveals only bucketed aggregates to recompute the kinked-curve rate. Individual positions stay hidden.
  3. Liquidation — price-gated probe → 1-bit reveal → blind tranche seize. A bonded probe (gated by cooldown or a real price move) reveals a single bit — is this position liquidatable? — then liquidation proceeds in blind tranches. Amounts never leak, dissolving liquidation-sniping MEV.

Solvency is never computed as a health factor; it is checked as a cross-multiplied encrypted inequality. Rejected actions clamp to a zero-move instead of reverting, so a rejected action is on-chain-indistinguishable from a real one.

Architecture

Component Encrypted? Responsibility
MarketFactory no Deploys/registers isolated markets from configs
MarketConfig no Immutable per-market params (assets, LTV, θ, bonus, caps, epoch, probe)
PriceRouter no Chainlink → normalized public prices with staleness checks
InterestRateModel no Pure kinked utilization curve
NexoraMarket yes supply / withdraw / borrow / repay; solvency gating; holds encrypted positions
RateOracle epoch Epoch reveal of quantized totals → rate update (may inline into market)
LiquidationEngine flags Probe bonds, 1-bit liquidatable decrypt, tranche seizure
ACLManager no Roles (POOL_ADMIN / EMERGENCY_ADMIN / RISK_ADMIN)

Tokens come from the official Zama ERC-7984 registry — Nexora ships no custom token or swapper contracts.

Repo layout

contracts/      Hardhat + @fhevm/hardhat-plugin: Solidity contracts and tests
webapp/         Next.js 15 frontend (wagmi v2, @zama-fhe/relayer-sdk)
NEXORA_MASTER_PLAN.md   Canonical design, economics, and full contract spec

Quickstart

Contracts

cd contracts
npm install
npm run compile
npm test            # unit + local-fhevm-mock integration tests

Frontend

cd webapp
npm install
cp .env.local .env.local   # fill in deployed contract addresses
npm run dev

Privacy / leakage budget

Nexora hides amounts, not transaction metadata. What is observable on-chain: who/when/which function (amounts hidden); quantized epoch aggregates (once per epoch); one bit per price-gated liquidation probe; a coarse tranche-count size hint during liquidation. Everything else stays encrypted. Full budget ships in SECURITY.md.

License

See LICENSE.

About

Confidential DeFi lending protocol using Zama FHE for encrypted assets operations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages