Message validation is the security foundation of TAC’s cross-chain system. It ensures that every message crossing between TON and TAC EVM is authentic, authorized, and properly formatted before execution. Understanding validation helps developers build secure applications and troubleshoot validation failures.

Validation Philosophy

TAC’s validation system operates on the principle of “trust but verify” - while sequencers are trusted entities, every claim they make is independently verifiable through cryptographic proofs and consensus mechanisms.

Multi-layer validation ensuring message integrity throughout the cross-chain process

Validation Layers

Message validation occurs at multiple layers, each providing different security guarantees and catching different types of potential issues.

Client-Side Pre-Validation

Before messages even enter the cross-chain system, the TAC SDK performs initial validation to catch obvious errors early.

Sequencer Validation

Sequencers perform the most comprehensive validation of cross-chain messages before including them in consensus.

Asset Transfer Verification

  • Onchain Confirmation: Sequencers verify that claimed asset transfers actually occurred by examining on-chain transaction data.

    // Sequencers validate that actual transfers match message claims
    const messageAssets = extractAssetsFromMessage(crossChainMessage);
    const actualTransfers = getOnChainTransfers(tonTransaction);
    
    // Amounts must match exactly
    validateAssetAmounts(messageAssets, actualTransfers);
    
  • Transfer Authenticity: Each asset transfer is verified against the actual TON blockchain state to prevent false claims.

  • Sender Authorization: Sequencers confirm that the message sender is the same entity that authorized the asset transfers.

Message Integrity Validation

  • Internal Consistency: All message parameters are checked for internal consistency and logical coherence.
  • Target Validation: Target contract addresses are validated to ensure they exist and are properly configured.
  • Method Existence: EVM method names are validated against target contracts when possible to prevent call failures.

Consensus Validation

The consensus layer provides the final validation through cryptographic proofs and multi-party agreement.

Group Consensus Requirements

  • Internal Agreement: Within each sequencer group, 3/5 of members must agree on message validity before the group can participate in network consensus.

  • Cross-Validation: Different sequencer groups independently validate the same messages, providing redundant verification.

  • Threshold Security: The high consensus threshold (3/5) ensures that temporary disagreements or individual failures don’t prevent legitimate operations.

Cryptographic Validation

Economic Validation

Beyond technical validation, economic incentives ensure that validators have strong reasons to validate messages correctly.

Stake-Based Security

  • Collateral Requirements: Sequencers must stake significant collateral to participate in validation, creating financial incentives for honest behavior.

  • Slashing Mechanisms: Provably incorrect validation results in automatic collateral slashing, making attacks economically unattractive.

  • Reward Distribution: Correct validation is rewarded through fee sharing and protocol incentives.

Economic Game Theory

Attack Costs

  • High Barriers: The cost of coordinating attacks across multiple staked sequencer groups is economically prohibitive.
  • Detection Guarantees: Cryptographic proofs ensure that any attempt to validate false messages is immediately detectable.

Honest Incentives

  • Ongoing Rewards: Honest sequencers receive continuous rewards for reliable validation service.
  • Reputation Effects: Poor validation performance affects future participation and profitability.

Validation Failure Handling

When messages fail validation at any stage, the system implements protective measures to prevent asset loss and provide clear feedback.

Pre-Consensus Failures

  • Early Detection: Messages that fail initial validation are rejected before entering the consensus system, saving time and resources.

  • Error Reporting: Detailed error messages help developers understand and fix validation issues quickly.

  • Asset Protection: Failed validation prevents asset transfers from occurring, protecting user funds.

Consensus-Level Failures

If messages fail validation during consensus, automatic rollback procedures ensure user assets are protected.

  • Rollback Triggers: Consensus failures automatically trigger rollback message creation to return assets safely.

  • Protected Recovery: The rollback process uses the same validation and consensus mechanisms to ensure secure asset recovery.

  • Status Reporting: Failed validation is clearly reported through the status tracking system with specific error information.

Validation Performance

The validation system is designed to balance security with reasonable performance for application use cases.

Validation Efficiency

  • Parallel Processing: Multiple sequencers validate messages in parallel, providing redundancy without significantly impacting speed.

  • Optimized Algorithms: Validation algorithms are optimized for the specific types of checks required for cross-chain messages.

  • Batched Validation: Messages are validated in batches during epoch processing for improved efficiency.

Performance Monitoring

  • Stage Tracking: The validation time for each stage is tracked and can be monitored for performance optimization.
  • Bottleneck Identification: Performance monitoring helps identify validation bottlenecks and optimization opportunities.
  • Network Health: Validation performance serves as an indicator of overall network health and capacity.

Validation Error Types

Understanding common validation errors helps developers build more robust applications.

Common Client-Side Errors

Sequencer Validation Errors

  • Asset Mismatch: Claimed asset transfers don’t match actual on-chain transfers.

  • Timestamp Issues: Message timestamps don’t align with actual TON block timestamps.

  • Signature Problems: Invalid or missing signatures on transaction authorizations.

  • Target Issues: Target contracts don’t exist or don’t implement required methods.

Consensus Validation Errors

  • Insufficient Consensus: Not enough sequencer groups agree on message validity.

  • Proof Failures: Merkle proofs don’t validate correctly against submitted root hashes.

  • Economic Violations: Operations would violate economic security constraints.

Best Practices for Developers

Preventing Validation Errors

  • Client-Side Checks: Implement comprehensive client-side validation before submitting cross-chain messages.
  • User Feedback: Provide clear error messages that help users understand and fix validation issues.
  • Pre-Submission Testing: Test message parameters against validation rules before final submission.

Monitoring Validation Health

  • Error Rate Monitoring: Track validation error rates to identify systematic issues or degrading conditions.

  • Performance Tracking: Monitor validation performance to ensure acceptable user experience.

  • Success Metrics: Track successful validation rates as a key health indicator for applications.

Validation in Different Contexts

Development vs Production

Development Validation

  • Relaxed Constraints: Development networks may have more relaxed validation for testing purposes.
  • Enhanced Debugging: Additional validation information and logging for debugging.
  • Simulation Tools: Validation simulation tools help test message formatting before submission.

Production Validation

  • Strict Requirements: Production validation enforces all security constraints rigorously.
  • Performance Optimization: Validation is optimized for speed while maintaining security.
  • Economic Enforcement: Full economic security measures are active in production.

Different Message Types

  • Simple Transfers: Basic asset transfers have streamlined validation focused on balance and authorization checks.

  • Complex Operations: Multi-step operations require additional validation of operation sequencing and parameter consistency.

  • Return Messages: Messages returning from EVM to TON have specialized validation for burn-and-release operations.

What’s Next?

Understanding message validation provides the security foundation for exploring TAC’s token economic models and operational patterns.