Are there any examples out in the wild of a ZkProgram with both publicInput and publicOutput? Something like https://github.com/o1-labs/o1js/blob/c3974f83053cefd050fcf458bc97afc5bd384415/src/examples/program-with-input.ts#L36. In particular, I'm interesting in validating a use-case where I want prove that the publicOutput of one SelfProof is equal to the publicInput of a second SelfProof. Is there a nicer/nice way to do this? I guess I can just hold on to the Field value and include it as another parameter in an "inductiveCase" method?
#Both publicInput and publicOutput
3 messages · Page 1 of 1 (latest)
In particular, I'm interesting in validating a use-case where I want prove that the publicOutput of one SelfProof is equal to the publicInput of a second SelfProof. Is there a nicer/nice way to do this? I guess I can just hold on to the Field value and include it as another parameter in an "inductiveCase" method?
If a SelfProof is part of your inputs, then you can already access its public output at proof.publicOutput. So no need to use another parameter
Here's an example I wrote which uses public input AND output:
https://github.com/mitschabaude/o1js-offchain-state/blob/main/contracts/src/action-state-prover.ts#L106-L108
Having both is very natural for incremental computation like in that example