forked from bnb-chain/zkbnb-setup
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.go
More file actions
102 lines (95 loc) · 3.26 KB
/
main.go
File metadata and controls
102 lines (95 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package main
import (
"log"
"os"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "setup",
Usage: "Use this tool to generate parameters of Groth16 via MPC",
UsageText: "setup command [arguments...]",
Commands: []*cli.Command{
/* ----------------------------- Phase 1 Import ----------------------------- */
{
Name: "p1i",
Usage: "p1i <inputPath> <outputPath>",
Description: "Deserialize snarkjs .ptau file into gnark's phase1 format and write to `OUTPUT`.ph1",
Action: p1i,
},
/* --------------------------- Phase 2 Initialize --------------------------- */
{
Name: "p2n",
Usage: "p2n <phase1Path> <r1csPath> <phase2Path>",
Description: "initialize phase 2 for the given circuit",
Action: p2n,
},
/* --------------------------- Phase 2 Contribute --------------------------- */
{
Name: "p2c",
Usage: "p2c <inputPath> <outputPath>",
Description: "contribute phase 2 randomness for Groth16",
Action: p2c,
},
/* ----------------------------- Phase 2 Verify ----------------------------- */
{
Name: "p2v",
Usage: "p2v <inputPath> <originPath>",
Description: "verify phase 2 contributions for Groth16",
Action: p2v,
},
/* ----------------------------- Keys Extraction ---------------------------- */
{
Name: "key",
Usage: "key <inputPath>",
Description: "extract proving and verifying keys",
Action: extract,
},
{
Name: "sol",
Usage: "sol <session>",
Description: "export verifier smart contract from verifying key",
Action: exportSol,
},
// Unused since we use the powers of tau ceremony from PPoT
// /* --------------------------- Phase 1 Initialize --------------------------- */
// {
// Name: "p1n",
// Usage: "p1n <power> <outputPath>",
// Description: "initialize phase 1 of parameters generation for Groth16",
// Action: p1n,
// },
// /* --------------------------- Phase 1 Contribute --------------------------- */
// {
// Name: "p1c",
// Usage: "p1c <inputPath> <outputPath>",
// Description: "contribute phase 1 randomness for Groth16",
// Action: p1c,
// },
// /* ----------------------------- Phase 1 Verify ----------------------------- */
// {
// Name: "p1v",
// Usage: "p1v <inputPath>",
// Description: "verify phase 1 contributions for Groth16",
// Action: p1v,
// },
// /* ------------------ Phase 1 Transform from PPoT Ceremony ------------------ */
// {
// Name: "p1t",
// Usage: "p1t <inputPath> <outputPath> <originalPower> <reducedPower>",
// Description: "transforms output of PPoT ceremony to be usable by semaphore-mtb-setup",
// Action: p1t,
// },
// /* ------------------ Phase 1 Verify from transformed file ------------------ */
// {
// Name: "p1vt",
// Usage: "p1vt <inputPath> <transformedPath",
// Description: "verify phase 1 contributions for Groth16 based on transformed PPoT ceremony file",
// Action: p1vt,
// },
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}