docs: add cross chain verifier standard#363
Open
Amas-01 wants to merge 1 commit into
Open
Conversation
|
@Amas-01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
db9dbc4 to
a56507b
Compare
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.
PR: Document Cross Chain Verifier Standard
Closes #328
Summary
This PR adds comprehensive documentation for the Cross Chain Verifier Standard, defining how external bridges must format messages for verification on Soroban. The standard ensures interoperability between different bridge implementations and provides a consistent security model for cross-chain message verification.
Purpose
The Cross Chain Verifier contract uses Binary Merkle Tree proofs to cryptographically verify that messages occurred on source chains. Without a documented standard, bridge implementers would need to reverse-engineer the expected format, leading to:
This documentation solves these problems by providing a clear, complete specification.
What's Included
1. Message Structure Definition
The document defines the four required components for cross-chain message verification:
u32): Source chain block identifierBytesN<32>): SHA-256 hash of the message payloadVec<BytesN<32>>): Sibling hashes forming the proof pathVec<bool>): Sibling position indicators (left/right)2. Formatting Rules
Detailed specifications for:
3. Validation Rules
Documents all validation checks performed by the verifier:
4. Security Considerations
Comprehensive security analysis including:
5. Versioning and Compatibility
Forward-looking guidance on:
6. Practical Examples
Three complete examples:
7. Implementation Checklists
Separate checklists for:
Alignment with Existing Code
The documentation is based on careful analysis of:
contracts/cross_chain_verifier/src/lib.rs: Contract implementationcontracts/cross_chain_verifier/src/test.rs: Test cases and examplesdocs/directoryAll technical details match the actual contract behavior:
verify_message()implementationDocumentation Quality
The document follows SoroScope documentation conventions:
File Changes
New Files
docs/CROSS_CHAIN_VERIFIER_STANDARD.md(650+ lines)docs/CROSS_CHAIN_VERIFIER_PR.md(this file)Modified Files
docs/DOCUMENTATION_INDEX.mdTarget Audience
This documentation serves multiple audiences:
Benefits
For Bridge Implementers
For the Ecosystem
For SoroScope
Testing and Validation
The documentation has been validated against:
lib.rstest.rsFuture Enhancements
The standard is designed to evolve. Potential future additions:
The versioning section provides a clear path for these enhancements without breaking existing implementations.
Compatibility Notes
This documentation describes the existing Cross Chain Verifier contract behavior. It does not introduce breaking changes or require contract modifications. Bridges can immediately use this standard to integrate with the deployed verifier.
Review Focus Areas
Reviewers should pay special attention to:
Checklist