cairo-lang icon indicating copy to clipboard operation
cairo-lang copied to clipboard

[Question] Does Cairo support public input?

Open updogliu opened this issue 2 years ago • 1 comments

Does Cairo support public input, i.e. the information shared among the prover and verifier?

updogliu avatar Dec 24 '22 14:12 updogliu

As far as I know, current cairo/stark ecosystem does not support generating public inputs of specific program by verifier. I don't mean it's impossible for STARK theoretically, but it's not implemented as a spec in Cairo. For example, see https://github.com/lambdaclass/cairo-vm and find the following statement:

--air_public_input <AIR_PUBLIC_INPUT>: Receives the name of a file and outputs the AIR public inputs into it. Can only be used if proof_mode is also enabled.

It says that you can generate AIR public inputs only if you run the entire program. It means that even verifiers are required to run the whole proof to generate public inputs, and it does not make much sense as a proof system for STARK.

Cairo whitepaper specifically tells about this in section 2.7.2 "Program output" of https://eprint.iacr.org/2021/1063.pdf . Public input is only contained in program output executed by prover. I have no idea why devs decided to go with this spec.

pad01g avatar Jan 16 '24 09:01 pad01g