Skip to content

Commit ea473a2

Browse files
committed
readme style adapted to the style of other crates readmes
1 parent b249a8f commit ea473a2

File tree

2 files changed

+51
-33
lines changed

2 files changed

+51
-33
lines changed

mithril-stm/README.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,59 @@
1-
Mithril-stm ![CI workflow](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml/badge.svg) ![crates.io](https://img.shields.io/crates/v/mithril_stm.svg)
2-
=======
1+
# Mithril-stm ![CI workflow](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml/badge.svg) ![crates.io](https://img.shields.io/crates/v/mithril_stm.svg)
32

4-
### A rust implementation of Stake-based Threshold Multisignatures (STMs)
5-
`mithril-stm` implements Stake-based Threshold Multisignatures as described in the paper
6-
[Mithril: Stake-based Threshold Multisignatures](https://eprint.iacr.org/2021/916.pdf), by
7-
Pyrros Chaidos and Aggelos Kiayias.
83

9-
This library uses zkcrypto's implementation of curve [BLS12-381](https://github.com/zkcrypto/bls12_381)
10-
by default for implementing the multisignature scheme. One can optionally choose the
11-
[blst](https://github.com/supranational/blst) backend (by using the feature `blast`),
12-
but this is not recommended due to some [flaky tests](https://github.com/input-output-hk/mithril/issues/207)
13-
That are still being resolved. We
14-
currently only support the trivial concatenation proof system (Section 4.3) and do not support
15-
other proof systems such as Bulletproofs or Halo2.
4+
**This is a work in progress** :hammer_and_wrench:s
165

17-
This library provides implementations of:
6+
* `mithril-stm` is a Rust implementation of the scheme described in the paper [Mithril: Stake-based Threshold Multisignatures](https://eprint.iacr.org/2021/916.pdf) by Pyrros Chaidos and Aggelos Kiayias.
7+
* The BLS12-381 signature library [blst](https://github.com/supranational/blst) is used as the backend for the implementation of STM.
8+
* This implementation supports the _trivial concatenation proof system_ (Section 4.3). Other proof systems such as _Bulletproofs_ or _Halo2_ are not supported in this version.
9+
* We implemented the concatenation proof system as batch proofs, which provides a remarkable decrease in the size of individual signatures.
10+
* Protocol documentation is given in [Mithril Protocol in depth](https://mithril.network/doc/mithril/mithril-protocol/protocol/).
1811

19-
* Stake-based Threshold Multisignatures
20-
* Key registration procedure for STM signatures
2112

22-
The user-facing documentation for the above modules can be found [here]().
13+
* This library provides:
14+
* The implementation of the Stake-based Threshold Multisignatures
15+
* Key registration procedure for STM signatures
16+
* The tests for the library functions and STM scheme
17+
* Benchmark tests
2318

19+
## Pre-requisites
2420

25-
Disclaimer
26-
=======
27-
This crate is ongoing work, has not been audited, and it's API is by no means final. Do not use in production.
21+
**Install Rust**
2822

23+
* Install a [correctly configured](https://www.rust-lang.org/learn/get-started) Rust toolchain (latest stable version).
24+
* Install Rust [Clippy](https://github.com/rust-lang/rust-clippy) component.
25+
26+
## Download source code
27+
28+
```bash
29+
# Download sources from github
30+
git clone https://github.com/input-output-hk/mithril
31+
32+
# Go to sources directory
33+
cd mithril-stm
34+
```
35+
36+
## Compiling the library
37+
```shell
38+
cargo build --release
39+
```
40+
41+
## Running the tests
42+
For running rust tests, simply run (to run the tests faster, the use of `--release` flag is recommended):
43+
```shell
44+
cargo test --release
45+
```
46+
47+
## Running the benches
48+
```shell
49+
cargo bench
50+
```
51+
52+
53+
## Example
54+
55+
The following is a simple example of the STM implementation:
2956

30-
# Example
3157
```rust
3258
use mithril_stm::key_reg::KeyReg;
3359
use mithril_stm::stm::{StmClerk, StmInitializer, StmParameters, StmSig, StmSigner};
@@ -112,17 +138,13 @@ fn test_full_protocol() {
112138
}
113139
}
114140
}
115-
116141
```
117142

118-
# Test and Benchmarks
119-
You can run tests of the library using `cargo test` (we recommend to use the `--release` flag, otherwise
120-
the tests might take a while) and run benchmarks using `cargo bench`. This crate uses `criterion` to run
121-
benchmarks.
143+
## Benchmarks
122144

123-
We have run the benchmarks on an Apple M1 Pro machine with 16 GB of RAM, on macOS 12.6.
145+
Here we give the benchmark results of STM for size and time. We run the benchmarks on macOS 12.6 on an Apple M1 Pro machine with 16 GB of RAM.
124146

125-
> Note that single signatures in batch compat version does not depend on any variable and <mark> the size of an individual signature is 176 bytes. </mark>
147+
Note that single signatures in batch compatible version do not depend on any variable and **the size of an individual signature is 176 bytes**.
126148

127149
```shell
128150
+----------------------+
@@ -173,4 +195,3 @@ STM/Blake2b/Aggregation/k: 250, m: 1523, nr_parties: 2000
173195
STM/Blake2b/Verification/k: 250, m: 1523, nr_parties: 2000
174196
time: [13.944 ms 14.010 ms 14.077 ms]
175197
```
176-

mithril-stm/src/multi_sig.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! Base multisignature scheme, used as a primitive for STM.
22
//! See Section 2.4 of [the paper](https://eprint.iacr.org/2021/916).
3-
//! This module uses the `blst` library as a backend for pairings
4-
//! and can be activated by using the feature `blast`. This feature
5-
//! is not chosen by default due to some flaky tests, as exposed in the
6-
//! [issue](https://github.com/input-output-hk/mithril/issues/207)
3+
//! This module uses the `blst` library as a backend for pairings.
74
85
use crate::error::{blst_err_to_atms, MultiSignatureError};
96
use crate::stm::Index;

0 commit comments

Comments
 (0)