[Proposal setup] Proposal title
Please provide your proposal title
Private Liquidity Reference: Compact Swap (Phase 1)
[Proposal Summary] Time
Please specify how many months you expect your project to last
3
[Proposal Summary] Translation Information
Please indicate if your proposal has been auto-translated
No
Original Language
en
[Proposal Summary] Problem Statement
What is the problem you want to solve?
Midnight lacks a private exchange DApp reference (Compact contracts). This blocks adoption and private DeFi/DEX building. We must deliver this blueprint to accelerate privacy growth.
[Proposal Summary] Supporting Documentation
Supporting links
[Proposal Summary] Project Dependencies
Does your project have any dependencies on other organizations, technical or otherwise?
No
Describe any dependencies or write 'No dependencies'
No dependencies
[Proposal Summary] Project Open Source
Will your project's outputs be fully open source?
Yes
Please provide here more information on the open source status of your project outputs
All project outputs, including the $PrivateSwap.compact$ contract, ZKP logic, and Demo UI, will be fully open-sourced under the MIT License.This permissive license ensures maximum reusability and adoption. Developers can freely fork, modify, and build upon this core blueprint without copyright restrictions. The final release will be tagged on GitHub in Month 3.
[Theme Selection] Theme
Please choose the most relevant theme and tag related to the outcomes of your proposal
Audit
[Campaign Category] Category Questions
What is useful about your DApp within one of the specified industry or enterprise verticals?
Our Minimal Compact Swap Reference DApp directly targets the Financial Services and Enterprise Data Management verticals by solving the fundamental Web3 paradox: Transparency vs. Privacy.
- Strategic Utility: Enabling Compliant DeFi. The DApp's core utility is providing the first working code for selective disclosure in a financial exchange. For institutional users, the ability to prove solvency or asset compliance via ZKPs without exposing proprietary data is non-negotiable. Our DApp is the essential, trust-minimized building block that allows these entities to engage with Midnight, paving the way for institution-grade Private Lending and Private Liquidity Pools in Phase 2.
- ZKP Technical Validation: The project is a critical technical validation point. It demonstrates that the Compact contract stack can reliably handle the complexity of ZKP generation and verification within a financial transaction loop. This open-source validation acts as a powerful marketing tool for the Midnight protocol itself, establishing technical credibility for all future developers.
- Enterprise Data Sovereignty: Beyond simple asset swap, the code provides a reference for tokenized data exchange. Enterprises can utilize the ZKP/Compact logic to create privacy-preserving B2B contracts where transaction details are verified but kept confidential. We are architecting the trust layer required for Midnight to capture the institutional market.
What exactly will you build? List the Compact contract(s) and key functions/proofs, the demo UI flow, Lace (Midnight) wallet integration, and your basic test plan.
- Compact Contract(s) & Proofs
- We will build one core Compact contract ($PrivateSwap.compact$, written in Rust) and the associated ZKP infrastructure. Key Proofs: The core implementation focuses on $Proof_of_Solvency$. Key Functions: The contract logic supports two atomic steps: order_placement() (initiates ZKP and locks assets) and order_acceptance() (verifies ZKP and finalizes the swap).
- Demo UI Flow & Wallet Integration
- Demo UI: A minimal, functional web interface deployed on the Midnight Testnet URL. Flow: The UI clearly guides the user through the ZKP generation process (local) and the secure P2P swap exchange. Integration: We will integrate directly with the Lace Wallet (Midnight compatible), using it to securely sign transactions related to ZKP submission and order finalization, ensuring a fully private transaction path.
- Basic Test Plan & Documentation
- Test Plan: Our commitment includes Unit Tests (targeting 90% code coverage on the ZKP logic) and Integration Tests (verifying the end-to-end functionality of the swap flow with the Lace Wallet on Testnet). Documentation: We will deliver a Technical ReadMe detailing the ZKP architecture, a Video Tutorial demonstrating the swap flow, and clear instructions on how to fork and reuse the open-source code.
- Expansion Potential (Strategic Value)
- The successful completion of this Phase 1 Reference Code is the non-negotiable prerequisite for Phase 2, where we will expand this logic into complex Private Liquidity Pool (LP) and multi-asset swap concepts, leading to the full Private DEX prototype.
How will other developers learn from and reuse your repo? Describe repo structure, README contents, docs/tutorials, test instructions, and extension points. Which developer personas benefit, and how will you gauge impact (forks, stars, issues, remixes)?
- Repository Structure & Content
- The GitHub repo will be organized intuitively: /compact-contract (containing the core Rust logic and ZKPs), /demo-ui (minimal front-end integration example), and /docs (tutorials). The README.md will serve as the primary landing page, clearly outlining the architecture and the ZKP principle implemented.
- Learning Resources & Reuse
- We will provide three key resources: (a) Code Comments: Heavily commented Compact contract code explaining ZKP flow. (b) Step-by-Step Tutorials (Video/Written): Detailed guides showing how to clone, run the Testnet swap, and adapt the core Compact contract logic. (c) Test Instructions: Clear instructions on running the Unit Tests (90% coverage) and Integration Tests to verify code integrity. Extension Points: The code is modular, offering clear extension points for multi-asset swaps and advanced LP (Liquidity Pool) logic.
- Developer Personas Benefiting
- Cryptographers benefit by studying the functional ZKP implementation. DeFi Builders gain the foundational private swap logic to build their DEX/Lending DApps immediately. New Compact Devs learn best practices for Midnight development directly from working code.
- Gauging Impact (Metrics)
- We will gauge success through verifiable GitHub metrics: (a) Forks/Clones: Measures code reuse and adoption (Target: 20+). (b) Stars: Measures overall community interest. (c) Issues/Pull Requests (PRs): Indicates community engagement and desire to extend the blueprint. (d) Remixes: We will track external projects built using our code as a foundational layer, proving its role as the core private liquidity blueprint.
[Your Project and Solution] Solution
Please describe your proposed solution and how it addresses the problem
- Our solution, the Minimal Compact Swap Reference, provides the missing working code blueprint needed for Midnight's private DeFi ecosystem. We address the problem as a developer tooling and education bottleneck, not a core technology flaw. Approach: We prioritize developer experience and reusability by building a simple, modular DApp, making complex ZKP logic accessible.
- Core ZKP Utility: The DApp utilizes Zero-Knowledge Proofs (ZKPs) via Compact contracts to enable a private P2P token swap.
- Privacy Mechanism: This allows users to prove asset ownership (solvency) without revealing sensitive wallet metadata.
- Development Benefit: This provides a crucial 'plug-and-play' foundation for future private DeFi DApps—saving development teams an estimated 40-50% of complex setup time
- The primary beneficiaries are Midnight developers seeking to build financial applications where compliance and user data sovereignty are paramount. The code acts as a reference for complex use cases like institutional Private Lending and advanced LP designs.
[Your Project and Solution] Impact
Please define the positive impact your project will have on Midnight ecosystem
- Strategic Systemic Value
- Our $9,500 USDM contribution serves as a critical infrastructure investment that validates Midnight's core thesis. The primary impact is securing the necessary cryptographic foundation for high-value financial operations. By solving the private liquidity problem first, we transform Midnight's theoretical potential into verifiable, usable technical capability—a massive signal boost to institutional and serious DeFi developers considering the platform.
- Catalytic Adoption & Sustainability
- The project creates a lasting, catalytic effect. The open-source asset acts as a public utility layer, reducing the capital expenditure and time required for every subsequent private DApp built. This single effort generates exponential ROI by making all future development easier. Our success metrics (tracking repository forks and testnet swaps) directly measure the health of the nascent developer community and the long-term code sustainability of the private finance sector.
- Global Community Empowerment
- We are empowering builders globally by translating complex ZKP concepts into production-ready, auditable Rust code. This is not just a tool for the team; it's a foundational educational resource that ensures Midnight's technological prowess is accessible, transparent, and rapidly adopted by the decentralized community worldwide.
[Your Project and Solution] Capabilities & Feasibility
What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?
- Specialized Competence & Trust
- Our team's core strength lies in the convergence of Cryptographic Engineering and Compact Stack mastery. This is a rare combination crucial for delivering ZKP-enabled smart contracts. Trust validation: We establish immediate trust by structuring our work around auditable transparency. Our three named team members are cross-disciplinary and have clearly defined, non-overlapping responsibilities (ZKP development, UI integration, and documentation management). We leverage past experience in open-source contribution to maintain the highest level of trust and code quality assurance.
- Feasibility Validation & Mitigation
- Feasibility is secured by controlled scope. The 3-month timeline is aggressive but achievable because we strictly adhere to the Minimal Viable Reference definition. We are not building complex liquidity pools or a full DEX UI. Validation: Feasibility is confirmed at the end of each milestone: M1 validates the cryptographic core (logic is sound); M2 validates the crucial technical link (integration with Lace Wallet); and M3 validates the project's public readiness (documentation complete). Accountability: We mitigate risk by dedicating over 90% of the budget to specialized labor and committing to the 90% code coverage test standard, ensuring the final output is robust, secure, and ready for community reuse.
- Quoc Tuan : Lead Compact EngineerLeads the core Compact contract development (Rust) and ZKP logic implementation ($Proof_of_Solvency$ focus in M1)..me/QuocTuan90elegram / om/Quctun7TuanX
- The Luan Full-Stack Developer Responsible for the front-end Demo UI, and the crucial technical integration with the Lace Wallet/Midnight API (M2 focus). https://t.me/Theluanhd/ /https://x.com/theluan34
- Linh Nguyen Project Manager & Documentation Oversees project accountability, manages the 3-month timeline, technical documentation, and coordinates the final code release (M3 focus). https://www.google.com/search?q=https://t.me/LinhNguyen3699 /https://www.google.com/search?q=https://x.com/thichdhamma369
[Final Pitch] Budget & Costs
Please provide a cost breakdown of the proposed work and resources
- . Allocation Strategy
- The total requested funding is $USDM 9,500. This budget reflects a commitment to efficient resource deployment, dedicating over 85% to specialized labor directly responsible for ZKP code creation. We have minimized overhead to ensure maximum impact per dollar spent. Funds are solely for future work (3-month duration).
- Detailed Cost Breakdown
- Our costs are broken down based on the specialized labor required for each Milestone:
- Compact Contract Engineering (M1 Focus): $5,500 - Covers the Lead Compact Engineer's time for complex ZKP logic development, core Compact contract construction, and achieving the 90% code coverage target.
- Full-Stack Development & Integration (M2 Focus): $2,500 - Covers the Full-Stack Developer's labor for the Demo UI creation, and the crucial secure integration with the Lace Wallet/Midnight API.
- Project Management & Documentation (M3 Focus): $1,500 - Covers the Project Manager's time for accountability, reporting, technical documentation, and creating the strategic Phase 2 Roadmap.
- Compliance and Value Justification
- Compliance: We explicitly confirm that no funds are allocated for purchasing digital assets, retroactive work, user incentives, or establishing treasury pools, adhering strictly to Fund Rules. Value: This budget is highly efficient because it leverages specialized, pre-existing ZKP expertise. The cost is justified by the strategic output: a robust, auditable code reference that accelerates the entire ecosystem, representing exceptional value for a foundational infrastructure asset.
[Final Pitch] Value for Money
How does the cost of the project represent value for the Midnight ecosystem?
- Cost Efficiency vs. Output
- This $USDM 9,500 proposal offers an exceptional Return on Investment (ROI) because we are delivering a foundational cryptographic asset at a fraction of the market cost. To outsource ZKP implementation and Compact contract hardening typically costs five to ten times this budget. We achieve efficiency by strictly limiting the scope to the Minimal Reference and leveraging our internal, specialized expertise.
- Strategic Value & Acceleration
- The cost is justified not by the amount of code, but by the strategic importance of the problem solved (providing the private liquidity blueprint). This small investment acts as a catalyst for ecosystem acceleration, immediately saving every subsequent development team hundreds of hours of complex ZKP setup time. It ensures that the most critical piece of Midnight's DeFi infrastructure is built correctly, securely, and openly from the ground up.
- Open Source Multiplier
- The fully open-source nature of the asset ensures that the $9,500 USDM investment benefits the entire global community, not just our team. The MIT License allows for free modification and commercial use, guaranteeing that the initial funding generates exponential value for future private DeFi applications on Midnight.
[Self-Assessment] Self-Assessment Checklist
I confirm that the proposal clearly provides a basic prototype reference application for one of the areas of interest.
Yes
I confirm that the proposal clearly defines which part of the developer journey it improves and how it makes building on Midnight easier and more productive.
Yes
I confirm that the proposal explicitly states the chosen permissive open-source license (e.g., MIT, Apache 2.0) and commits to a public code repository.
Yes
I confirm that the team provides evidence of their technical ability and experience in creating developer tools or high-quality technical content (e.g., GitHub, portfolio).
Yes
I confirm that a plan for creating and maintaining clear, comprehensive documentation is a core part of the proposal's scope.
Yes
I confirm that the budget and timeline (3 months) are realistic for delivering the proposed tool or resource.
Yes
[Required Acknowledgements] Consent & Confirmation
I Agree
Yes