Skip to content

Latest commit

 

History

History
 
 

ics23

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

ICS-23 specification mapping

Below an overview of all data types from the ICS-23 specification and how they're implemented.

CommitmentState

spec: object
impl: not implemented

CommitmentRoot

spec: object
impl: [u8]

CommitmentPath

spec: object
impl: [u8]

CommitmentPrefix

spec: object
impl: not implemented

applyPrefix

spec: applyPrefix = (prefix: CommitmentPrefix, path: CommitmentPath) => CommitmentPath
impl: not implemented

removePrefix

spec: removePrefix = (prefix: CommitmentPrefix, path: commitmentPath) => Path
impl: not implemented

Path

spec: string
impl: [u8]

Value

spec: []byte
impl: [u8]

CommitmentProof

spec: object
impl:

  • existence_proof.rs (from lib/unionlabs) # ExistenceProof
  • non_existence_proof.rs (from lib/unionlabs) # NonExistenceProof

generate

spec: (initial: Map<Path, Value>) => CommitmentState
impl: not implemented

calculateRoot

spec: (state: CommitmentState) => CommitmentRoot
impl: not implemented.
(NOTE: existence_proof.rs # calculate_root seems to do this, but it has an ExistenceProof as argument, not a CommitmentState)

set

spec: (state: CommitmentState, path: Path, value: Value) => CommitmentState
impl: not implemented

remove

spec (state: CommitmentState, path: Path) => CommitmentState
impl: not implemented

createMembershipProof

spec: (state: CommitmentState, path: CommitmentPath, value: Value) => CommitmentProof
impl: not implemented

createNonMembershipProof

spec: (state: CommitmentState, path: CommitmentPath) => CommitmentProof
impl: not implemented

verifyMembership

spec: (root: CommitmentRoot, proof: CommitmentProof, path: CommitmentPath, value: Value) => boolean
impl:

// verify.rs:
verify_membership(
    spec: &ProofSpec,
    root: &[u8],
    proof: &ExistenceProof,
    key: &[u8],
    value: &[u8]
) -> Result<(), VerifyMembershipError>

verifyNonMembership

spec: (root: CommitmentRoot, proof: CommitmentProof, path: CommitmentPath) => boolean
impl:

// verify.rs:
verify_membership(
    spec: &ProofSpec,
    root: &[u8],
    proof: &ExistenceProof,
    key: &[u8],
    value: &[u8],
) -> Result<(), VerifyMembershipError>

batchVerifyMembership (optional)

spec: (root: CommitmentRoot, proof: CommitmentProof, items: Map<CommitmentPath, Value>) => boolean
impl: not implemented

batchVerifyNonMembership (optional)

spec: (root: CommitmentRoot, proof: CommitmentProof, paths: Set<CommitmentPath>) => boolean
impl: not implemented