Skip to content

Regarding the meaning of DEBUG content. #1414

@TheYangCode

Description

@TheYangCode

Hello, I apologize for disturbing you. I am a beginner using gnark. I wrote a test function for the Eddsa proof.

func Prove() {
	// compiles our circuit into a R1CS
	var circuit eddsaCircuit
	ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
	if err != nil {
		fmt.Println("failed to Compile. error:", err)
		return
	}

	// groth16 zkSNARK: Setup
	pk, vk, err := groth16.Setup(ccs)
	if err != nil {
		fmt.Println("failed to Setup. error:", err)
		return
	}

	witness, err := frontend.NewWitness(GetEddsaCircuit(), ecc.BN254.ScalarField())
	if err != nil {
		fmt.Println("failed to NewWitness. error:", err)
		return
	}
	publicWitness, err := witness.Public()
	if err != nil {
		fmt.Println("failed to witness.Public. error:", err)
		return
	}

	// groth16: Prove & Verify
	proof, err := groth16.Prove(ccs, pk, witness)
	if err != nil {
		fmt.Println("failed to Prove. error:", err)
		return
	}

	err = groth16.Verify(proof, vk, publicWitness)
	if err != nil {
		fmt.Println("Prove get invalid signature")
	} else {
		fmt.Println("Prove get valid signature")
	}
}

Test results obtained:
Image

But I am not very clear about the meanings of symbols in the DEBUG log and would like to obtain an official accurate answer.
I have the following questions:
1.Does constraint system solver done refers to groth16.Setup?
2.Does prover done refers to groth16.Prove?
3.Does verifier done refers to groth16.Verify?
4.Does took refers to the execution time of the function? Is the unit in ms?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions