> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Examples

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

## Browse by type[​](#browse-by-type "Direct link to Browse by type")

[✦](https://docs.midnight.network/examples/contracts.md)

### [Contracts](https://docs.midnight.network/examples/contracts.md)

[Standalone Compact contracts that isolate specific language features like witness functions, assertions, and on-chain verification.](https://docs.midnight.network/examples/contracts.md)

[Browse contracts→](https://docs.midnight.network/examples/contracts.md)

[✦](https://docs.midnight.network/examples/dapps.md)

### [DApps](https://docs.midnight.network/examples/dapps.md)

[Complete DApps with contract code, TypeScript integration, and deployment steps you can use as a starting point for your own project.](https://docs.midnight.network/examples/dapps.md)

[Browse DApps→](https://docs.midnight.network/examples/dapps.md)

## Find an example by feature[​](#find-an-example-by-feature "Direct link to 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.

Browse by feature or problem

All features (all)

Show

AllDAppsContracts

| Feature / problem                                | [Calculator](https://docs.midnight.network/examples/contracts/calculator.md) | [Token transfers](https://docs.midnight.network/examples/contracts/token-transfers.md) | [Private guest list](https://docs.midnight.network/examples/contracts/private-guest-list.md) | [Election](https://docs.midnight.network/examples/contracts/election.md) | [Private reserve auction](https://docs.midnight.network/examples/contracts/private-reserve-auction.md) | [Battleship](https://docs.midnight.network/examples/contracts/battleship-simple.md) | [Leaderboard](https://docs.midnight.network/examples/dapps/leaderboard.md) | [ZK Loan](https://docs.midnight.network/examples/dapps/zkloan.md) |
| ------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Witness functions (private inputs)               | Demonstrated                                                                 |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               | Demonstrated                                                      |
| Private state                                    |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               | Demonstrated                                                      |
| Public ledger state                              | Demonstrated                                                                 |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               | Demonstrated                                                      |
| Privacy boundary (disclose)                      | Demonstrated                                                                 | Demonstrated                                                                           | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               | Demonstrated                                                      |
| On-chain verification of off-chain compute       | Demonstrated                                                                 |                                                                                        |                                                                                              | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        |                                                                            | Demonstrated                                                      |
| Access control to circuits                       |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        |                                                                            | Demonstrated                                                      |
| Ledger Counter                                   |                                                                              |                                                                                        |                                                                                              | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               |                                                                   |
| Ledger Set                                       |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             |                                                                                                        | Demonstrated                                                                        |                                                                            |                                                                   |
| Ledger Map                                       |                                                                              |                                                                                        |                                                                                              | Demonstrated                                                             | Demonstrated                                                                                           |                                                                                     | Demonstrated                                                               |                                                                   |
| Ledger List                                      |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        | Demonstrated                                                                        |                                                                            |                                                                   |
| Sealed ledger fields                             |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           |                                                                                     |                                                                            |                                                                   |
| Opaque string on the ledger                      |                                                                              |                                                                                        |                                                                                              | Demonstrated                                                             |                                                                                                        |                                                                                     |                                                                            |                                                                   |
| DApp-specific public keys (untrackable identity) |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        |                                                                            | Demonstrated                                                      |
| Commitments and persistent hashing               |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        | Demonstrated                                                               |                                                                   |
| ZK proof of identity without revealing it        |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        |                                                                                     | Demonstrated                                                               | Demonstrated                                                      |
| In-circuit signature verification                |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        |                                                                                     |                                                                            | Demonstrated                                                      |
| Native token (NIGHT) operations                  |                                                                              | Demonstrated                                                                           | Demonstrated                                                                                 |                                                                          |                                                                                                        |                                                                                     |                                                                            |                                                                   |
| Shielded token operations                        |                                                                              | Demonstrated                                                                           |                                                                                              |                                                                          |                                                                                                        |                                                                                     |                                                                            |                                                                   |
| Intermediate witnesses                           |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        | Demonstrated                                                                        |                                                                            |                                                                   |
| Explicit state machine (enums)                   |                                                                              |                                                                                        | Demonstrated                                                                                 | Demonstrated                                                             | Demonstrated                                                                                           | Demonstrated                                                                        |                                                                            | Demonstrated                                                      |
| Multi-step approval or turn flow                 |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        | Demonstrated                                                                        |                                                                            | Demonstrated                                                      |
| CLI tooling                                      |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        |                                                                                     |                                                                            | Demonstrated                                                      |
| Web UI                                           |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        |                                                                                     | Demonstrated                                                               | Demonstrated                                                      |
| Wallet and proof server integration              |                                                                              |                                                                                        |                                                                                              |                                                                          |                                                                                                        |                                                                                     | Demonstrated                                                               | Demonstrated                                                      |

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](https://github.com/midnightntwrk/midnight-docs/blob/main/CONTRIBUTING.md).
