Closed xhliu closed 1 year ago
Regarding "Hardcode VerifyingKey into the library": It now isn't directly used by the library because of precalc of miller loop. This was previously done in a very hacky crude way by the snark libraries. But now we can do it by directly calling sCrypt functions locally. Makes things a lot easier and flexible.
Maybe instead of exposing the miller precalc directly to the user, we could wrap it in a single function, something like:
const vk: VerifyingKey = prepareVerfyingKey(VERIFYING_KEY_DATA)
which should make it simple enough.
Only generate a file, not a directory
It will be simpler to integrate, as
verifier.scrypt
.
Not at all, especially since we have all the ASM optimization stuff that comes with it.
Only generate a file, not a directory
It will be simpler to integrate, as
verifier.scrypt
. It should be a library, not a contract. Write another contract to test, as ZKSNARKTest in https://xiaohuiliu.medium.com/create-your-first-zero-knowledge-proof-program-on-bitcoin-ec159cc501f4 https://github.com/sCrypt-Inc/scryptTS-docs/blob/a599a5319a01118900c6d18a9d3f7d20ac622f06/docs/tutorials/zk-snark.md?plain=1#L139Rename G16BN256
-> SNARK as before. This is a tutorial, so no need to introduce the intricacies & details.
Hardcode VerifyingKey into the library
verify()
should be a static method asZKSNARK.verify(inputs, proof)
before, so nonew
is needed. Let's follow the previous article, unless u have reasons not to.Remove test
from https://scrypt.io/docs/tutorials/zkp#7-run-the-scrypt-verifier. Just write a single script like
deploy.ts
.Link to github
in Conclusion, so people can read the full zkp code.
Update Learn
https://learn.scrypt.io/en/courses/Build-a-zkSNARK-based-Battleship-Game-on-Bitcoin-64187ae0d1a6cb859d18d72a/lessons/4/chapters/1