> For the complete documentation index, see [llms.txt](https://ctex-network.gitbook.io/technical-paper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctex-network.gitbook.io/technical-paper/dpos-formula.md).

# DPoS Formula

Delegated Proof of Stake (DPoS) is a consensus mechanism that aims to achieve agreement among network participants in a decentralized manner. While DPoS typically involves voting and reputation-based systems rather than mathematical formulas like those found in traditional consensus algorithms, we can still describe some aspects of DPoS using mathematical notation.

Let's define some terms:

* $$�N$$: Total number of validators in the network.
* $$�V$$: Number of tokens held by a validator.
* $$�T$$: Total number of tokens in the network.
* $$�f$$: Fraction of total tokens staked by a validator ($$�=��f=TV​$$).
* $$�λ$$: Threshold parameter representing the minimum fraction of tokens required to produce a block.
* $$�θ$$: Threshold parameter representing the minimum fraction of validators needed to agree on a block.

Now, let's describe the DPoS process with some mathematical concepts:

1. Block Production Threshold ($$�λ$$): In DPoS, a validator must stake a certain minimum number of tokens to be eligible to produce a block. This threshold ($$�λ$$) represents the minimum fraction of tokens required to participate in block production. Mathematically, it can be represented as: $$�=Minimum fraction of total tokens required to produce a blockλ=Minimum fraction of total tokens required to produce a block$$
2. Agreement Threshold ($$�θ$$): DPoS requires a certain percentage of validators to agree on the validity of a block before it is added to the blockchain. This agreement threshold ($$�θ$$) represents the minimum fraction of validators needed to reach consensus. Mathematically, it can be represented as: $$�=Minimum fraction of validators needed to agree on a blockθ=Minimum fraction of validators needed to agree on a block$$
3. Validator's Staked Tokens ($$�f$$): Each validator in DPoS must stake a certain number of tokens to participate in block production. The fraction of total tokens staked by a validator ($$�f$$) can be calculated as the ratio of tokens held by the validator to the total number of tokens in the network: $$�=��f=TV​$$

These mathematical representations provide a conceptual understanding of how DPoS operates with threshold parameters and token fractions. However, it's important to note that DPoS also involves non-mathematical aspects such as voting, reputation, and governance mechanisms, which play a crucial role in achieving consensus in decentralized networks.

<br>
