Skip to content

Commit should serialise the commitment #3

@thomas-quadratic

Description

@thomas-quadratic

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:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions