MCPcopy Index your code
hub / github.com/0xMiden/protocol

github.com/0xMiden/protocol @v0.15.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.15.3 ↗ · + Follow
4,537 symbols 21,246 edges 408 files 2,204 documented · 49%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Miden protocol

LICENSE test build RUST_VERSION GitHub Release

Description and core structures for the Miden Rollup protocol.

WARNING: This project is in an alpha stage. It has not been audited and may contain bugs and security flaws. This implementation is NOT ready for production use.

Overview

Miden is a zero-knowledge rollup for high-throughput and private applications. Miden allows users to execute and prove transactions locally (i.e., on their devices) and commit only the proofs of the executed transactions to the network.

If you want to join the technical discussion or learn more about the project, please check out

Status and features

Miden is currently on release v0.13. This is an early version of the protocol and its components. We expect to keep making changes (including breaking changes) to all components.

Feature highlights

  • Private accounts. The Miden Operator tracks only commitments to account data in the public database. The users are responsible for keeping track of the state of their accounts.
  • Public accounts. With public accounts, users are able to store the entire state of their accounts on-chain, thus, eliminating the need to keep track of account states locally (albeit by sacrificing privacy and at a higher cost).
  • Private notes. Like with private accounts, the Miden Operator tracks only commitments to notes in the public database. Users need to communicate note details to each other via side channels.
  • Public notes. With public notes, users are able to store all note details on-chain, thus, eliminating the need to communicate note details via side-channels.
  • Local transactions. Users can execute and prove transactions locally on their devices. The Miden Operator verifies the proofs and if the proofs are valid, updates the state of the rollup accordingly.
  • Standard account. Users can create accounts using a small number of standard account interfaces (e.g., basic wallet). In the future, the set of standard smart contracts will be expanded.
  • Standard notes. Users can create notes using standardized note scripts such as Pay-to-ID (P2ID) and atomic swap (SWAP). In the future, the set of standardized notes will be expanded.
  • Delegated note inclusion proofs. By delegating note inclusion proofs, users can create chains of dependent transactions which are included into a block as a single batch.
  • Transaction recency conditions. Users are able to specify how close to the chain tip their transactions are to be executed. This enables things like rate limiting and oracles.
  • Network transactions. Users are able to create notes intended for network execution. Such notes are included into transactions executed and proven by the Miden operator.

Planned features

  • Encrypted notes. With encrypted notes users will be able to put all note details on-chain, but the data contained within the notes would be encrypted with the recipient's key.

Project structure

Crate Description
miden-protocol Contains core components defining the Miden protocol, including the transaction kernel.
miden-standards Contains the code of Miden's standardized smart contracts.
miden-tx Contains tools for creating, executing, and proving Miden rollup transactions.
bench-tx Contains transaction execution and proving benchmarks.

Make commands

We use make to automate building, testing, and other processes. In most cases, make commands are just wrappers around cargo commands with specific arguments. You can view the list of available commands in the Makefile, or just run the following command:

make

Testing

To test the crates contained in this repo you can use Make to run the following command present in our Makefile:

make test

Some of the functions in this project are computationally intensive and may take a significant amount of time to compile and complete during testing. To ensure optimal results we use the make test command. It enables the running of tests in release mode and using specific configurations replicates the test conditions of the development mode and verifies all debug assertions.

Documentation

The documentation in the docs/ folder is built using Docusaurus and is automatically absorbed into the main miden-docs repository for the main documentation website. Changes to the next branch trigger an automated deployment workflow. The docs folder requires npm packages to be installed before building.

License

This project is MIT licensed

Extension points exported contracts — how you extend this code

FeltType (Interface)
Trait for converting a string into a single `Felt`. [9 implementers]
crates/miden-protocol/src/account/component/storage/type_registry.rs
TransactionAuthenticator (Interface)
Defines an authenticator for transactions. The main purpose of the authenticator is to generate signatures for a given [3 …
crates/miden-tx/src/auth/tx_authenticator.rs
MockAccountCodeExt (Interface)
Extension trait for [`AccountCode`] to access the mock libraries. [1 implementers]
crates/miden-standards/src/testing/mock_account_code.rs
MockChainBlockExt (Interface)
Provides convenience methods for testing. [1 implementers]
crates/miden-testing/src/kernel_tests/block/utils.rs
GlobalIndexExt (Interface)
(no doc) [1 implementers]
crates/miden-agglayer/src/eth_types/global_index.rs
WordType (Interface)
Trait for converting a string into a single `Word`. [3 implementers]
crates/miden-protocol/src/account/component/storage/type_registry.rs
DataStore (Interface)
The [DataStore] trait defines the interface that transaction objects use to fetch data required for transaction executio [1 …
crates/miden-tx/src/executor/data_store.rs
MockAccountExt (Interface)
Extension trait for [`Account`]s that return mocked accounts. [1 implementers]
crates/miden-standards/src/testing/mock_account.rs

Core symbols most depended-on inside this repo

id
called by 1297
crates/miden-testing/src/mock_chain/note.rs
clone
called by 1200
crates/miden-standards/src/note/mod.rs
build
called by 491
crates/miden-testing/src/tx_context/builder.rs
execute
called by 401
crates/miden-testing/src/tx_context/context.rs
build
called by 374
crates/miden-testing/src/kernel_tests/batch/proven_tx_builder.rs
map
called by 365
crates/miden-protocol/src/account/component/storage/schema/slot.rs
build_tx_context
called by 320
crates/miden-testing/src/mock_chain/chain.rs
to_commitment
called by 265
crates/miden-tx/src/auth/tx_authenticator.rs

Shape

Method 2,705
Function 1,371
Class 309
Enum 133
Interface 19

Languages

Rust100%
TypeScript1%

Modules by API surface

crates/miden-testing/src/mock_chain/chain.rs61 symbols
crates/miden-standards/src/note/pswap.rs50 symbols
crates/miden-protocol/src/account/delta/storage.rs46 symbols
crates/miden-protocol/src/account/component/storage/type_registry.rs45 symbols
crates/miden-testing/src/standards/token_metadata.rs43 symbols
crates/miden-testing/tests/scripts/rbac.rs42 symbols
crates/miden-standards/src/account/auth/guarded_multisig.rs41 symbols
crates/miden-protocol/src/errors/mod.rs41 symbols
crates/miden-standards/src/account/policies/manager.rs40 symbols
crates/miden-protocol/src/note/attachment/mod.rs39 symbols
crates/miden-standards/src/code_builder/mod.rs38 symbols
crates/miden-protocol/src/transaction/proven_tx.rs37 symbols

For agents

$ claude mcp add protocol \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact