Skip to content
Discussion options

You must be logged in to vote

I figured it out!

When we run public_witness.MarshallBinary(), we get the public witness's binary representation of all its public values. MarshallBinary() only returns binaries associated with public values, so the known values and recreated witness are sufficient to compare with the public values in the public witness.

Here's my comparison function:


func CompareWitnesses(witness_1 witness.Witness, witness_2 witness.Witness) (bool) {
	recreated_witness_binaries, _ := witness_1.MarshalBinary()
	public_witness_binaries, _ := witness_2.MarshalBinary()

	return bytes.Equal(recreated_witness_binaries, public_witness_binaries)
}

Once I realized this, I wondered if I could just use the recre…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ivokub
Comment options

Answer selected by drakstik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants