Challenge System
The challenge process is a critical security mechanism in the Mach protocol, ensuring the integrity and safety of cross-chain transactions by addressing discrepancies between different blockchains. This serves as a safeguard against errors, fraud, or any inconsistencies that might arise during the transaction process.How the Challenge Process Works
When a proposed match is made, the protocol processes it optimistically, meaning it proceeds before the transaction is fully settled on both chains. This approach requires an extra layer of security to address any potential issues.
The challenge system, powered by LayerZero, automatically monitors transactions for discrepancies.
Detection and Response
If an issue is detected, the system takes immediate action:- Issue Detection: The system identifies a potential problem with a transaction.
- Process Locking: All processes are locked to prevent any further actions.
- Challenge Initiation: A challenge is immediately initiated.
Verification Process
During a challenge, funds are temporarily frozen to prevent any further actions until the issue is resolved:- Cross-Chain Verification: A LayerZero transaction is sent to the destination chain to verify the existence of the order.
- Order Validation: The system checks if the challenged order is present and valid on the destination chain.
Resolution
Once the verification is complete and the challenge is resolved, the funds are either released or reallocated based on the outcome:- Validated Orders: If the order is validated, the frozen funds are made available for the intended transaction.
- Invalid Orders: If the order is found to be invalid, the funds are returned to the original sender.