Native EVM Privacy-Preserving Lending Platform: Leveraging the Poseidon Hash, Noir DSL, IMTs, Aave, Intents, & ZKPs
This project is a native EVM privacy-preserving lending platform that leverages zk circuits and intents to enhance onchain user privacy and capital efficiency. Users can deposit liquidity from one address and receive their initial deposit on another address without creating a link between the two addresses, all while accruing interest on their deposit. It’s magic!
While the liquidity is deposited into the Tornado Cash 2.0 vault, it is supplied to Aave, earning interest. The person who calls the withdraw function with a valid withdrawal proof, is rewarded with the interest earned. Additionally, the more liquidity initially deposited, the shorter the time required to finalize the withdrawal without paying a fee. Other users can submit valid withdrawal proofs to the Tornado Cash vault contract to receive the interest earned by the initial deposit. The user who deposited the liquidity receives their liquidity directly from the Aave pool contract.
The key innovation here is the ability to prove that something was done a certain time ago in the past without revealing when it occurred. This is achieved by using two separate on chain proof verifiers. All hashing is done using the Poseidon hash, which the Ethereum Foundation is actively researching and verifying its security claims.
Logic Flow:
The more users use the protocol, the higher the privacy guarantee.
Key ZKP innovation: Prove an event X happened Y amount of time in the past, without revealing at what point in time event X occurred using two separate zk proofs, and an onchain commitment.
I am pretty sure this is the first time something like this has been created using a pure circuit and a smart contract. This is possibly the foundation for an EIP. I came up with this idea completely on my own. Please refer to the deposit and withdraw circuits to see how this is implemented.
Privacy is a fundamental human right.
I built this project using a combination of advanced cryptographic techniques and blockchain technologies to ensure both privacy and functionality. At the heart of the system is the Noir DSL, which I used to write the zero-knowledge circuits.
For the hashing mechanism within these circuits, I employed the Poseidon hash function developed by Dmitri Hordatovich. Poseidon is specifically optimized for zero-knowledge proofs, making it an ideal choice for efficient and secure hashing.
The smart contracts are written in Solidity.
A key component of the system is the storage of an intermediate Merkle tree on-chain. This Merkle tree plays a crucial role in maintaining the anonymity of transactions. When a user initiates a withdrawal, they prove that they know the hash preimage of a leaf in the intermediate Merkle tree without revealing which specific leaf it is or the path to that leaf. This zero-knowledge proof allows for secure verification of transactions while preserving user privacy. The 32 most recent IMT roots are stored in an array in the smart contract.
One of the innovative aspects of the project is the ability to prove that an action was performed at some point in the past without disclosing the exact time it occurred, only that a certain amount of time has elapsed since this action occurred.
By integrating these technologies—Noir for circuit design, Poseidon for hashing, and Solidity for smart contracts, and Aave for the lending backend, —I've created a seamless and privacy-preserving lending platform.