I'm looking at this bit of code in here. https://docs.minaprotocol.com/zkapps/snarkyjs/smart-contracts
class HelloWorld extends SmartContract {
@state(Field) x = State<Field>();
@method increment() {
// read state
const x = this.x.get();
this.x.assertEquals(x);
// write state
this.x.set(x.add(1));
}
}
so in here x is fetched on the client side. x is sent as public input to a Mina node. there's a constraint that checks whether public input x equals to onchain x.
so someone can't modify snarkyJS and fake the x.
My question is this.
this.x.set(x.add(1));
Does this line generate a proof that says , onchain x is indeed set to the public input x + 1?
Or should I add another constraint after the state update?