Summary
Update the merkle_bridge contract to validate the registry_credit_id field for both length and allowed character set before using it in Merkle leaf construction, preventing malformed or ambiguous leaves and ensuring compatibility with relayer and off-chain verification tools.
Social Media Link
Let's collaborate on Discord. And ensure to star our repo.
Technical Context
- Motivation: Unvalidated or malformed
registry_credit_id values can result in ambiguous, non-unique, or invalid Merkle leaves, breaking proof verification and interoperability. Enforcing strict validation ensures robust, predictable Merkle tree construction.
- Current State: The contract does not enforce any length or character set restrictions on
registry_credit_id.
Requirements
Contract Changes
- Define and document the allowed length range (min/max) and permitted character set for
registry_credit_id.
- During all relevant entry points (e.g., mint, bridge, proof), validate that the provided
registry_credit_id meets these constraints.
- Reject any operation with an invalid
registry_credit_id, returning a clear error message.
Acceptance Criteria
- Only valid
registry_credit_id values are accepted for Merkle leaf construction.
- Invalid values are rejected with clear errors.
- Unit tests cover:
- Attempted use of invalid (too short/long or bad charset) IDs (should fail)
- Use of valid IDs (should succeed)
Definition of Done
- PR with contract code changes and tests
- Documentation updated to describe the validation rules
- Team review completed
Working Directory:
stellar-core/verifiable-registry/contracts/merkle_bridge
Summary
Update the
merkle_bridgecontract to validate theregistry_credit_idfield for both length and allowed character set before using it in Merkle leaf construction, preventing malformed or ambiguous leaves and ensuring compatibility with relayer and off-chain verification tools.Social Media Link
Let's collaborate on Discord. And ensure to star our repo.
Technical Context
registry_credit_idvalues can result in ambiguous, non-unique, or invalid Merkle leaves, breaking proof verification and interoperability. Enforcing strict validation ensures robust, predictable Merkle tree construction.registry_credit_id.Requirements
Contract Changes
registry_credit_id.registry_credit_idmeets these constraints.registry_credit_id, returning a clear error message.Acceptance Criteria
registry_credit_idvalues are accepted for Merkle leaf construction.Definition of Done
Working Directory:
stellar-core/verifiable-registry/contracts/merkle_bridge