Skip to content

mpt: Remove val from inclusion proof#75

Open
rozbb wants to merge 1 commit into
FiloSottile:mainfrom
rozbb:mpt/inclusion-noval
Open

mpt: Remove val from inclusion proof#75
rozbb wants to merge 1 commit into
FiloSottile:mainfrom
rozbb:mpt/inclusion-noval

Conversation

@rozbb

@rozbb rozbb commented Jun 15, 2026

Copy link
Copy Markdown

Ported from rsc/tmp#21

We've been basing WAICT's transparency log on this MPT design (our spec uses a more functional-style def, but it's identical). In our inclusion proofs, we serve leaf data that the client then hashes to get the leaf val. For us, there is no reason for the MPT inclusion proof to also have a copy of val. At best, it is a redundancy, and at worst it is a potential area for implementations to differ on behavior.

More generally, I suspect anyone using this MPT structure will have their own way of conveying the value of a leaf. So I think val should be left outside the proof.

This PR removes val from MPT inclusion proofs, and updates the implementation accordingly. I've also taken the liberty of breaking up the Verify function into VerifyInclusion and VerifyNoninclusion, since they inherently have different type signatures and I didn't see a need to have them unified as one function (I've never seen a use case where a client doesn't know which one to expect). Also I removed the val return value from VerifyNoninclusion since it's not clear what someone would do with the value of a key adjacent to the one being queried.

Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant