Skip to content

[Tutorial] Witnesses in Depth: Patterns, Types, and Real Use Cases #291

@Olanetsoft

Description

@Olanetsoft

Type of Content

Tutorial

Summary

Deep dive into witness functions: what they are (off-chain computation that feeds into the ZK circuit), how they differ from circuit logic, common patterns (secret key verification, division with remainder, external data ingestion), and real use cases from existing Midnight dApps. Show the witness-verified division pattern and witness-based access control.

Target Audience

Developers

Deliverables

  1. Written tutorial (2,500-3,500 words) covering:

    • What witnesses are: off-chain computation feeding into the ZK circuit
    • How witnesses differ from circuit logic
    • Common patterns: secret key verification, division with remainder, external data ingestion
    • Witness-verified division pattern
    • Witness-based access control
    • Real use cases from existing Midnight dApps
  2. Working code examples for each pattern

Requirements:

Relevant Links

Submission Process

This is an Eclipse bounty. Bounties are not first-come, first-served. Anyone can submit. The best valid submission wins.

  1. Work on your submission independently.
  2. Share your published link in this issue thread.
  3. When ready, comment "Ready for review" explicitly.
  4. One review cycle: feedback, revision, approve or reject.

Publishing: Dev.to is the default platform for blog posts and tutorials. Some contributions may also go directly into the Midnight docs. Other platforms (Medium, Hashnode, personal blog) work too.

Promotion: Share on X/LinkedIn with #MidnightforDevs and tag @midnightntwrk.

Policies

AI-Generated Content: Submissions are checked for AI content. Substantially AI-generated work will be disqualified.

Code Must Compile: Any Compact code must compile. Non-compiling code means immediate disqualification.

Terms: By submitting, you agree to the Bounty Program Terms. Payouts in NIGHT tokens after KYC via SumSub.

Tier 2 (Medium) - $500-$700 (paid in NIGHT tokens)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions