noxed part 3: Sortition

Understanding DEXON backwards and forwards: sortition, epoch, notary selection

DEXON
DEXON
5 min readApr 11, 2019

--

noxed part 3: Sortition, Epoch change mechanism, notary selection

The Byzantine agreement is at the core of DEXON — it decides who can issue blocks and who can connect to the main chain. In the previous post, we introduced two essential features of DEXON’s Byzantine agreement: responsiveness and partition-resilience. We also explained how these features achieve fast finality and security.

For this post, we are going to answer the whys and hows of DEXON’s Byzantine agreement. Let’s start by going back to ancient Greece where sortition began.


TABLE OF CONTENTS
1. Sortition: basic definition
2. Epoch change mechanism
3. Notary selection process
4. Sortition on DEXON

Sortition

Let’s see how Wikipedia defines sortition:

In governance, sortition is the selection of political officials as a random sample from a larger pool of candidates, a system intended to ensure that all competent and interested parties have an equal chance of holding public office.

Athenians believed that sortition is democratic; though, elections can still be corrupted by oligarchs and buy their way into office. This council consists of citizens who came early, but the issue of bribery is still persistent. Then, the Athenians then built the Kleroterion machine to select citizens into a boule (council) instead.

DEXON has a built-in cryptographically secure and fair “Kleroterion machine” to select validators into a notary set on specified durations. You can consider the notary set in DEXON as the council who decides which blocks can connect to the DEXON blockchain.

Epoch change mechanism

In the previous post, we formulated the consensus problem as the “Byzantine generals problem,” three generals want to decide whether to attack a town or not. In the context of the blockchain, there is no town to be attacked, but the “generals” still need to make a decision — “ which block is to be chosen.”

So, in DEXON, who are the “generals” in the Byzantine agreement? We call the set of these generals as the “notary set.” The notary set is like a council. The representatives in the council follow the procedures of legislation and agree on a new law. Similarly, the members in the notary set follow the Byzantine agreement and determine whose block is chosen.

Like in Bitcoin and most other blockchains, DEXON’s block proposers earn cryptocurrencies through the block reward and the transaction fee (in DEXON the cryptocurrency reward is the DXN coin). However, only the members in the notary set can propose blocks, so if you’re not in the notary set, it doesn’t seem like there’s anything for you.

Don’t worry, don’t jump into conclusions just yet! Just like a council, the notary set will be re-selected for a specific time interval. In blockchain, the time is counted by block height. Currently, the notary set will be re-selected every “3,600 blocks.” For example, set 1 takes in charge of block 1 to block 3600. Then, the next set, set 2 is in charge of block 3601 to block 7200, so on and so forth. The expected block interval in DEXON is one second, so a notary set is on duty for about 1 hour (3,600 seconds).

For convenience, we call a consecutive 3,600 blocks an epoch.

Notary selection process

So how can I join the notary set? There are two steps: register and sortition.

Register

To be chosen into the notary set, you need to register first. A valid registration must satisfy two conditions:

1. Register your public key on the blockchain

2. Deposit enough DXN (currently, it is set at 1M DXN)

(see the figure below)

The reason why you need to deposit DXN is twofold. First, the threshold restricts the number of eligible candidates. Otherwise, the greedy users may register dummy accounts, so much so that other users may struggle to be chosen into the notary set.

Second, the deposit serves as a guarantee to the validator. If the members of the notary set misbehave (such as sending inconsistent messages to the Byzantine agreement), the deposit may be confiscated. This then penalizes misbehaving members and makes it more costly to misbehave that to abide by the rules.

Sortition

In practice, the network may overload if thousands of validators participate in a Byzantine agreement protocol at the same time. Our solution for this is “sortition.” Conceptually, only a limited number of validators are allowed to join a notary set.

Let’s explain how this works through a concrete example:

For each epoch, there is a unique “magic number.”

Suppose you register your public key pk and deposit DXN in (or before) epoch 99.

Then, in epoch 100, your “public key (pk)” and “the magic number of epoch 100” will be put into a sortition function, and the sortition function decides whether you are chosen to be in the notary set or not.

If you are chosen, you can join the notary set in epoch 101 and participate in the Byzantine agreement.

Concretely speaking, every user i can compute the following value:

h_i = hash(magic number, pk_i)

If the size of the notary set is n, then the n validators with the smallest h_i are chosen into the notary set for the next epoch.

What is noxed?

Noxed is a brand new learning series produced by the DEXON Foundation where we explain the ins and outs of DEXON in written, video, or visual formats. If there’s a topic about DEXON technology you want us to cover, let us know in the comments.

Upcoming

In the next post, we will focus on another critical feature of DEXON: on-chain randomness and talk about:

1. The properties of DEXON on-chain randomness

2. How the on-chain randomness is generated

3. Where the magic number comes from

Let’s talk about DEXON

You can register for the newsletter for the latest updates, or join us in our various community discussions in different platforms.

Telegram discussions: https://t.me/dexon_foundation
Announcements: https://t.me/dexon_news
Scam alerts: https://t.me/dexon_scam_alerts

👩‍💻 Gitter (DEXON’s official dev chat): https://gitter.im/dexon-foundation/Lobby
👩‍💻 Github: https://github.com/dexon-foundation
👩‍💻 Reddit: https://www.reddit.com/r/DEXONFoundation/

👉 Twitter: https://twitter.com/dexonfoundation
👉 Faceboook: https://www.facebook.com/DEXON.Foundation/
👉 YouTube: https://www.youtube.com/channel/UCbg6l4M8QmSrJphxQvKof5g
👉 Medium: https://medium.com/dexon

--

--