fix: bind address and amount in Merkle leaf for claim_with_proof - #442
Merged
kilodesodiq-arch merged 5 commits intoAug 20, 2026
Merged
Conversation
The Merkle allowlist proved membership only — a single root authorised every package sharing that root regardless of amount. The leaf was sha256(claimant_address_string) so any allowlisted address could claim any amount. Add a v2 leaf format: sha256(address_string || amount_be_bytes) that binds both recipient and package amount. Packages set merkle_leaf_version='v2' in metadata to opt in; v1 (address-only) is the default for backward compatibility. The merkle-allowlist tool is updated to generate sha256-based v2 leaves. Closes ChainForgee#436
The soroban_sdk::String type does not implement PartialEq<str>, causing a compilation error when comparing the leaf_version with a string literal. Use soroban_sdk::String comparison instead.
kilodesodiq-arch
requested changes
Aug 20, 2026
kilodesodiq-arch
left a comment
Contributor
There was a problem hiding this comment.
@portableDD please resolve conflicts.
- Integrate main's zero-dependency merkle-allowlist architecture - Keep v2 leaf format (address + amount binding) from PR ChainForgee#442 - Update sample_allowlist.json with amount fields for v2 support
5 tasks
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.
Summary
The Merkle allowlist proved membership only — a single root authorised every package sharing that root regardless of amount. The leaf was sha256(claimant_address_string) so any allowlisted address could claim any amount.
Add a v2 leaf format: sha256(address_string || amount_be_bytes) that binds both recipient and package amount. Packages set merkle_leaf_version="v2" in metadata to opt in; v1 (address-only) is the default for backward compatibility. The merkle-allowlist tool is updated to generate sha256-based v2 leaves.
Closes #436
Testing
Checklist