docs2 icon indicating copy to clipboard operation
docs2 copied to clipboard

ZkProgram needs more docs, it is only mentioned in the context of recursion

Open mitschabaude opened this issue 1 year ago • 4 comments

ZkProgram is the o1js general-purpose API for creating zk proofs. It's relevant for anyone who wants to create a proof that's not a Mina smart contract proof.

The docs don't present ZkProgram as such, but only present it as a tool "for recursion". It's true that you need offchain proofs in order to use recursion, but it's not true that recursion is the only use case for offchain proofs.

Idea: Create a new fleshed out section for writing provable code, which is not specific to smart contracts. This section can cover other topics not currently covered, such as Provable.witness() or "common differences between provable code and normal code". ZkProgram, as the general-purpose way of creating proofs, would fit well near the end of such a section

~~zkProgram - the verification key is a unique "description" of the circuit (^= the program)~~

mitschabaude avatar Jul 31 '23 06:07 mitschabaude

@mitschabaude - do you mind elaborating on why you said "writing provable code, which is not specific to smart contracts" --> maybe, what is provable code?

And what did you mean by: "zkProgram - the verification key is a unique "description" of the circuit (^= the program)"

iregina avatar Nov 01 '23 20:11 iregina

do you mind elaborating on why you said "writing provable code, which is not specific to smart contracts" --> maybe, what is provable code?

yeah sure! this is out of context, I wrote

Create a new fleshed out section for writing provable code, which is not specific to smart contracts

so the new section is what I don't want to be specific to smart contracts. Provable code is any code you can create a zk proof of! Also called a circuit (but that's jargon-y). So, a section about writing circuits!

And what did you mean by: "zkProgram - the verification key is a unique "description" of the circuit (^= the program)"

That doesn't look like something I wrote, maybe @barriebyron added it to my description O.o

mitschabaude avatar Nov 02 '23 08:11 mitschabaude

yes please more code for ZkProgram and maybe mention examples, like https://github.com/o1-labs/o1js/blob/ef0d5e4497938cf9d3c8cb8eb179d58149e2bc25/src/examples/gadgets.ts

barriebyron avatar Nov 02 '23 19:11 barriebyron

@garwalsh likes the idea of a more complete and standalone doc for ZkProgram

barriebyron avatar Nov 02 '23 19:11 barriebyron