Skip to content

Fix proof of non-inclusion in SMT Proof Verification algorithm - #320

Merged
jintekc merged 1 commit into
mainfrom
fix/smt-proof-of-non-inclusion
Jul 1, 2026
Merged

Fix proof of non-inclusion in SMT Proof Verification algorithm#320
jintekc merged 1 commit into
mainfrom
fix/smt-proof-of-non-inclusion

Conversation

@parasyte

Copy link
Copy Markdown
Collaborator

This was discussed in #319 (comment)

Adds support for non-inclusion proofs to the algorithm description and pseudocode. Fixes some minor syntactic errors (missing semicolons) and slightly improves readability with whitespace.

The cachedZero pseudocode was also updated to use n as the index variable name to better match the longer pseudocode.

And today I learned that mdBook's smart-punctuation option allows rendering em dashes with triple-hyphens. https://rust-lang.github.io/mdBook/format/markdown.html#smart-punctuation Em dashes looked better than parentheses and commas.

This was discussed in #319 (comment)

Adds support for non-inclusion proofs to the algorithm description and pseudocode.
Fixes some minor syntactic errors (missing semicolons) and slightly improves
readability with whitespace.

The `cachedZero` pseudocode was also updated to use `n` as the index variable name to
better match the longer pseudocode.

And today I learned that mdBook's `smart-punctuation` option allows rendering em dashes
with triple-hyphens. https://rust-lang.github.io/mdBook/format/markdown.html#smart-punctuation
Em dashes looked better than parentheses and commas.
@parasyte
parasyte requested review from danpape and jintekc June 16, 2026 22:38
@parasyte

Copy link
Copy Markdown
Collaborator Author

Another change I made that I forgot to note: The bit-indexing was replaced with a .bitAt() method. I can't explain why I used camelCase, but there it is. I can change it to snake_case if preferred. I think the method's intention is clear without additional commentary, but maybe it needs some extra exposition.

Comment thread src/algorithms.md
@jintekc

jintekc commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

on a separate and unrelated note. I think nonce should be REQUIRED, not OPTIONAL in data-structures.md. Both leaf-value branches compute hash(hash(proof.nonce)), so every proof needs the nonce. Maybe we could sneak that into this PR as well.

@danpape

danpape commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

on a separate and unrelated note. I think nonce should be REQUIRED, not OPTIONAL ...

Hmm, yeah, we did write it like

nonce: OPTIONAL 256-bit nonce generated for each update. MUST be encoded as a string ...

I sure don't remember whatever discussion we had last year about why this might be optional or not, but it does seem like we kind of require it now.

@parasyte

Copy link
Copy Markdown
Collaborator Author

nonce was made optional because it bloats proofs when the additional privacy isn't needed. A proof of non-inclusion is slightly smaller without a nonce, and as the number of aggregate update rounds increases, it can eventually create a huge number of proofs, almost all of them non-inclusions.

@rxgrant had some thoughts on this, specifically.

I don't have a problem with it either way. The nonce is not required for security. It increases privacy by making all proofs (including non-inclusion) indistinguishable from proofs of inclusion. Whether that privacy is useful is an end-user decision.

@jintekc
jintekc merged commit 5cd7927 into main Jul 1, 2026
1 check passed
@jintekc
jintekc deleted the fix/smt-proof-of-non-inclusion branch July 1, 2026 15:39
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.

3 participants