Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[confidential-transfer] RangeProofs commitment-length checks are inconsistent (Neodyme Nit N04) #133

Open
samkim-crypto opened this issue Jan 28, 2025 · 0 comments

Comments

@samkim-crypto
Copy link
Contributor

When parsing a rangeproofs into a BatchedRangeProofContext, you always get exactly 8 commitments, enforced by the type-system. This is crucial for security right now, as you later .zip those together with expected commitments, and zip early-aborts when the first iterator is done (e.g. in MintProofContext::verify_and_extract). This could use a comment on the .zip.

In WithdrawProofContext, you have an additional check:

if range_proof_commitments.is_empty()

This isn't required, as there are always exactly 8 fields in there. Gave me a bit of a heart-attack at first though where I briefly thought the other .zip iterators are broken :p

I'd recommend adding a small comment why the .zip is guaranteed to go over all intended pairs. Providing too few signatures is something we have fairly often seen with other protocols, and commitments here are similar.

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

No branches or pull requests

1 participant