Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions go/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ var SmtSpec = &ProofSpec{
PrehashKeyBeforeComparison: true,
}

// JmtSpec constrains the format for JMT proofs (as implemented by https://github.com/penumbra-zone/jmt)
var JmtSpec = &ProofSpec{
LeafSpec: &LeafOp{
Hash: HashOp_SHA256,
PrehashKey: HashOp_SHA256,
PrehashValue: HashOp_SHA256,
Length: LengthOp_NO_PREFIX,
Prefix: []byte("JMT::LeafNode"),
},
InnerSpec: &InnerSpec{
Hash: HashOp_SHA256,
ChildOrder: []int32{0, 1},
MinPrefixLength: 16,
MaxPrefixLength: 16,
ChildSize: 32,
EmptyChild: []byte("SPARSE_MERKLE_PLACEHOLDER_HASH__"),
},
MinDepth: 0,
MaxDepth: 64,
PrehashKeyBeforeComparison: true,
}

func encodeVarintProto(l int) []byte {
// avoid multiple allocs for normal case
res := make([]byte, 0, 8)
Expand Down
Loading