lux zk

Zero-knowledge proof tools (ceremony, prove, verify, SRS)

lux zk

The zk command provides tools for zero-knowledge proof operations on the Lux network, including powers-of-tau ceremony management, proof generation, proof verification, and SRS (Structured Reference String) management.

These operations integrate with the Z-Chain, Lux's dedicated ZK chain, for on-chain proof verification via precompiled contracts.

USAGE:

lux zk ceremony init Initialize a new powers-of-tau ceremony lux zk ceremony contribute Add randomness to a ceremony lux zk ceremony verify Verify ceremony integrity lux zk ceremony export Export final SRS binary lux zk ceremony status Show ceremony state

lux zk prove groth16 Generate a Groth16 proof lux zk prove plonk Generate a PLONK proof

lux zk verify groth16 Verify a Groth16 proof lux zk verify plonk Verify a PLONK proof

lux zk srs download Download the official Lux SRS lux zk srs verify Verify a downloaded SRS lux zk srs info Show SRS metadata

lux zk ceremony

Manage powers-of-tau ceremonies for generating trusted SRS (Structured Reference Strings) used in Groth16 and PLONK proof systems.

The ceremony requires the 'ceremony' binary from the Lux node repo. If not found, build it with: cd ~/work/lux/node && go build -o /usr/local/bin/ceremony ./cmd/ceremony/

lux zk ceremony contribute

Apply a random contribution to the ceremony state. Generates cryptographically secure random scalars (tau, alpha, beta) and mixes them into the SRS. The random values are zeroed from memory after use.

Usage:

lux zk ceremony contribute [flags]

Flags:

      --input string         Input ceremony file (required)
      --output string        Output ceremony file (required)
      --participant string   Participant name (required)

lux zk ceremony export

Export the SRS (Structured Reference String) from a completed and verified ceremony. The ceremony is verified before export. Output is uncompressed binary (G1: 64 bytes, G2: 128 bytes per point).

Usage:

lux zk ceremony export [flags]

Flags:

      --input string    Ceremony file to export (required)
      --output string   Output SRS binary file (required)

lux zk ceremony init

Create a new ceremony state file with initial powers of the BN254 generators. This is the starting point before any contributions.

Usage:

lux zk ceremony init [flags]

Flags:

      --circuit string     Circuit name (required)
      --output string      Output file path (required)
      --participants int   Expected number of participants (default 3)
      --power int          Power of 2 for constraint count (2^power) (default 20)

lux zk ceremony status

Display the current state of a ceremony file including circuit info, contributions, and participant hashes.

Usage:

lux zk ceremony status [flags]

Flags:

      --input string   Ceremony file to inspect (required)

lux zk ceremony verify

Check the consistency of a ceremony state file by verifying:

  • TauG1/TauG2 form consistent geometric sequences (pairing checks)
  • AlphaG1/BetaG1 use the same tau ratio
  • BetaG1 and BetaG2 encode the same beta scalar
  • Contribution hash chain integrity
  • No points at infinity

Usage:

lux zk ceremony verify [flags]

Flags:

      --input string   Ceremony file to verify (required)

lux zk prove

Generate zero-knowledge proofs using the Lux SRS.

Proof generation runs locally using the SRS from the trusted setup ceremony. The resulting proof can be verified on-chain via the Z-Chain verifier precompiles or off-chain using 'lux zk verify'.

lux zk prove groth16

Generate a Groth16 proof from a circuit, witness, and SRS.

The proving key is derived from the SRS generated by the ceremony. The witness contains both public inputs and private values.

Usage:

lux zk prove groth16 [flags]

Flags:

      --circuit string   Compiled circuit file path (required)
      --output string    Output proof file path (required)
      --srs string       SRS file path (required)
      --witness string   Witness file path (required)

lux zk prove plonk

Generate a PLONK proof from a circuit, witness, and SRS.

PLONK uses a universal SRS that works with any circuit of bounded size, unlike Groth16 which requires a circuit-specific trusted setup.

Usage:

lux zk prove plonk [flags]

Flags:

      --circuit string   Compiled circuit file path (required)
      --output string    Output proof file path (required)
      --srs string       SRS file path (required)
      --witness string   Witness file path (required)

lux zk srs

Manage Structured Reference Strings (SRS) for ZK proof systems.

The SRS is the output of the trusted setup ceremony and is required for both proof generation and verification. The official Lux SRS is published on the Z-Chain.

lux zk srs download

Download the official SRS binary from the Z-Chain. The file is verified after download using the ceremony binary.

Usage:

lux zk srs download [flags]

Flags:

      --output string   Output file path (default: ~/.lux/zk/srs.bin)
      --url string      SRS download URL (default "https://api.lux.network/mainnet/v1/bc/Z/srs")

lux zk srs info

Display metadata about an SRS file including the number of powers, file size, and SHA-256 hash.

Usage:

lux zk srs info [flags]

Flags:

      --input string   SRS file path (required)

lux zk srs verify

Verify the integrity of a downloaded SRS file by checking its structure and computing its SHA-256 hash.

Usage:

lux zk srs verify [flags]

Flags:

      --input string   SRS file path (required)

lux zk verify

Verify zero-knowledge proofs by calling Z-Chain precompiled contracts.

The Z-Chain provides on-chain verification for Groth16 and PLONK proofs via precompiled contracts at fixed addresses. This command submits the proof and public inputs to the verifier precompile and returns the result.

lux zk verify groth16

Verify a Groth16 proof against the Z-Chain Groth16 verifier precompile.

Requires the proof file, verification key, and public inputs. Connects to the Z-Chain RPC endpoint to call the verifier contract.

Usage:

lux zk verify groth16 [flags]

Flags:

      --inputs string   Public inputs file path (required)
      --proof string    Proof file path (required)
      --rpc string      Z-Chain RPC endpoint (default "http://localhost:9630/v1/bc/Z/rpc")
      --vk string       Verification key file path (required)

lux zk verify plonk

Verify a PLONK proof against the Z-Chain PLONK verifier precompile.

Requires the proof file, verification key, and public inputs. Connects to the Z-Chain RPC endpoint to call the verifier contract.

Usage:

lux zk verify plonk [flags]

Flags:

      --inputs string   Public inputs file path (required)
      --proof string    Proof file path (required)
      --rpc string      Z-Chain RPC endpoint (default "http://localhost:9630/v1/bc/Z/rpc")
      --vk string       Verification key file path (required)