Description
Currently, commit exposes to the Java-side the computation of a commitment. However, there are two ways to convert a commitment (elliptic curve point in extended twisted-Edwards coordinates) to bytes:
- Via map_to_scalars : scalar field element used as values in the parent commitment and the rootHash. It is a relatively expensive operation (division), and not necessarily invertible.
- Via to_bytes: base field element used to uniquely represent the commitment. It is cheap and invertible: an equivalent element in banderwagon can be recovered from the base field element.
In commitment, we need the first value. In proof data, we need the second value. Although the first could be recovered from the second, we would like to store both values in the Trie to avoid further divisions.
Expected
commit should return both the serialised commitment and its hash concatenated together in a 64b-le.
Description
Currently, commit exposes to the Java-side the computation of a commitment. However, there are two ways to convert a commitment (elliptic curve point in extended twisted-Edwards coordinates) to bytes:
In commitment, we need the first value. In proof data, we need the second value. Although the first could be recovered from the second, we would like to store both values in the Trie to avoid further divisions.
Expected
commit should return both the serialised commitment and its hash concatenated together in a 64b-le.