Help us shape the future of Go! Take the 2026 Go Developer Survey

offline

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []*cli.Command{
	{
		Name:   "ptau",
		Usage:  "Convert a Snarkjs powers of tau file to a Phase 1 file",
		Action: actions.PtauToPhase1,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "ptau",
				Usage:    "Snarkjs powers of tau file",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "phase1",
				Usage:    "Output Phase 1 file",
				Required: true,
			},
		},
	},
	{
		Name:     "init",
		Category: "offline mode",
		Usage:    "Initialize Phase 2 for the given R1CS with a Phase 1 file",
		Action:   actions.Phase2Init,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "phase1",
				Usage:    "Phase 1 file",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "r1cs",
				Usage:    "R1CS file generated from a Gnark circuit",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "phase2",
				Usage:    "Output path for the Phase 2 file",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "srscommons",
				Usage:    "Output path for circuit-independent components of the Groth16 SRS",
				Required: true,
			},
		},
	},
	{
		Name:     "contribute",
		Category: "offline mode",
		Usage:    "Contribute randomness to Phase 2",
		Action:   actions.Phase2Contribute,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name: "phase2",
				Usage: "The existing Phase 2 file created in the init step or in the previous run\n" +
					"of the contribute step.",
				Required: true,
			},
		},
	},
	{
		Name:     "verify",
		Category: "offline mode",
		Usage:    "Verify the last randomness contributed to Phase 2",
		Action:   actions.Phase2Verify,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "phase2prev",
				Usage:    "Phase 2 file being an input to the contribution",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "phase2next",
				Usage:    "Phase 2 file that was contributed to",
				Required: true,
			},
		},
	},
	{
		Name:     "extract-keys",
		Category: "offline mode",
		Usage:    "Extract Proving and Verifying Keys",
		Action:   actions.Phase2ExtractKeys,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "r1cs",
				Usage:    "R1CS file generated from a gnark circuit",
				Required: true,
			},
			&cli.StringFlag{
				Name: "srscommons",
				Usage: "Circuit-independent components of the Groth16 SRS file generated on the Phase 2" +
					" initialization",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "beacon",
				Usage:    "Random string generated on the Phase 2 initialization",
				Required: true,
			},
			&cli.StringSliceFlag{
				Name: "phase2",
				Usage: "List of Phase 2 files to verify the contributions in the order they were\n" +
					"created. Contributions are verified in pairs, so at least two files must be provided.\n" +
					" This DOES NOT INCLUDE the original Phase 2 file generated on initialization.",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "pk",
				Usage:    "Output path for the proving key",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "vk",
				Usage:    "Output path for the verifying key",
				Required: true,
			},
		},
	},
}

Commands defines all CLI commands related to offline operations.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package actions provides handlers for the command line interface for the application.
Package actions provides handlers for the command line interface for the application.
Package phase1 implements functions interacting with multi-party computation Phase 1 objects produced by Gnark.
Package phase1 implements functions interacting with multi-party computation Phase 1 objects produced by Gnark.
Package phase2 implements functions interacting with multi-party computation Phase 2 objects produced by Gnark.
Package phase2 implements functions interacting with multi-party computation Phase 2 objects produced by Gnark.
Package r1cs implements methods interacting with the R1CS constraint system object produced by Gnark.
Package r1cs implements methods interacting with the R1CS constraint system object produced by Gnark.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL