Skip to content

Commit

Permalink
📝 Add benchmark docs and images.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheagrief committed Sep 5, 2024
1 parent c564327 commit 96b7c68
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/benchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 1. MPC Calculation

## Preprocessing phase
Groth16: 1.5s

Marlin: 10s


## Online phase

run_online.zsh(Marlin): 7s

Since proving and verifying time of ciruits are depends on the number of constrains, and the way it depends is roughly the same as in the previous study, Collaboative zk-SNARKs, only the number of constrains will be recorded here.

For example, when the constraints $\approx 2^{10}$ and executing in Marlin, then the Proving time $\approx 2$s as follows.

![image](./../images/constraints-times.png)
cited from [Collaborative zk-SNARKs](https://eprint.iacr.org/2021/1530).


## MPC (Bitwise Operations) components
| Calculation Name | Total Time | Content |
| -------- | -------- | -------- |
| BitDecomposition | 479ms ~ 652ms | Input: 1 field element. Output: bitwise share.|
| LessThan | 1.092s ~ 1.178s | Input: 2 field elements. Output: comparison result value |


# 2. Circuits Constraints

Main Circuits are:
| Circuit Name | Total Constrarints | Content |
| -------- | -------- | -------- |
| MySecretInputCircuit | 6574 | 1 secret & its Pedersen commitment & additional range constraints |
| (PedersenComCircuit) | 2544 | 1 secret & its Pedernsen commitment |
| MyCircuit | 5094 | 2 commited secrets & their multiplication |

Werewolf's circuits are:
| Circuit Name | Total Constrarints | Content |
| -------- | -------- | -------- |
| KeyPublicizeCircuit (3 parties) | 15266 | 3 commited secrets & their sum |
| DivinationCircuit (3 parties) | 22249 | many commited secrets & ElGamal encryption |


## Main Circuits (MPC Bitwise Operations)
Main circuits are:

| Circuit Name | Total Constrarints | Proving Time | Content |
| -------- | -------- | -------- | -------- |
| BitDecompositionCircuit | 672 | 2.028s | 1 secret |
| (SmallerEqThanCircuit) | 621~625 | 1.468s~1.483s | 1 bitwise secret & 1 comparison |
| (EqualityZeroCircuit) | 4 | 368.426ms | 1 secret |
| (PedersenComCircuit) | 2,543 | 6.572s | 1 secret & its Pedernsen commitment |
| (SmallerThanCircuit) | 2,016 | 4.039s | 2 secrets and ordering |
Binary file added images/constraints-times.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 96b7c68

Please sign in to comment.