-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Overview
Split commitments, allows to do a decrementation for a partitioned variable, when only one commitment is available. The commitment is split into two commitments that can then be used. However, it costs gas to verify the split commitment proof and update the merkle trees with the new commitment. Instead a dummy commitment and nullifier should be used for the second commitment, provided the first commitment has enough balance.
Tasks
Describe the solution you'd like
In orchestration if only 1 commitment is available, a dummy commitment of 0, with a preimage of a salt of 0 and a value of 0 and a dummy nullifier of should be input to the proof generation.
In the circuit, we should turn of the commitment root check and the check that the nullifier is correctly formed, but we need to make sure we constrain that the value is always 0 when these checks are turned off.
In the contract, we check if the nullifiers and commitments are 0, and if so we don't store them in the list or in the merkle trees.
Consider commitments for structs as well, currently they aren't supported for split commitments, but they can be more easily with this approach.
Definition of done
When is this task complete?
One commitment should be able to be used instead of two without running split commitments.
Links
Include relevant links here
NA.