About PrivateRent
Inspiration
Rental applications have become increasingly invasive, often requiring extensive personal financial data that tenants must share with countless landlords who may never rent to them. This creates two major problems: privacy violations and potential discrimination based on irrelevant personal characteristics. We were inspired by the potential of Midnight's zero-knowledge proof technology to solve both issues simultaneously - allowing tenants to prove they meet requirements without revealing sensitive data.
What We Learned
Building on Midnight taught us the intricacies of zero-knowledge proof generation and verification in real-world applications. We gained deep experience with:
- Compact Language: Midnight's TypeScript-based smart contract language and its unique witness function patterns
- Private State Management: How to properly handle sensitive data that must remain client-side while still enabling blockchain verification
- ZK Circuit Design: Creating circuits that prove mathematical relationships (e.g.,
income >= requirement) without revealing underlying values - Identity Architecture: Designing systems where cryptographic public keys replace traditional identity verification
The most significant learning was understanding how to balance usability with privacy - making zero-knowledge proofs feel seamless to end users while maintaining cryptographic rigor.
How We Built It
Architecture
Our system consists of three main components:
- Smart Contract (
PrivateRent.compact): Handles listing creation, application processing, and acceptance logic - Witness Functions: Provide private data to ZK circuits without storing it on-chain
- CLI Interface: Full-featured application for testing and demonstration
Technical Implementation
The core innovation lies in the witness function design:
witness getTenantIncome(): Uint<64>;
witness getTenantCredit(): Uint<64>;
These functions provide private financial data to circuits that generate proofs like:
const meetsIncomeReq = income >= listing.minIncome;
assert(meetsIncomeReq, "Income requirement not met");
The mathematical relationship is verified cryptographically without revealing the actual income value.
Development Process
- Contract Development: Implemented core rental logic with ZK verification circuits
- Proof Integration: Connected witness functions to smart contract calls
- Identity Management: Built role-based access system for landlords and tenants
- Testing Infrastructure: Created comprehensive CLI for end-to-end workflow testing
- TestNet Deployment: Successfully deployed to Midnight TestNet with address
02005cc5cd9a7b1cc85b19e1755fd7deeebebdf9d9f76566191f6b8fe83b9580a128
Challenges Faced
Private State Complexity
The biggest challenge was managing private state across different contract calls. Each transaction requires its own private state context, but maintaining consistency between landlord and tenant identities proved complex. We solved this by implementing identity-specific contract instances that preserve the correct cryptographic context.
Witness Function Integration
Initially, witness functions weren't receiving tenant data properly, causing ZK proof generation to fail. The solution required understanding Midnight's specific patterns for passing private state to witness functions during contract calls.
TypeScript/Compact Integration
Bridging between TypeScript CLI code and Compact smart contracts required careful attention to type compatibility and data serialization, particularly for handling bigint values and Uint8Array secret keys.
Proof Server Configuration
Getting the local proof server properly configured and communicating with the CLI required debugging Docker networking and ensuring version compatibility between the proof server and compiled contract artifacts.
Technical Achievements
- Real ZK Proofs: Generated and verified zero-knowledge proofs for financial qualifications on live blockchain
- Multi-Identity System: Seamless switching between landlord and tenant roles with proper private state management
- Privacy-Preserving Workflow: Complete rental application process where sensitive data never leaves the tenant's device
- Blockchain Integration: Full transaction lifecycle from proof generation to on-chain verification
Impact and Future Vision
PrivateRent demonstrates how zero-knowledge technology can transform industries requiring sensitive data verification. The core privacy-preserving verification pattern we've implemented could extend to employment background checks, mortgage applications, and any scenario where qualification must be proven without revealing personal details.
Our immediate roadmap includes rental history verification, direct credit bureau integration, and web frontend development. The long-term vision involves partnering with existing rental platforms to make privacy-first verification the industry standard.
The project proves that privacy and trust are not mutually exclusive - with the right cryptographic tools, we can verify qualifications while protecting personal data.
Built With
- compact-language
- cryptographic-witnesses
- docker
- halo2
- midnight-network
- node.js
- private
- smart-contracts
- state
- typescript
- zero-knowledge-proofs
Log in or sign up for Devpost to join the conversation.