Skip to content

Commit

Permalink
js smt spec
Browse files Browse the repository at this point in the history
  • Loading branch information
roysc committed Feb 1, 2022
1 parent ac18e04 commit 01524ae
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions js/src/proofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ export const tendermintSpec: ics23.IProofSpec = {
},
};

export const smtSpec: ics23.IProofSpec = {
leafSpec: {
hash: ics23.HashOp.SHA256,
prehashKey: ics23.HashOp.NO_HASH,
prehashValue: ics23.HashOp.SHA256,
length: ics23.LengthOp.NO_PREFIX,
prefix: Uint8Array.from([0]),
},
innerSpec: {
childOrder: [0, 1],
childSize: 32,
minPrefixLength: 1,
maxPrefixLength: 1,
emptyChild: new Uint8Array(32),
hash: ics23.HashOp.SHA256
},
maxDepth: 256,
};

export type CommitmentRoot = Uint8Array;

// verifyExistence will throw an error if the proof doesn't link key, value -> root
Expand Down

0 comments on commit 01524ae

Please sign in to comment.