@@ -5,12 +5,12 @@ This crate is ongoing work, has not been audited, and it's API is by no means fi
5
5
### A rust implementation of Stake-based Threshold Multisignatures (STMs)
6
6
` mithril-core ` implements Stake-based Threshold Multisignatures as described in the paper
7
7
[ Mithril: Stake-based Threshold Multisignatures] ( https://eprint.iacr.org/2021/916.pdf ) , by
8
- Pyrros Chaidos and Aggelos Kiayias.
8
+ Pyrros Chaidos and Aggelos Kiayias.
9
9
10
10
This library uses zkcrypto's implementation of curve [ BLS12-381] ( https://github.com/zkcrypto/bls12_381 )
11
- by default for implementing the multisignature scheme. One can optionally choose the
12
- [ blst] ( https://github.com/supranational/blst ) backend (by using the feature ` blast ` ),
13
- but this is not recommended due to some [ flaky tests] ( https://github.com/input-output-hk/mithril/issues/207 )
11
+ by default for implementing the multisignature scheme. One can optionally choose the
12
+ [ blst] ( https://github.com/supranational/blst ) backend (by using the feature ` blast ` ),
13
+ but this is not recommended due to some [ flaky tests] ( https://github.com/input-output-hk/mithril/issues/207 )
14
14
That are still being resolved. We
15
15
currently only support the trivial concatenation proof system (Section 4.3) and do not support
16
16
other proof systems such as Bulletproofs or Halo2.
@@ -90,7 +90,7 @@ fn main() {
90
90
91
91
// Aggregate with random parties
92
92
let msig = clerk . aggregate (& sigs , & msg );
93
-
93
+
94
94
assert! (msig . is_ok (), " aggregation failed" );
95
95
assert! (msig . unwrap (). verify (& msg , & clerk . compute_avk (), & params ). is_ok ());
96
96
}
@@ -101,53 +101,85 @@ You can run tests of the library using `cargo test` (we recommend to use the `--
101
101
the tests might take a while) and run benchmarks using ` cargo bench ` . This crate uses ` criterion ` to run
102
102
benchmarks.
103
103
104
- We have run the benchmarks on a 2,7 GHz Quad-Core Intel Core i7 machine with 16 GB of RAM, on macOS 12.1.
104
+ We have run the benchmarks on an Apple M1 Pro machine with 16 GB of RAM, on macOS 12.6.
105
+
106
+ Note that single signatures in batch compat version does not depend on any variable and size of an individual signature is ` 176 ` bytes.
105
107
106
108
``` shell
107
- +-------------------+
108
- | Size of proofs |
109
- +-------------------+
110
- | -------------------|
111
- | Trivial proofs |
112
- +-------------------+
109
+ +----------------------+
110
+ | Size of benchmarks |
111
+ +----------------------+
113
112
| Results obtained by using the parameters suggested in paper.
114
- +-------------------+
115
- +-------------------+
116
- | Hash: Blake2b 512 |
117
- +-------------------+
118
- k = 445 | m = 2728 | nr parties = 3000; 118760 bytes
119
- +-------------------+
120
- | Hash: Blake2b 256 |
121
- +-------------------+
122
- k = 445 | m = 2728 | nr parties = 3000; 99384 bytes
123
- +-------------------+
124
- | Hash: Blake2b 512 |
125
- +-------------------+
126
- k = 554 | m = 3597 | nr parties = 3000; 133936 bytes
127
- +-------------------+
128
- | Hash: Blake2b 256 |
129
- +-------------------+
130
- k = 554 | m = 3597 | nr parties = 3000; 113728 bytes
113
+ +----------------------+
114
+ +----------------------+
115
+ | Aggregate signatures |
116
+ +----------------------+
117
+ +----------------------+
118
+ | Hash: Blake2b 512 |
119
+ +----------------------+
120
+ k = 445 | m = 2728 | nr parties = 3000; 118760 bytes (old version = 356632 bytes)
121
+ +----------------------+
122
+ | Hash: Blake2b 256 |
123
+ +----------------------+
124
+ k = 445 | m = 2728 | nr parties = 3000; 99384 bytes (old version = 222536 bytes)
125
+ +----------------------+
126
+ +----------------------+
127
+ | Aggregate signatures |
128
+ +----------------------+
129
+ | Hash: Blake2b 512 |
130
+ +----------------------+
131
+ k = 554 | m = 3597 | nr parties = 3000; 133936 bytes (old version = 419808 bytes)
132
+ +----------------------+
133
+ | Hash: Blake2b 256 |
134
+ +----------------------+
135
+ k = 554 | m = 3597 | nr parties = 3000; 113728 bytes (old version = 261488 bytes)
136
+ make build && ./mithrildemo --nparties 16 -k 5 -m 5 --phi-f 0.9
137
+
131
138
```
132
139
133
140
``` shell
134
141
STM/Blake2b/Key registration/k: 25, m: 150, nr_parties: 300
135
- time: [388.95 ms 389.43 ms 389.90 ms]
142
+ time: [409.70 ms 426.81 ms 446.30 ms]
143
+ change: [+2.3183% +7.5525% +13.315%] (p = 0.02 < 0.05)
144
+ Performance has regressed.
145
+
136
146
STM/Blake2b/Play all lotteries/k: 25, m: 150, nr_parties: 300
137
- time: [699.76 µs 701.42 µs 703.63 µs]
147
+ time: [696.58 µs 697.62 µs 698.75 µs]
148
+ change: [-1.1128% -0.8545% -0.5490%] (p = 0.00 < 0.05)
149
+ Change within noise threshold.
150
+
138
151
STM/Blake2b/Aggregation/k: 25, m: 150, nr_parties: 300
139
- time: [18.888 ms 18.903 ms 18.920 ms]
152
+ time: [18.765 ms 18.775 ms 18.785 ms]
153
+ change: [-1.5665% -1.4456% -1.3236%] (p = 0.00 < 0.05)
154
+ Performance has improved.
155
+
140
156
STM/Blake2b/Verification/k: 25, m: 150, nr_parties: 300
141
- time: [2.1547 ms 2.1609 ms 2.1686 ms]
157
+ time: [2.1577 ms 2.1715 ms 2.1915 ms]
158
+ change: [-0.0379% +0.5723% +1.6451%] (p = 0.14 > 0.05)
159
+ No change in performance detected.
160
+
142
161
143
162
STM/Blake2b/Key registration/k: 250, m: 1523, nr_parties: 2000
144
- time: [2.5986 s 2.6042 s 2.6101 s]
163
+ time: [2.5807 s 2.5880 s 2.5961 s]
164
+ change: [-1.7298% -0.2763% +0.7870%] (p = 0.78 > 0.05)
165
+ No change in performance detected.
166
+
145
167
STM/Blake2b/Play all lotteries/k: 250, m: 1523, nr_parties: 2000
146
- time: [5.9141 ms 5.9346 ms 5.9641 ms]
168
+ time: [5.9318 ms 5.9447 ms 5.9582 ms]
169
+ change: [+1.1467% +1.4105% +1.6686%] (p = 0.00 < 0.05)
170
+ Performance has regressed.
171
+
147
172
STM/Blake2b/Aggregation/k: 250, m: 1523, nr_parties: 2000
148
- time: [189.63 ms 190.10 ms 190.69 ms]
173
+ time: [190.81 ms 191.15 ms 191.54 ms]
174
+ change: [-0.2176% +0.0444% +0.3235%] (p = 0.82 > 0.05)
175
+ No change in performance detected.
176
+
149
177
STM/Blake2b/Verification/k: 250, m: 1523, nr_parties: 2000
150
- time: [14.040 ms 14.143 ms 14.271 ms]
178
+ time: [13.944 ms 14.010 ms 14.077 ms]
179
+ change: [-1.0844% -0.6175% -0.0397%] (p = 0.03 < 0.05)
180
+ Change within noise threshold.
181
+
182
+
151
183
```
152
184
153
185
# ToDo list once we go public
0 commit comments