Overview
Currently the cosmos/ics23 library has support for the range proofs used to prove non-membership done by Penumbra's JMT [1]. The use of a range proof is common across the other ProofSpec types in cosmos/ics23. However celestiaorg/smt (now unmaintained) does not support this. As we have forked and now maintain and use this SMT in production pokt-network/smt [2] and this implementation achieves non-membership proof verification differently this issue aims to outline the support for this method.
[1] https://github.com/penumbra-zone/jmt/blob/4a96055cbc70f3baef5bd73978d332880c601ded/src/tree.rs#L1036
[2] https://github.com/pokt-network/smt
SMT Proofs
The SMT (pokt-network/smt) does non-membership proofs by proving the existence of 1 of 2 things:
- A default value (
defaultValue []byte = nil) where the key was found
- An unrelated key-value pair in the place of where the key should be
- Unrelated keys can be found in place of the key we are looking for as they share a common prefix
An example of SMT proofs being used with cosmos/ics23 can be found here [1]
[1] https://github.com/pokt-network/pocket/blob/ibc/module_creation/ibc/stores/proofs_ics23.go
Deliverables
In order to implement this change without breaking support for range proofs a new CommitmentProof type representing a non-membership proof should be implemented along the lines of the following
message ExclusionProof {
bytes key = 1;
bytes actual_path = 2;
bytes actual_valueHash = 3;
LeafOp leaf = 4;
repeated InnerOp path = 5;
}
In the above the actual_path field will either contain the unrelated leaf data or the correct path with a null value pairing. In addition to the above the following must also be done:
Non-Goals
- Change any logic related to (non-)existence proof verification
- Break any backwards compatibility
Owner: @h5law
Overview
Currently the
cosmos/ics23library has support for the range proofs used to prove non-membership done by Penumbra's JMT [1]. The use of a range proof is common across the otherProofSpectypes incosmos/ics23. Howevercelestiaorg/smt(now unmaintained) does not support this. As we have forked and now maintain and use this SMT in productionpokt-network/smt[2] and this implementation achieves non-membership proof verification differently this issue aims to outline the support for this method.[1] https://github.com/penumbra-zone/jmt/blob/4a96055cbc70f3baef5bd73978d332880c601ded/src/tree.rs#L1036
[2] https://github.com/pokt-network/smt
SMT Proofs
The SMT (
pokt-network/smt) does non-membership proofs by proving the existence of 1 of 2 things:defaultValue []byte = nil) where the key was foundAn example of SMT proofs being used with
cosmos/ics23can be found here [1][1] https://github.com/pokt-network/pocket/blob/ibc/module_creation/ibc/stores/proofs_ics23.go
Deliverables
In order to implement this change without breaking support for range proofs a new
CommitmentProoftype representing a non-membership proof should be implemented along the lines of the followingIn the above the
actual_pathfield will either contain the unrelated leaf data or the correct path with a null value pairing. In addition to the above the following must also be done:ExclusionProoftypeExclusionProofwith theCommitmentProofprotobufcelestiaorg/smt->pokt-network/smtNon-Goals
Owner: @h5law