Closed sripwoud closed 2 months ago
@cedoor
I think it makes sense to add them, but we could keep that download optional in the @zk-kit/artifacts
package, meaning devs will decide if they want to download the json vkeys as well, in addition to the other files. What do you think?
Also, what about r1cs files? They could be useful for P0tion. I don't see any advantage of downloading them in the @zk-kit/artifacts
package tho.
Some thoughts about ways to have the benefits without the drawbacks:
@zk-kit/{proof}-artifacts-verification-key
that contains only the verification-key.json. Install that as a dependencies where needed. Still one drawback... again another package...that needs to be published...just for one filegit subtree
: again another less known git feature that would be appropriate here (managing dependencies). It is a way to insert the content of subdirectory of a given repo into another. It is much easier to setup and use than submodules. It is like adding a new remote. It would only require one maintainer to pull from the upstream repo (snark-artifacts
) to resync the json file (e.g into zk-kit
). re optionalDependencies
Oh yeah I forgot about that and always wondered what a good use case of that could be ^^.
Sounds more straightforward than my 2 previous ideas.
It means we would like all zkey
and wasm
files as optional. verification-key.json
as not optional
And then in e.g zk-kit
packages we would do npm install --no-optional @zk-kit/{proof}-artifacts
?
r1cs
files
any reason not to add them? We will generate them when generating the rest anyway so... We can make them optional too.
Oh I actually meant here: https://github.com/privacy-scaling-explorations/zk-kit/blob/12447adf0bca1f752b1bd6b7acf5b87e0cadccc6/packages/utils/src/types/index.ts#L36, as an optional field in the Artifacts type.
Or it could just be another function actually, for downloading verification keys only.
I see reasons for and against adding
verification-key.json
files into this repo.snark-artifacts
repo was to "unpackage" artifacts that are big (zkey and wasm files) and provide an alternative way to distribute them so they can be fetched at runtime. This size constraint does not apply so much to verification-key json files: they are much smaller... so it can actually be ok for verification key json files to keep being "packaged", e.g like hereverify
functions...