XRPL Protocol: Consensus, Forking and Correctness
摘要
While the first bitcoin was launched on 3 Jan 2009 with the creation of the genesis block, XRP, formerly called XNS, a cryptocurrency affiliated with Ripple Labs., was launched on 2 June 2012. XRP was introduced by Ripple Labs., as a bridge currency in its’ solutions because of its’ speed, efficiency and reliability with the intention of making it ideal for financial use cases like payment systems. While most general consensus algorithms have been based directly or indirectly on the Byzantine fault tolerant algorithm (BFT), the two widely used consensus approaches used in blockchain platforms are the proof-of-work (PoW) and the proof-of-stake (PoS). The initial design of the XRP consensus protocol was referred to as Ripple Protocol consensus algorithm (RPCA). It is based on the BFT agreement protocol but does not use standard models of implementation like PoW or PoS, but utilizes collectively-trusted sub-networks within a large network; it is often referred to as proof-of-association (PoA) where consensus is achieved by maintaining a certain level of “trust” for the sub-networks and a certain minimal connectivity throughout the network(We use the following abbreviations to avoid any confusion: XRP ledger is a decentralized public blockchain that is open source and powered by global developer community that uses XRP as the native cryptocurrency or the digital token; the underlying network of the XRP ledger is referred to as XRP network.) so that it remains robust in spite of Byzantine failures. For each server in the XRP network, there is a sub-network of validators, referred to as the Unique Node List (UNL) consisting of a subset of the servers of the network leading to realize performance and safety through the enforcement of a certain percentage of overlap of the nodes among UNLs. Such a consensus protocol for XRP network is referred to as XRPL ledger consensus protocol (abbreviated XRPL). XRPL demands 80% quorum and a certain percentage of overlap of nodes among the UNLs to realize robustness. The overlap was initially specified to be 20% that was increased to 40%; which was further enhanced to be greater than 90% to satisfy conditions of safety and liveness. However, even with such an enhancement, it has been shown that safety and liveness are not guaranteed. In this paper, we characterize, the XRPL for consensus correctness using a notion of similarity metric called rand-index (RI) used for cluster analysis of networks. We establish that XRPL with 80% quorum (as per the XRPL original specifications) and UNLs satisfying 50% RI similarity, is robust against 20% failures; i.e., no fraudulent transactions will be accepted by the network. Further, the network is said to satisfy consensus correctness, if the UNLs of the network are more than 50% RI similar which would imply at least 80% quorum across all the UNLs. In other words, we establish that instead of just an overlap of the nodes, it is necessary to guarantee how well the UNLs are bound with each other to realize the need of fault tolerance (note that XRPL specifies/permits at most 20% failures), safety and liveness. That is, the results succinctly bring out a characterization of the notion of overlap that has been used in the XRP network for safety and robustness highlighting the need to check \(n^2\) overlaps for safety rather than just n overlaps. To understand the clairvoyance that has been embodied in the XRPL ledger consensus right from the beginning to attain safety, and performance, we shall take a comparative look at the underlying common theme of quorum in consensus protocols like proof-of-authority, PoA and PoS systems in the context of blockchain trilemma introduced much later by Vitalik Buterin.