# Scalaris Framework Mitigation

The Scalaris framework addresses MEV attacks through a novel commit phase approach:

1. Transaction Collection: Validators collect all transactions in the sub-DAG of an anchor, encompassing all transactions from the previous round.
2. Fixed Transaction Set: Validators work with a predetermined set of transactions, ensuring transparency before shuffling.
3. Random Shuffling: Transactions are shuffled using a verifiable and unpredictable random seed number generated in the next round. This ensures the final transaction order cannot be predicted in advance.
4. Deterrence of Malicious Behavior: While a malicious validator may attempt to insert beneficial transactions, the unpredictable nature of the random seed prevents them from ensuring a favorable order. This significantly reduces the success of MEV attacks.

By employing these mechanisms, the Scalaris framework ensures fair and tamper-resistant transaction ordering, effectively mitigating the risk of MEV attacks and enhancing blockchain integrity.

<figure><img src="https://3615657405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqiE8JyJwtGx16yF0rZu%2Fuploads%2FZozrZSOHbtzMaRlj4DGx%2Fc4d5d464-7a4c-4c08-8f09-2c6bb58503e7.jpg?alt=media&#x26;token=06ccbab4-4aeb-41b3-a3f0-0d35b7972085" alt=""><figcaption></figcaption></figure>

In Scalaris, consider an example above in round 3 where the anchor _A2_ is chosen across all local views of the validators. The anchor examines its DAG-subgraph and gathers all transactions from vertices _V12_, _V22_, and _V32_, as well as its own anchor vertex _A2_, assuming all prior anchor vertices have recursively committed all transactions. Although attackers or malicious actors can inject any transactions in the round, by the time round 3 is reached, the transactions in _V12_, _V22_, and _V32_ have already occurred in the previous round and cannot be manipulated to alter the set of _V12_, _V22_, and _V32_.

An unpredictable random number is selected in round 3 and is used to shuffle the set of _V12_, _V22_, and _V32_, and the anchor _A2_. This mechanism effectively mitigates MEV attacks within the Scalaris consensus framework by preventing malicious actors from manipulating transaction order.
