Skip to content

Commit

Permalink
Merge pull request #40 from worldcoin/wip/mk/extract-vk
Browse files Browse the repository at this point in the history
Add a command to extract a vk
  • Loading branch information
dcbuild3r authored Oct 9, 2023
2 parents f25f42c + b750697 commit 239e395
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ func main() {
return ps.ExportSolidity(output)
},
},
{
Name: "export-vk",
Flags: []cli.Flag{
&cli.StringFlag{Name: "keys-file", Usage: "proving system file", Required: true},
&cli.StringFlag{Name: "output", Usage: "output file", Required: true},
},
Action: func(context *cli.Context) error {
keys := context.String("keys-file")
ps, err := prover.ReadSystemFromFile(keys)
if err != nil {
return err
}
outPath := context.String("output")

file, err := os.Create(outPath)
defer file.Close()
if err != nil {
return err
}
output := file
_, err = ps.VerifyingKey.WriteTo(output)
return err
},
},
{
Name: "gen-test-params",
Flags: []cli.Flag{
Expand Down

0 comments on commit 239e395

Please sign in to comment.