fix POI spentTXO filtering by tree to prevent cross-tree nullifier co…#132
Merged
jacobmakarsky merged 1 commit intomainfrom Apr 6, 2026
Merged
fix POI spentTXO filtering by tree to prevent cross-tree nullifier co…#132jacobmakarsky merged 1 commit intomainfrom
jacobmakarsky merged 1 commit intomainfrom
Conversation
mesquka
approved these changes
Apr 6, 2026
Collaborator
mesquka
left a comment
There was a problem hiding this comment.
Changes look minimal, test coverage update good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to PR #130. The same class of bug, cross-tree nullifier collision, was causing POI proof generation to fail.
The Problem
In generatePOIsAllSentCommitmentsAndUnshieldEvents, spent TXOs were filtered by nullifier value alone without scoping by tree. When the same nullifier exists across multiple trees, find() returns the first match, which may be from the wrong tree. The POI proof is then generated against the wrong commitment data, causing the merkle proof to fail.
The Fix
Extracted POI.filterSpentTXOs() to filter by both nullifier value and utxoTreeIn, ensuring the correct tree's TXOs are selected.
Updated both call sites: abstract-wallet.ts and poi-status-formatter.ts.
Added poi-nullifier-collision.test.ts with tests covering collision, ordering, and non-collision scenarios.