Question about compilation strategy over private and public inputs

I am new to Noir’s compiler. I would like to ask about the compilation strategies for the input variables that are marked with the keyword public and private. For instance, in the hello-world example of Noir:

fn main(x : Field, y : pub Field) {
    assert(x != y);
}

The input variable x is implicitly marked as private, whereas the input y is marked as public. Does Noir perform different compilation strategies for x and y? Thanks!

55 Likes

Hi there and welcome to the community :wave:

Public values are private values with extra constraints laid that guarantee their values are exposed as a part of the proof generated.

You can read more about private and public types here, and feel free to follow up if you have additional questions!

11 Likes