diff --git a/docs/benchmark.md b/docs/benchmark.md new file mode 100644 index 0000000..793b59d --- /dev/null +++ b/docs/benchmark.md @@ -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 | \ No newline at end of file diff --git a/images/constraints-times.png b/images/constraints-times.png new file mode 100644 index 0000000..5cce8f1 Binary files /dev/null and b/images/constraints-times.png differ