Skip to main content
For the complete documentation index, see llms.txt

Examples

Working Compact contract examples and full DApps. Each example demonstrates a specific feature or pattern.

Browse by type​

Find an example by feature​

Not sure which example to start from? Pick the feature or problem you are trying to solve from the dropdown, and the matrix highlights the example DApps and contracts that demonstrate it. You can also narrow the grid to just DApps or just contracts. Every example links straight to its documentation.

Each column is a documented example (a full DApp or a standalone contract) and each row is a Compact or Midnight feature. A Demonstrated marker means the example shows that feature, and an empty cell means the example does not cover it.

Show
Feature / problemCalculatorToken transfersPrivate guest listElectionPrivate reserve auctionBattleshipLeaderboardZK Loan
Witness functions (private inputs)DemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Private stateDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Public ledger stateDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Privacy boundary (disclose)DemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
On-chain verification of off-chain computeDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Access control to circuitsDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Ledger CounterDemonstratedDemonstratedDemonstratedDemonstrated
Ledger SetDemonstratedDemonstratedDemonstrated
Ledger MapDemonstratedDemonstratedDemonstrated
Ledger ListDemonstrated
Sealed ledger fieldsDemonstratedDemonstratedDemonstrated
Opaque string on the ledgerDemonstrated
DApp-specific public keys (untrackable identity)DemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Commitments and persistent hashingDemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
ZK proof of identity without revealing itDemonstratedDemonstrated
In-circuit signature verificationDemonstrated
Native token (NIGHT) operationsDemonstratedDemonstrated
Shielded token operationsDemonstrated
Intermediate witnessesDemonstrated
Explicit state machine (enums)DemonstratedDemonstratedDemonstratedDemonstratedDemonstrated
Multi-step approval or turn flowDemonstratedDemonstrated
CLI toolingDemonstrated
Web UIDemonstratedDemonstrated
Wallet and proof server integrationDemonstratedDemonstrated
Demonstrated Not covered DApp Contract
note

This matrix covers the examples that have published documentation. When a new example is added to the docs, add it here too: coverage data lives in src/components/CoverageMatrix/data.jsx. To contribute a new example, see the contributing guide.