ConsenSysMesh / cava

ConsenSys core libraries for Java & Kotlin
Apache License 2.0
84 stars 34 forks source link

Expose SSZ#merkleHash to Allow Callers to Implement Signed Roots #197

Open schroedingerscode opened 5 years ago

schroedingerscode commented 5 years ago

Signed Roots allow calculating the merkle hash of a subset of a SSZ container, specifically to allow signing of a container while excluding signature fields.

While this definition signed_root(container, "signature") = merkle_hash([hash_tree_root(sub_object_1), ..., hash_tree_root(sub_object_N)]) has been deprecated in further versions of the Eth2 SSZ spec, I see no harm in allowing public callers to use SSZ#merkleHash directly for compatibility.