Skip to content

works fine. but issue with compatibility of public hashes generated on solidity vs gnarkjs generatecall command.#14

Open
RustNinja wants to merge 7 commits into
dev-sha256-solfrom
rustninja/pub-hashes-solidity-compatibility-issue
Open

works fine. but issue with compatibility of public hashes generated on solidity vs gnarkjs generatecall command.#14
RustNinja wants to merge 7 commits into
dev-sha256-solfrom
rustninja/pub-hashes-solidity-compatibility-issue

Conversation

@RustNinja
Copy link
Copy Markdown

@RustNinja RustNinja commented Feb 27, 2024

SUMMARY of our call with Mike:

proof.json + public.json does not work with a .sol verifier.

So the final agreement with @matchv is that:

  • public.json + proof.json + circuit CLI return TRUE
  • gnarkjs generatecall output + .sol verifier returns true.

BUT
public.json + proof.json + .sol verifier => FALSE return from verify_proof function.

so if
gnarkjs generatecall output + .sol verify is TRUE
we do not have a part of public inputs on solidity side to feed this type of inputs into verify_function.

On solidity side we have
msgs, sigs, pub keys that translated into the format that the same that we have on proof.json file:
example:

[
 "0",
 "26209740439827815099410514594437955147",
 "258959049915833580577540038709971976332"
]

But we need the format and not actually the format but the data generated the same way that it was genetated by
snarkjs generatecall

["0x139855728d26774998f6a74260935dbf2b41a2e1e12ff0ef546605ac921d94e5", "0x0c6f6e5ab5df25ea175f8831649bd2f0154ca8544043c61b450b12118d4d6b1f"],[["0x2ac4e68c7d097f2ba324b71166e313585b77e13e1d6faae52ffea257d951d88e", "0x00514c55fcab6a307d412bac507efd1bdb2e032763210c8179a9141a81d84c5b"],["0x0668d08425135c162009904e97c22e8588b17c6241b4ab9da812902f253d09a5", "0x2fd2174a9298f2ccc505ca4a3aac4c8ea67de8ba8ed0fa0ac22c26f693d6d551"]],["0x0d779a0cfb66e2a20e9e87f82dce62932ee6b168c31a46073f9e77c24bc10c16", "0x2c2e380c15566e22acfd22aba8eec47e0d9575dabec24e7f75d4d5a05c25e551"],["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000013b7cff91a80a211b9ce7146aea27e4b","0x00000000000000000000000000000000c2d1b2e882294a7aa8f726e774bb008c"]

And only then we can use a proof and newly generated hashes to feed into verify proof function and get a TRUE.

proof.json + public.json does not work with a .sol verifier.
@RustNinja RustNinja requested a review from blasrodri February 27, 2024 20:38
@RustNinja RustNinja changed the title works fine. but still issue with compatibility issue of hashes. works fine. but issue with compatibility issue of public hashes. Feb 27, 2024
@RustNinja RustNinja requested a review from matchv February 27, 2024 20:39
@RustNinja RustNinja changed the title works fine. but issue with compatibility issue of public hashes. works fine. but issue with compatibility of public hashes generated on solidity vs gnarkjs generatecall command. Feb 27, 2024
Comment thread proof_4.json
@@ -0,0 +1,16 @@
[ERROR] snarkJS: Error: ENOENT: no such file or directory, open 'public.json'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this file?

writeFileSync(`./circuits/batchverify_js/batchinput.json`, JSON.stringify(inputJson, null, 2));

const witness = await cir.calculateWitness(inputJson, true);
// const witness = await cir.calculateWitness(inputJson, true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no more witness?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a test that need just to generate a an input file.
this calculateWitness use old circuit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants