dfns / cggmp21

State-of-art threshold ECDSA in Rust
Apache License 2.0
41 stars 6 forks source link

More compact serialization of key shares #94

Closed survived closed 2 months ago

survived commented 3 months ago

I've noticed that we serialize scalar in vss_setup as not compact. It makes the key share bigger.

This is how compact things are serialized:

https://github.com/dfns/cggmp21/blob/f120531a851b00f1da6808f9961f00a32dc02a38/test-data/old-shares/v0.2/secp256k1-threshold-true-hd-false.json#L5-L11

this is how VSS setup is serialized:

https://github.com/dfns/cggmp21/blob/f120531a851b00f1da6808f9961f00a32dc02a38/test-data/old-shares/v0.2/secp256k1-threshold-true-hd-false.json#L12-L36

We should compress VSS setup by adding generic_ec::serde::PreferCompact that deserializes both compressed / not compressed, but serializes only the compact variant.

survived commented 2 months ago

Closed in #96