Achieving consensus in decentralized applications is a decades-old problem. To date, the topic has yielded two categories of consensus protocols: classical consensus mechanisms that rely on all-to-all communication and the Nakamoto-type consensus that relies on mathematical proofs coupled with the longest chain rule.
While classical consensus mechanisms can achieve high throughput and low latencies, they are not robust enough in addressing the centralization problem. This has relegated most of these protocols to operate largely on permissioned Blockchains and static deployments.
On the other hand, the Nakamoto-type consensus protocols are robust but suffer from low throughputs and higher latencies. For example, users must wait for about an hour to confirm their transactions on the Bitcoin network.Under such an environment, low-latency applications cannot be certain their transactions will be confirmed and must trust the spender not to double-spend.
Blockchains prevent the double-spending problem by reaching a consensus on the ordered blocks of transactions. However, achieving this consensus in a decentralized setting is difficult because any node can act in a byzantine manner, jeopardizing the whole process.
The Nakamoto-type consensus protocols such as PoW address this problem by requiring miners to repeatedly compute hashes that expand the Blockchain where the longest chain is deemed authoritative. Because of the longest chain principle, the PoW consensus protocol ensures that byzantine nodes do not gain any advantage by creating pseudonyms.
However, Nakamoto-type consensus protocols suffer from the forking problem, where two different chains with the same length can be generated, and neither one supersedes the other. Preventing this problem requires two disastrous sacrifices. First, the network must allow a reasonably large amount of time to grow the chain (e.g., 10 minutes in Bitcoin and 13 seconds in Ethereum).
Second, applications must wait for several block confirmations to guarantee that their transactions will remain on the authoritative chain. For example, Bitcoin recommends six blocks, which means an application has to wait for nearly one hour for a transaction to be confirmed.
The overarching aim of the Analog network is to deliver a high-performant, scalable, and fully decentralized ecosystem for running time-dependent DApps. The Analog network will use a pure proof-of-stake (PPoS) to achieve consensus at the initial stage. We believe the PPoS consensus protocol will help us bootstrap the network and grow the number of time nodes.
Once we have achieved the required number of time nodes, we will transition to a hybrid of PPoS and PoT as the primary engines driving the consensus processes on the Analog network. This will allow the platform to achieve low latency and scale to many users without the possibility of forks.
Elements of PPoS Consensus
While our PPoS consensus protocol is inspired by PoS approaches, it is actually different. The Analog network assigns weights to time nodes proportionally to the $ANLOG tokens held into their accounts and RSs. In many typical PoS approaches, a malicious staker who deliberately creates a fork in the network gets penalized by losing the locked funds.
In contrast, the assigned weights in the Analog network only ensure that the adversarial node cannot amplify its power via pseudonyms to create Sybil attacks. In the initial stages of the network’s launch, the platform will still be robust as long as the adversarial nodes control less than a third of the monetary value.
Below are essential components of the Analog network’s consensus protocol:
Weighted time nodes
We have designed the hybrid consensus protocol to guarantee consensus provided a weighted fraction (a constant greater than two-thirds) of all the time nodes are honest. To prevent time nodes from acting in a byzantine manner, the network will initially assign a weight to each time node based on the amount of $ANLOG tokens the node has staked in its account.
This way, the network avoids double-spending and forks as long as the honest time nodes hold a supermajority (more than two-thirds) of $ANLOG tokens. Interested users can stake their $ANLOG tokens to become the earliest validators of time data on the Analog network. This will help bootstrap the network and secure it from Sybil attacks.
As the platform evolves, we will introduce RSs (described in the next section) to help detect and punish malicious time nodes that may attempt to validate fake time data. In the event that a time node verifies a fake block of time data and consensus nodes vote to reject the block, the network downgrades the time node’s RS.
This means such a time node has fewer chances of being selected to validate time data in the future, consequently losing out on the $ANLOG token earnings. To get selected as a time node, the network uses a weighted lottery scheme with two essential variables as its inputs: staked $ANLOG tokens and RS.
Consensus by Committee
We have designed the PPoS as a robust Byzantine Fault Tolerance (BFT) protocol that can withstand Sybil attacks. The network will initially use verifiable random function (VRF) to randomly select a smaller set of 1,000 consensus nodes to run each protocol step that verifies proposed time data blocks.
The platform will randomly choose these committee members (consensus committee) among all the network nodes based on their staked $ANLOG tokens. All other nodes (time nodes and archive nodes) observe the protocol messages, allowing them to determine the status of the agreed Timechain.
However, as the network evolves, we will replace VRF with random validator sub-sampling (described in the next section), which is more scalable and secure.