webb-tools / zero-knowledge-gadgets

Zero-knowledge gadgets for Webb's cross-chain blockchain applications.
Apache License 2.0
89 stars 29 forks source link

[BUG] VAnchor amounts / tests are showing broken amount invariant #215

Closed drewstone closed 1 year ago

drewstone commented 2 years ago

It seems that the VAnchor R1CS circuit has a bug in either its implementation or in its tests. It is possible to mutate the input UTXO amounts to create an invalid invariant of amounts (public_amount + input_amounts === output_amounts should hold).