#miden #rollup #transaction #interaction #facilitate #store #blockchain

no-std bin+lib miden-client

Client library that facilitates interaction with the Miden rollup

5 unstable releases

0.3.1 May 22, 2024
0.3.0 May 16, 2024
0.2.1 Apr 25, 2024
0.2.0 Apr 15, 2024
0.1.0 Mar 15, 2024

#1760 in Magic Beans

Download history 103/week @ 2024-03-13 51/week @ 2024-03-20 67/week @ 2024-03-27 444/week @ 2024-04-03 467/week @ 2024-04-10 163/week @ 2024-04-17 389/week @ 2024-04-24 169/week @ 2024-05-01 181/week @ 2024-05-08 355/week @ 2024-05-15 238/week @ 2024-05-22 125/week @ 2024-05-29

924 downloads per month
Used in miden-faucet

MIT license

415KB
8K SLoC

Miden client

LICENSE CI 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.
  • miden-client binary which is a wrapper around the library exposing its functionality via a simple command-line interface (CLI).

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:

Usage

Before you can use the Miden client, you'll need to make sure you have both Rust and sqlite3 installed. Miden client requires rust version 1.78 or higher.

Adding miden-client as a dependency

In order to utilize the miden-client library, you can add the dependency to your project's Cargo.toml file:

miden-client = { version = "0.3" }

Features

  • concurrent: used to enable concurrent proofs generation
  • testing: useful feature that lowers PoW difficulty when enabled. Only use this during development and not on production.

Running miden-client's CLI

You can either build from source with:

cargo build --release

Once the binary is built, you can find it on ./target/release/miden.

Or you can install the CLI from crates-io with:

cargo install miden-client

Note that binary name for the client is just miden.

Makefile

As mentioned before, we use cargo-make to encapsulate some tasks, such as running lints and tests. You can check out Makefile.toml for all available tasks.

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

The crate also comes with 2 feature flags that are used exclusively on tests:

  • test_utils: used on unit tests to use the mocked RPC API.
  • integration: only used to run integration tests and separate them from unit tests

Contributing

Interested in contributing? Check CONTRIBUTING.md.

License

This project is MIT licensed.

Dependencies

~57MB
~1M SLoC