Pedersen Commitment
A Pedersen commitment lets you commit to a value v with a random
blinding r such that:
- Hiding: the commitment reveals nothing about
v. - Binding: you cannot later open it to a different value.
- Homomorphic:
commit(a) · commit(b) = commit(a + b).
commit(v, r) = gv · hr mod p
Result
—
Try it
- Same
(v, r)always gives the same commitment — try clicking twice. - Change
rwhile keepingvthe same — commitment changes (hiding). - Change
vwhile keepingrthe same — commitment changes (binding).
What's happening
The button calls a Rust function compiled to WebAssembly. The same
commit function is used by the rollup server to lock account
state. Read Ex1 for the full math
and security argument.