Last updated 5 months ago
Python developers lack a clear Reference DApp and simple SDK to connect to Midnight and call Compact contracts, making it hard to start building privacy-preserving dApps.
PyMidnight: a lightweight Python SDK plus a minimal Compact Reference DApp with a simple UI and Lace integration, demonstrating a full end-to-end programmable privacy flow on Midnight.
Please provide your proposal title
PyMidnight – Reference DApp & Python SDK for Midnight
Please specify how many months you expect your project to last
3
Please indicate if your proposal has been auto-translated
No
Original Language
en
What is the problem you want to solve?
Python developers lack a clear Reference DApp and simple SDK to connect to Midnight and call Compact contracts, making it hard to start building privacy-preserving dApps.
Supporting links
Does your project have any dependencies on other organizations, technical or otherwise?
No
Describe any dependencies or write 'No dependencies'
No dependencies
Will your project's outputs be fully open source?
Yes
Please provide here more information on the open source status of your project outputs
This project is publicly available under the Apache License 2.0, which gives you the freedom to use, copy, modify, and distribute the source code, including for commercial purposes.
Please choose the most relevant theme and tag related to the outcomes of your proposal
Developer Tools
What is useful about your DApp within one of the specified industry or enterprise verticals?
This project is primarily a Reference DApp + developer tool, rather than a production application for a single industry. However, the underlying privacy pattern is relevant for:
The primary goal is to demonstrate a data-protection pattern (selective access / programmable privacy) on Midnight, not to build a full vertical solution.
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: MinimalSelectiveNote (Compact TypeScript), Purpose:
A small, clear contract that demonstrates:
Core idea: Users can store a note identified by noteId with protected metadata and later selectively reveal or prove access to it. Key entrypoints (tentative):
The logic is intentionally kept simple and focused on the access-control pattern, in line with the “small but technically complete” Reference DApp philosophy.
PyMidnight – Lightweight Python SDK. Goal:
get_health() – calls a health endpoint or CLI.
submit_tx(rawTx) – sends a prepared transaction.
call_contract(entrypoint, args) – helper for invoking Compact contract entrypoints (storeNote, revealNote).
pymidnight health.
pymidnight demo-store-note.
pymidnight demo-reveal-note.
This SDK is deliberately small and focused on developer experience, aiming to be easy to read and extend.
Backend (backend/app.py) - A simple REST API or CLI-based backend that wires PyMidnight to the Compact contract:
UI - Minimal UI with two main screens:
Connect Lace (Midnight).
Input noteId and a demo note/metadata value.
Submit → triggers a backend call → PyMidnight prepares a transaction → Lace signs and submits.
Connect Lace.
Request revealNote for a given noteId.
Display the (decrypted or selectively revealed) result.
Lace Wallet Integration - Use the official dApp connector to:
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)?
Planned repository layout:
/README.md, /LICENSE (Apache-2.0), /docs/, /pymidnight/, /contracts/, /backend/, /ui/, /tests/, /scripts/
README & docs content:
How other developers will learn and reuse:
Measurable impact:
Please describe your proposed solution and how it addresses the problem
The proposed solution is PyMidnight – a combination of a small, focused Reference DApp and a Python SDK for Midnight, designed to clearly demonstrate how to build privacy-preserving dApps with Compact in an end-to-end flow.
The solution consists of four main components:
1. Compact Contract – MinimalSelectiveNote
Implemented in Compact TypeScript, providing a minimal selective access pattern:
The contract uses Midnight privacy primitives to avoid exposing raw data on the ledger and highlights programmable privacy, not just public business logic.
2. Python SDK – pymidnight
Provides a simple abstraction layer for Python backends:
Goal: give Python developers a clear entry point to connect to Midnight and call Compact contracts, without having to build integration logic from scratch.
3. Demo Backend
A small FastAPI/Flask-style service acting between the UI and Midnight:
The backend uses PyMidnight to prepare and send requests/transactions to a Midnight node.
4. Minimal UI + Lace (Midnight) wallet integration
A simple web UI implementing two flows:
Integrates the Lace dApp connector to obtain the user address and request transaction signatures.
Overall, the solution delivers a small but technically complete Reference DApp plus a Python SDK with documentation and tests. Midnight developers – especially Python developers – can clone the repo, run the demo, understand the privacy flow, and easily fork/extend it for use cases such as financial claims, anonymous feedback, or sensitive metadata that must be selectively disclosed.
System Structure:
Usefulness – Patterns & Necessity
1. Problem → data-protection pattern mapping
2. Why Midnight + Compact, not a public ledger alone?
3. Benefiting developer personas
4. Value delivered
5. Who benefits?
6. Importance for Midnight
Demonstrates Midnight’s unique positioning: programmable privacy rather than generic smart contracts.
Please define the positive impact your project will have on Midnight ecosystem
The project has had significant positive impacts, including:
We are committed to sharing results in a transparent and accessible way:
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?
The Bamboo Team represents the optimal combination of deep technical expertise and extensive experience within the Cardano/Midnight ecosystem, making us the most suitable team to execute this project:
•Stake pool operators: With over two years of running the BBO stake pool, more than one year operating a Midnight testnet pool, and developing multiple on-chain data-collection bots, we are fully capable of retrieving on-chain data and delivering accurate API services.
• Technical leadership with strong AI/ML capability: Our technical lead has advanced expertise in AI/ML, capable of deploying end-to-end model lifecycles using Python, R, TensorFlow, PyTorch, and LightGBM — from designing data pipelines (SQL, GraphQL, Docker) to deploying on cloud platforms (AWS/Azure/GCP). With many years of management experience in major financial institutions, he also possesses deep knowledge of Basel compliance, regulatory frameworks, and automated underwriting systems at leading banks (TPBank, VietCredit, OCB).
• Catalyst experience: We have successfully completed two proposals in Fund 11 (1100034) — a Concept prototype for a mobile on-chain data collection app — and one proposal in Fund 13 (1300003) for an open-source AI chatbot for Cardano governance.
• Midnight ecosystem engagement: We have built a community of more than 1,300 members dedicated to sharing insights about the Cardano/Midnight ecosystem (https://t.me/Cardano_ECO_VN)..) We also share about Midnight in the events we organize/participate in.


Cooperate with Cardano Vietnam to organize an event to share about Cardano and Midnight

Speakers introducing Cardano/Midnight at Bitget X Cardano: Saigon Ledger Night event
Feasibility - Scope is intentionally small and focused:
· Timeline matches the 3-month, 3-milestone requirement.
Validation approach:
Please provide a cost breakdown of the proposed work and resources
Milestone 1 – SDK & Contract Skeleton (Month 1)
Scope: Public repository with Apache-2.0 license, PyMidnight SDK skeleton (config, client, tx, CLI), basic tests, Compact contract skeleton.
Work & resources:
1. Development: ~60 hours × 30 USD/hour = 1,800 USD
Tasks:
2. Infrastructure & tools (CI + basic cloud setup): 250 USD
Milestone 1 total: 2,050 USD
Milestone 2 – Contract Logic + Backend + CLI Demo (Month 2)
Scope: Working Compact logic (storeNote / revealNote), backend integration, CLI demos, contract/integration tests.
Work & resources:
1. Development: ~90 hours × 30 USD/hour = 2,700 USD
Tasks:
2. Infrastructure & tools (runtime & integration testing) - Additional CI and cloud usage (node access / test environment): 300 USD
Milestone 2 total: 3,000 USD
Milestone 3 – UI + Lace Integration + PoC Release (Month 3)
Scope: Minimal UI with Lace wallet integration, end-to-end flow, documentation, PoC release, and light post-PoC maintenance.
Work & resources:
1. Development (UI + Lace + polishing): ~70 hours × 30 USD/hour = 2,100 USD
Tasks:
2. Light post-PoC maintenance (approx. 6 months): ~20 hours × 30 USD/hour = 600 USD
Tasks:
3. Infrastructure & tools (final month + demo hosting / storage): 250 USD
Milestone 3 total: 2,950 USD
Total Project Cost: 8,000 USD
How does the cost of the project represent value for the Midnight ecosystem?
Estimated budget:
Total requested: 8,000 USD
(within the 2,500–10,000 USD range for Midnight Compact DApps).
Value to Cardano & Midnight ecosystem- For a modest budget, the ecosystem gains:
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
I Agree
Yes
1. Do Duc Chau - Project Manager
2. Le Minh Tri - Technical Lead
3. Nguyen Hoang Khai - Full Stack Developer
4. Anh Huynh Nguyen Huy: Full Stack Developer