The Contract
View Contract Code
View Contract Code
How It Works
Unsigned Integer Types - Bounded
Uint<m..n> represents values from m to n (inclusive). Lower bound must be 0.
Unsigned Integer Types - Sized
Uint<n> uses up to n bits, equivalent to Uint<0..(2^n - 1)>. The maximum width is Uint<248>.
Field Type
Field wraps modulo the prime. Comparison operators (<, <=) are not defined on Field; convert to a Uint first if you need ordering.
Bytes Type
Bytes<n> for exactly n bytes.
Opaque Types
Opaque<"label"> is a value whose internal representation is opaque to circuit logic: the circuit can hash it, store it, and pass it around, but cannot read or branch on its contents. The witness layer holds the real bytes; the ZK proof commits to the hash.
Disclosure Rule for Circuit Parameters
disclose() fails with:
Uint, Field, Bytes, and Opaque alike. disclose(x) is a compiler annotation that says “I know this value flows from a (potentially) private source to a public location and that’s intentional.”
See Privacy & Disclosure for more on the disclosure rule.
Arithmetic Widening and Casts
Compact has no silent overflow. Arithmetic on bounded integers produces a wider result type:Boolean Type
true and false. Standard operators: &&, ||, !, ==, !=.
What’s Next
Hello World
Apply types in your first contract
First App
Build a counter with type safety