From 01524aea841a1adba20a93eaa77ed3b427f7e6a6 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 15 Dec 2021 21:42:29 +0800 Subject: [PATCH] js smt spec --- js/src/proofs.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/js/src/proofs.ts b/js/src/proofs.ts index 17ada759..3c93ce01 100644 --- a/js/src/proofs.ts +++ b/js/src/proofs.ts @@ -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