Greetings,
I was trying to use the existing tooling of zk-snark (snark-js) but their BLS12_381 based power of tau ceremony gets some error which I have forwarded on their Github issues. However in the hopes of using it successfully in Sophia language’s BLS12_381 functions and types with the values created within the scalar field of BN128 I am trying different approaches and one of those got me here…
https://gist.github.com/genievot/6934015a3295fe4939c0ad56528749c3
Line 23 verificationKey() returns list(int): are verification keys in int then converted to fp
Line 54 points48ToVerify() returns list(int): are converted integers from Calldata (To verify: type proof
)
Line 73 points32ToVerify() returns list(int): are converted integers from Calldata (To verify: type list(fr)
)
Init runs smoothly with higher gas amount but verify_proof()
gives error:
VerifyContract: Verify_proof_method:
Error: Invocation failed: "Incomplete patterns"
at d (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:99543)
at Object.c.call (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:101493)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Context.<anonymous> (test/verifyTests.js:148:15)
And with the same points the Solidity Version is:
https://gist.github.com/genievot/4a19c0727f1ac6190a2908fa2206912b
The valid call data that will return true upon running verifyProof
with it in solidity is:
["0x1768da783d506dfea0f7516046ac6eca5f092758ce2a4b9ae53c4aeb0bfc028f","0x2c117d9e47e549e19b1a89603b8187118b4029c242970efec88a5fe311f62803"],[["0x17c28dcff9a01afa23c26222edfa692ce0661d39e3812d6b2c96a219f7a04973","0x301f90cb9ee8ca594fe5c6b6d8ac1777313cb4a9c52bcb0b527d3a00e0a914eb"],["0x02b6dd72ad906e43987c7c7bc01baf6149b6a2a4155e0432ef83c9fa35668971","0x1a6290887adb3f0f4ba34105d29d05a523a7fb07f7c00ed6a719a6a0d56643c3"]],["0x012d818d82f70a215958d84a88eff258aba6cf890b27bc713509345a534bd573","0x1d8642501938e102064154df9a380b3fc5e31bf3dc74615ffeeef33cc5653ed1"],["0x0000000000000000000000000000000000000000000000000000000000000021"]
and I am currently not aware of how to pass fp
or fr
types from outside the contracts So I am using inner conversions to pass and convert integers to relative types and construct correct records like g1
, g2
& fp2
. I tried passing bytes padded with 0 to match the requirement as 32 and 48 bytes for fr
and fp
but I was getting type errors. I hope you can also provide some more examples on it in the future regarding fp
& fr
(Montgomery) as inputs with editors or js-sdk.
Please let me know about this error and what should I do to solve it.
Tagging: @hanssv.chain @dimitar.chain
Best Regards,