Open axic opened 5 years ago
I'm not sure what is the confusion, but since the the proof builder and verifier both internally encode things, you need a trait to run that encoding, which is not tied to RLP.
And this is only the first step. You'd provide different impls of Node to make_multiproof
and rebuild
which either fully use RLP or SSZ, but this trait is shared between the two.
I understand that this is still in progress and it might change. Still, I'm commenting so that you don't spend too much time going in the wrong direction: in its current state, this code binds
Node
serialization torlp
. The idea behind that library is to factor the algorithm and leave details such as the encoding format.So if someone (presumably in the eth1 world) needs RLP, they just need to implement
rlp::Encodable
(which is already done). If someone wants to use SSZ, then they will need to implement somthing likessz::Encodable
. And if someone wants JSON (currently in the pipe), they can implementserde::Serializable
.Maybe I misunderstand what you're trying to do. Just please update the description when you have a moment.