-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Summary
The current format for the Merkle proofs is simply []byte which is mostly amino encoded single Merkle proof. This has the following problems:
- ABCI apps will have multilayer Merkle proof instead of single layer. For example SDK is using Simple Merkle Proof in
rootmultistoreand IAVL Proof iniavlstore, and they are composed horizontally. - It is hard to extend the set of Merkle proof formats. Each time we use a new Merkle proof format, we have to define a completely new type, which is app-specific and not reusable.
Proposal
Define ProofOp. It is a triple of (type string, key []byte, data [][]byte) and decoded into type ProofOperator interface depending on its type. It has a method Run() which can be used for chaining multiple ProopOperators.
Also each concrete type of ProofOperator can declare its own OpDecoder which later can be used for decoding ProofOp to ProofOperator. Those are registered in map[type string]OpDecoder way. Since it does not rely on amino, lite clients on non-golang environment, for example, a mobile client, can define OpDecoder for json or subset of amino,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels