This is because our Merkle tree path is of the following structure:
pub struct Path<P: Config> {
pub(crate) leaf_sibling_hash: LeafDigest<P>,
/// The sibling of path node ordered from higher layer to lower layer (does not include root node).
pub(crate) auth_path: Vec<TwoToOneDigest<P>>;,
/// stores the leaf index of the node
pub(crate) leaf_index: size,
}
We will need to make a trade-off here and a change that likely could be in the next release. I suggest:
Let Path automatically derive the serialization traits' implementations.
Based on the discussion from Telegram, one would likely want to serialize/deserialize a Merkle tree path, and currently, this cannot be done.
https://github.com/arkworks-rs/crypto-primitives/blob/main/src/merkle_tree/mod.rs#L33
This is because our Merkle tree path is of the following structure:
We will need to make a trade-off here and a change that likely could be in the next release. I suggest:
Path
automatically derive the serialization traits' implementations.pub(crate)
topub
.Thoughts? @tsunrise