ADD: uncompress commitments in FFI and java bindings#104
ADD: uncompress commitments in FFI and java bindings#104thomas-quadratic wants to merge 1 commit intocrate-crypto:masterfrom
Conversation
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 <thomas.zamojski@quadratic-labs.com>
|
Hi, can you say why this is needed? |
|
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). 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. |
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.