The problem zkLoans solves
zkLoans brings confidential Credit Scores. It proves to a counterparty if you meet threshold requirements for a credit score without revealing the precise value. This is made possible using ZK-SNARKS, and could be used for several kinds of applications including unsecured on-chain loans.
It works by generating an off-chain ZK-SNARK proof, and submitting it to the Near VM for verification, using keys generating during a trusted key ceremony. A Near contract is used to keep track of whether the user is elligible for a loan, without ANY knowledge of the user's credit score or private details.
zkLoans could be extended very easily to other applications. Imagine proving someone you have sufficient bank balance to clear a (digital) cheque, without revealing your actual bank balance/statements.
Challenges I ran into
- ZK-SNARK verification on Near VM is unchartered territory. There's no documentation on how to make it work for Near, or even if it's possible to achieve (spoiler - it is!).
- Near NVM does not have primitives to verify ZK-SNARK proofs on-chain. Using Aurora for my PoC didn't seem like an interesting enough challenge. I ended up deploying a Groth16 ZK-SNARK verifier to Near VM, which makes this project very unique.
- The circom circuit for my use case was not very obvious to understand and crack.
- Verification of the groth16 proof took a boat load of gas, which I couldn't initially figure out.
- The ZK ceremony was complex since I was not using Plonk proofs.
- I was unfamiliar with Near's programming model, so I needed to learn everything I needed to know during the hackathon.