MCPcopy Index your code
hub / github.com/0xMiden/rust-sdk

github.com/0xMiden/rust-sdk @v0.15.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.15.3 ↗ · + Follow
2,229 symbols 10,679 edges 201 files 931 documented · 42%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Miden client

LICENSE test build RUST_VERSION crates.io

This repository contains the Miden client, which provides a way to execute and prove transactions, facilitating the interaction with the Miden rollup.

Status

The Miden client is still under heavy development and the project can be considered to be in an alpha stage. Many features are yet to be implemented and there is a number of limitations which we will lift in the near future.

Overview

The Miden client currently consists of two components:

  • miden-client library, which can be used by other project to programmatically interact with the Miden rollup. You can find more information about the library in the Rust client Library section.
  • miden-client-cli, which is a wrapper around the library exposing its functionality via a simple command-line interface (CLI). You can find more information about the CLI in the Miden client CLI section.

The browser-focused SDK (@miden-sdk/miden-sdk, the React hooks library @miden-sdk/react, and the @miden-sdk/vite-plugin) lives in a dedicated repository at 0xMiden/web-sdk.

The client's main responsibility is to maintain a partial view of the blockchain which allows for locally executing and proving transactions. It keeps a local store of various entities that periodically get updated by syncing with the node.

For more info check:

Workspace structure

The workspace is organized as follows: - The bin folder contains crates that are meant to be compiled into binaries (like the CLI). - The crates folder contains the library crates that are meant to be used as dependencies (like the Rust client library).

Makefile

We use make to encapsulate some tasks, such as running lints and tests. You can check out Makefile for all available tasks or just run the following command:

make

Testing

To test the project's code, we provide both unit tests (which can be run with cargo test) and integration tests. For more info on integration tests, refer to the integration testing document

Contributing

Interested in contributing? Check CONTRIBUTING.md.

License

This project is MIT licensed.

Extension points exported contracts — how you extend this code

NoteStateHandler (Interface)
(no doc) [9 implementers]
crates/rust-client/src/store/note_record/input_note_record/states/mod.rs
ClientBuilderSqliteExt (Interface)
Extends the [`ClientBuilder`] with a method to add a [`SqliteStore`]. [1 implementers]
crates/sqlite-store/src/builder.rs
OnNoteReceived (Interface)
(no doc) [5 implementers]
crates/rust-client/src/sync/state_sync.rs
SqlResultExt (Interface)
(no doc) [1 implementers]
crates/sqlite-store/src/sql_error.rs
NoteStream (Interface)
Stream trait for note streaming [2 implementers]
crates/rust-client/src/note_transport/mod.rs
TransactionProver (Interface)
(no doc) [4 implementers]
crates/rust-client/src/transaction/prover.rs
ClientFeltRng (Interface)
Marker trait for RNGs that can be shared across threads and used by the client. [1 implementers]
crates/rust-client/src/lib.rs

Core symbols most depended-on inside this repo

id
called by 798
crates/rust-client/src/rpc/domain/note.rs
clone
called by 747
crates/rust-client/src/keystore/fs_keystore.rs
sync_state
called by 274
crates/rust-client/src/sync/mod.rs
into_store_error
called by 247
crates/sqlite-store/src/sql_error.rs
push
called by 216
crates/rust-client/src/transaction/batch/mod.rs
rng
called by 156
crates/rust-client/src/lib.rs
get
called by 148
crates/rust-client/src/store/data_store/mod.rs
build
called by 134
crates/rust-client/src/builder.rs

Shape

Method 1,115
Function 821
Class 192
Enum 85
Interface 16

Languages

Rust99%
TypeScript1%

Modules by API surface

crates/testing/miden-client-tests/src/tests.rs78 symbols
crates/sqlite-store/src/lib.rs61 symbols
bin/miden-cli/tests/cli.rs59 symbols
crates/rust-client/src/sync/state_sync_update.rs56 symbols
crates/rust-client/src/sync/state_sync.rs55 symbols
crates/rust-client/src/rpc/tonic_client/mod.rs55 symbols
crates/rust-client/src/pswap/lineage.rs48 symbols
crates/rust-client/src/rpc/domain/account.rs42 symbols
crates/rust-client/src/note/note_update_tracker.rs42 symbols
crates/rust-client/src/test_utils/mock.rs40 symbols
crates/rust-client/src/transaction/mod.rs39 symbols
crates/rust-client/src/transaction/request/builder.rs38 symbols

For agents

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

⬇ download graph artifact