Project name
ProofPledge
Tagline
Public commitments with private, verifiable ownership on Midnight.
Short description
ProofPledge is a privacy-preserving accountability DApp. A pledge is public, but the secret that controls completion and archival remains in local private state. Midnight verifies ownership through a zero-knowledge proof before accepting protected state transitions.
Inspiration
Accountability applications commonly require an account, email address, public wallet identity, or social profile. That identity link is unnecessary when the only requirement is to prove that the same participant who created a commitment is authorized to complete or archive it.
ProofPledge explores a smaller privacy boundary: publish the commitment, keep the ownership credential private, and prove authorization only when the pledge changes state.
What it does
ProofPledge manages one public pledge through a three-state lifecycle:
EMPTY— no active pledge exists.OPEN— a public pledge has been created.COMPLETED— the owner has proved authorization and completed the pledge.
The pledge owner can archive a completed pledge, which returns the contract to EMPTY and increments the sequence. A participant with a different private state can view the public pledge but cannot complete or archive it successfully.
How it was built
The Compact contract stores the public pledge, lifecycle status, sequence, and ownership commitment. A witness supplies the ownership secret from local private state. The completePledge and archivePledge circuits compare a commitment derived from that secret and the current sequence against the public owner commitment.
The sequence is included in the commitment so authorization material associated with an archived pledge cannot authorize a later pledge.
The repository uses:
- Compact 0.31.0
- Midnight.js 4.1.1
- TypeScript
- React
- Material UI
- RxJS
- Vitest
- Docker-based Midnight development services
- Lace wallet integration
The official Midnight bulletin-board example supplied the initial workspace and provider integration pattern. ProofPledge replaces the bulletin-board domain with a pledge lifecycle, adds an intermediate completion state, expands the contract tests, and provides a product-specific interface and documentation.
Challenges
The main challenge was preserving a strict separation between public pledge information and the private credential used for authorization. The implementation also had to bind ownership to a pledge sequence so an authorization proof from an earlier lifecycle could not be reused after archival.
Browser private-state scoping required additional care because several contract cards can share one provider instance. Each protected action re-selects its contract scope before proof generation.
Accomplishments
- Implemented a complete
EMPTY -> OPEN -> COMPLETED -> EMPTYcontract lifecycle. - Protected completion and archival with private witness-based ownership checks.
- Bound ownership commitments to the current sequence.
- Added contract tests for valid transitions, invalid transitions, non-owner actions, repeated actions, and stale ownership material.
- Added browser and CLI interaction paths.
- Added repository-wide formatting, type checking, linting, testing, build, and CI commands.
- Documented the privacy model, architecture, verification status, demo flow, and submission process.
What was learned
Midnight separates public ledger state, private witness data, and zero-knowledge circuit execution. That separation makes it possible to prove possession of an authorization secret without placing the secret or a conventional user identity on the public ledger.
The project also reinforced that a useful privacy design must state what remains public. ProofPledge protects ownership, not pledge content. The interface explicitly warns that the pledge text is public.
What's next
Possible extensions include encrypted private-state persistence, recovery options, multiple concurrent pledges, delegated completion, optional proof-of-evidence attachments, and a production deployment strategy. These features remain outside the hackathon minimum viable product.
Built with
compact, midnight, midnight.js, typescript, react, material-ui, rxjs, vitest, docker, lace-wallet
AI-tool disclosure
ChatGPT assisted with project selection, architecture planning, implementation review, debugging, test design, and documentation drafting. Suggested changes were reviewed against the repository requirements and the available verification gates. The official Midnight bulletin-board example provided the upstream scaffold and provider integration baseline.
Known limitations
- The browser private-state provider is in memory for the hackathon demonstration. Refreshing or closing the page can remove access to owner-only actions.
- The minimum viable product supports one active pledge per contract.
- Pledge text is intentionally public and must not contain confidential information.
- Full operation depends on the configured wallet, proof server, indexer, and Midnight network services.
Log in or sign up for Devpost to join the conversation.