-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICS ?: Merkle Operators #69
Comments
For reference there is some documentation on this scheme in the Tendermint repo since it's been added to the ABCI.Query method: See also the |
The proposed set of Merkle operators: (Even the mechanism looks like a stack machine but it is not. I think it is better to make the operations can perform the operation on any position of the input values. Please consider this while reading the proposal, the term "the input" may refer to the specific argument that the operator is willing to process(the first input by default, but can be altered))
Examples:
TODO: check if the operators above are resistant from attacks. The attackers should not be able to generate false proof combining the operators. This is achieved if the operators are dependent on the input(append, sha256, prependlength, concat) or it is independent but checked by the verifier(liftkey). TODO: where should we insert the result if the operator processes multiple inputs like concat? TODO: the set of operators will be fixed and consistent across the chains, it is better to write it as a proto file? |
I believe @ethanfrey intends to work on this (and more!) |
Yes, I have started a draft of a format along with js and go validation logic in https://github.com/confio/proofs I plan to work quite a bit more on that in the coming two months |
I believe this is superseded by #282. |
Merkle operators are
[][]byte -> [][]byte
functions, which act as generalized proofs. It is annoying to implement each of the implementation-specific Merkle proof for each of the chains, so we can reduce the existing/future implementation specific Merkle proofs into the Merkle operator format and then prove it on the other chains.The proposed set of Merkle operators(cosmos/iavl#136):
ConcatOp{prefix, suffix []byte}
: concatsprefix + input + suffix
SHA256Op{}
: sha256 hashes the inputPrependLengthOp{}
: prepend the input with its lengthApplyOp{index []int, ops []Operator}
: apply ops to the inputs parallellyIAVLValueOp
,IAVLAbsentOp
,SimpleValueOp
can be reduced into the first three operators with a preprocessing.IAVLRangeOp
is not proven to be able to reduce yet, but I'm pretty sure it is possible withApplyOp
(key checking will be a bit tricky).When a new chain using a new Merkle tree implementation comes into the network, they can simply register how does the new Merkle proof look like. It can be described as a simple regular expression, for example,
IAVLValueOp
s have the format ofSHA256 PrependLength Concat SHA256 (PrependLength Concat SHA256)*
. So even a chain does not understandIAVLValueOp
from its code, the knowledge can be provided from an external actor as a regular expression of Merkle operators, which makes the chain able to learn new proof formats on runtime.The text was updated successfully, but these errors were encountered: