#How to increase Zkprogram recursion speed
6 messages · Page 1 of 1 (latest)
if you turn it into a tree structure you can make use of parallel proving across many machines
You do as follows:
- You run the ZkProgram using rawMethods to calculate the publicOutput for all the recursion steps
- You run in parallel using many workers proof generation for all recursion steps using the data from 1)
- You run in the parallel merging of the proofs as soon as the adjacent proofs from the 2) and 3) are ready
How zkCloudWorker do it:
https://github.com/zkcloudworker/zkcloudworker-aws/blob/main/src/api/sequencer.ts
If you will use zkCloudWorker, all this will be automatic for you, you will need just define functions create and merge for your ZkProgram as in this example:
https://github.com/zkcloudworker/worker-example/blob/main/src/worker.ts
what is rawMethods I cant find its description in docs
It is here:
https://docs.minaprotocol.com/zkapps/o1js-reference/functions/ZkProgram#returns
Basically, when you call the ZkProgram method thru rawMethods, it does calculations without proof creation, so it is very fast.
Even if I know the output of each step, don't I need to generate the proof of each step step by step for the final proof?