# 005 | DEXON | Total Ordering | Programmer Explain

## How DEXON works under the hood — 2/4

Published in

--

In 『004 | DEXON | Overview of DEXON| Programmer Explain』, I have helped you understand the big picture on how DEXON work with many blackboxes.

One of the important component that makes DEXON fast, with「TPS 12,000」 is because of its「Total Ordering Algorithm」which makes running multiple chains in parallel, possible.

In order to generate a 「globally-ordered chain」 which contains all the valid blocks that have been produced on the DEXON Network, each node executes the ​DEXON 「Total Ordering Algorithm」​ and gives each blocks a timestamp. As a result, each node will maintain a copy of the globally-ordered data, called ​DEXON 「compaction chain」.

What makes 「Total Ordering Algorithm」so special is that even if some of the Validation-Nodes are not acting as they should (like unstable internet connection/being a malicious attacker), DEXON will still have a「 globally-ordered chain」.

`DEXON network will still run securely with malicious Node/NodesDefinition of "Run Securely":a copy of the globally-ordered data is still maintained`

Sounds amazing? Let’s dive in!

Goal:
to maintain/ensure the total ordered chain

Input:
blocklattice structure data(multi chains structure with blocks’ acks)

Output:
total-ordered chain

Step 1

To choose a Candidate Block
Qualification as a candidate block
- A block that has not been delivered to total ordering output
- A block that is not acking any other non-delivered blocks

Step 2

After we have candidate blocks, we will use 「Potential Function」 + 「Output Threshold 」for outputting blocks to total-ordered/compaction chain.

Potential Function
Describe the output priority of the Candidate Block
The more acks received by a block, the higher the potential value is.
Once the potential value of a certain block exceeds a specific threshold, the block will be delivered to the compaction chain.

Output Threshold
Ensure the priority of output block cannot be exceeded by other blocks

Once a block is placed into compaction chain, that block would be shown on 「DEXSCAN

Free to join DEXON social groups
Telegram/Gitter/Github/Reddit