Skip to content

Conversation

@thomas-quadratic
Copy link

Commitments has 2 representations in bytes: uncompressed and compressed.
So far, we could go from uncompressed serialized to compressed serialized form via the compress method, but not the other way around.
This commitment fills the gap with the uncompress method, and the vectorized version uncompressMany.
The latter, uncompressMany, makes use of Montgoméry's inversion trick much like hashMany.

Commitments has 2 representations in bytes: uncompressed and compressed.
They are both used in different parts of Verkle Tries.
So far, we could go from uncompressed serialized to compressed serialized form via the compress method, but not the other way around.
This commitment fills the gap with the uncompress method, and the vectorized version uncompressMany.
Note that uncompressMany makes use of Montgoméry's inversion trick much like hashMany.

Signed-off-by: Thomas Zamojski <[email protected]>
@kevaundray
Copy link
Contributor

Hi, can you say why this is needed?

@thomas-quadratic
Copy link
Author

We chose at one point to represent commitments in Besu in an uncompressed serialized form, which trades memory for computation efficiency (verkle crypto seems already slow enough).
In order to do operations such as updating a vector commitment at a few values, we pass among other data the uncompressed commitment to the native lib, which then returns the updated uncompressed serialized commitment.

However, there are a few places where compressed commitments are used: for state root and in execution witnesses for example. In order to run in stateless mode, we will want to load a verkle trie from an execution witness and operate on it. The latter is problematic right now as we cannot operate on compressed commitments. Verkle Trie and the crypto bindings use uncompressed form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants