Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Miden game that showcases (almost) all Miden features

Open
#97 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

The issue describes a comprehensive example application for the Miden book. Start by reviewing the existing Miden tutorials and book structure to understand the current content. Examine the Miden concepts listed (private/public accounts, notes, NFTs, smart contracts, nullifiers) and see how they are currently explained. The goal is to design a tutorial that incrementally builds an Avalon-like game, so outline the chapters and map each to existing Miden examples and code.

Written by the indexing model from the issue text.

Description

Miden book - example application

So my current idea for the Miden book would be to merge the tutorial and the protocol sections into one section.

I took my inspiration from the Rust book. So ideally, we also have the user to build an application that incrementally gets more complex by adding more and more features. Until all main Miden features are explained conceptually and with code examples. Ideally, we have the midenup command already. But the the structure should not change much.

I am not sure yet which application we want the user to build. But I have one suggestion.

Suggestion - Avalon like game

We could let users build a simple game - like Avalon. This will let the user learn all Miden concepts, I believe. And it shows Miden's hybrid approach of private and public transactions and state.

Avalon - Game Flow

See here for a game explainer

  1. Game Setup
  • Each player deploys a private account (stores their personal state) and generates a secret s.
  • A public game account is initialized.
  • Each player registers his identity commitment (=H(s)) in a StorageMap of the public account.
  1. Role Assignment
  • An oracle assigns secret roles (seeded from randomness).
  • Each player receives their role as a private note (NFT) from the game account. There are traitors and knights.
  1. Team Proposals (Round-based)
  • A player proposes a team for the mission (a set of N selected players) to the game account (direct execution).
  • Other players approve or reject the proposal via a network note to the game account.
  • If the proposal passes:
    • A new missionID is assigned
    • The selected players' commitments are collected into a new Merkle tree (root stored as missionRoot in the game account)
    • The game account emits N VotingSwapNotes with missionRoot
  • If three proposals fail in a row, the traitors win.
  1. Mission Execution (Semaphore Voting)
  • Each selected player creates a new private account locally (to break linkability).
  • Each selected player consumes one VotingSwapNote with the new private account. That automatically creates
    • A network note voteNote back to the game account that includes the players vote and nullifier = H(secret || missionID).
    • Consumption fails, if the player cannot prove his identity commitment is in the missionRoot
  1. Mission reveal:
  • Game account consumes all voteNote checking that each nullifier has not been used before.
  • Updates the mission vote tally (successCount / failCount). As each vote arrives, the game account only updates the aggregate tally.
  • Once all votes are in, the game account determines mission success or failure based on the fail count.
  1. Endgame
  • After 5 missions (3 wins needed to succeed), the game ends.
  • The game account determines the winning team.
Miden learnings

In building this game, builders would learn a lot of Miden concepts and use the Rust and the WebClient.

Chapter Goal Miden Concepts
Game setup Account creation Private and public accounts, clients
Role Assignment Send private notes to players Notes, oracle, FPI, NFTs
Team proposals Simple public smart contract interaction Network notes, custom notes and smart contracts
Mission Execution Private smart contract interaction Custom note swap logic, nullifiers, note tags and recipient logic
Mission Reveal Autonomous smart contracts Complex smart contract logic
From Rust to Web Rust client and WebClient interaction Frontend integration, wallet adapter
Dominant language
Rust
Stars
18
Forks
34
Avg merge
4d 18h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 0xMiden/tutorials

All issues in 0xMiden/tutorials

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.