solidity

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Groth16CommitmentProof

type Groth16CommitmentProof struct {
	Proof         SolidityProof `json:"proof"`
	Commitments   [2]*big.Int   `json:"commitments"`
	CommitmentPok [2]*big.Int   `json:"commitment_pok"`
}

Groth16CommitmentProof represents a Groth16 proof with commitments, for Solidity.

func (*Groth16CommitmentProof) ABIEncode

func (p *Groth16CommitmentProof) ABIEncode() ([]byte, error)

ABIEncode encodes the Groth16CommitmentProof to an ABI-encoded byte slice matching Solidity’s (uint256[8],uint256[2],uint256[2]) layout.

func (*Groth16CommitmentProof) FromGnarkProof

func (p *Groth16CommitmentProof) FromGnarkProof(proof groth16.Proof) error

FromGnarkProof converts a gnark groth16 proof to a Solidity‑compatible proof.

func (*Groth16CommitmentProof) String

func (p *Groth16CommitmentProof) String() string

String returns a JSON representation of the Groth16CommitmentProof as a string. This is useful for debugging or logging purposes. If marshalling fails, it returns an empty JSON object as a string.

type SolidityProof

type SolidityProof struct {
	Ar  [2]*big.Int    `json:"Ar"`
	Bs  [2][2]*big.Int `json:"Bs"`
	Krs [2]*big.Int    `json:"Krs"`
}

SolidityProof represents a Groth16 proof for Solidity (without commitments).

Jump to

Keyboard shortcuts

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