อัลกอริทึมฉันทามติของโปรโตคอล Ripple

The Ripple Protocol Consensus Algorithm

著 David Schwartz, Noah Youngs and Arthur Britto · 2014

Abstract

While several consensus algorithms exist for the Byzantine Generals Problem, specifically as it pertains to distributed payment systems, many suffer from high latency induced by the requirement that all nodes within the network communicate synchronously. In this work, we present a novel consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks within the larger network. We show that the "trust" required of these subnetworks is in fact minimal and can be further reduced with principled selection of the member nodes.

The Ripple Protocol Consensus Algorithm (RPCA) is applied every few seconds by all nodes in the network, in order to maintain the correctness and agreement of the network. Once consensus is reached, the current ledger is considered "closed" and becomes the last-closed ledger. Assuming that the consensus algorithm is successful, and there are no forks in the network, the last-closed ledger maintained by all nodes in the network will be identical.

This algorithm achieves consensus with remarkably low latency — typically 3 to 5 seconds per ledger close — while maintaining provable safety guarantees against Byzantine failures. Unlike proof-of-work systems that require massive computational expenditure and suffer from probabilistic finality that may take an hour to become practically irreversible, RPCA provides deterministic finality: once a ledger is closed, it will not be reversed. This property makes the protocol suitable for real-time financial settlement, where counterparties need certainty that a payment has been completed before proceeding with dependent operations.

The key insight is that consensus does not require global trust. Each node in the network maintains a Unique Node List (UNL) — a set of other nodes that it trusts not to collude in an attempt to defraud the network. As long as these UNLs have sufficient pairwise overlap and the fraction of Byzantine nodes within any UNL remains below a critical threshold, the network as a whole will reach agreement on a single consistent ledger. This localized trust model allows the network to scale without requiring every participant to trust every other participant, while still providing the safety guarantees necessary for a global payment system.

Abstract

แม้ว่าจะมีอัลกอริทึมฉันทามติหลายแบบสำหรับปัญหานายพลไบแซนไทน์ โดยเฉพาะในบริบทของระบบการชำระเงินแบบกระจาย แต่หลายแนวทางยังมีความหน่วงสูงจากข้อกำหนดที่ว่าโหนดทั้งหมดในเครือข่ายต้องสื่อสารกันแบบซิงโครนัส งานนี้นำเสนออัลกอริทึมฉันทามติแบบใหม่ที่หลีกเลี่ยงข้อกำหนดดังกล่าว โดยอาศัยเครือข่ายย่อยที่ได้รับความไว้วางใจร่วมกันภายในเครือข่ายขนาดใหญ่กว่า เราแสดงให้เห็นว่า "ความไว้วางใจ" ที่จำเป็นต่อการป้องกันการโจมตี Sybil ไม่ได้เป็นแบบทั่วโลก แต่เป็นแบบเฉพาะที่ในระดับแต่ละโหนด

Ripple Protocol Consensus Algorithm (RPCA) ถูกนำมาใช้ทุก ๆ ไม่กี่วินาทีโดยทุกโหนด เพื่อรักษาความถูกต้องและความสอดคล้องของเครือข่าย เมื่อได้ฉันทามติแล้ว ledger ปัจจุบันจะถือว่า "ปิด" และกลายเป็น last-closed ledger อัลกอริทึมนี้โดดเด่นตรงที่ให้ฉันทามติได้ด้วยความหน่วงต่ำ ขณะยังคงการรับประกันที่แข็งแรงต่อความล้มเหลวแบบ Byzantine จึงเหมาะกับระบบชำระบัญชีทางการเงินแบบเรียลไทม์

Introduction

The nature of payment systems in the modern world is changing rapidly. Digital currencies and online payment networks have emerged as alternatives to traditional banking infrastructure, promising lower transaction costs, faster settlement times, and broader financial inclusion. However, these systems face a fundamental challenge: how to process payments correctly, quickly, and securely in a network where participants may not trust each other and where some participants may behave maliciously.

The Bitcoin protocol, introduced by Nakamoto in 2008, demonstrated that a distributed payment system could operate without a trusted central authority by using a proof-of-work consensus mechanism. In Bitcoin, nodes compete to solve computationally expensive cryptographic puzzles, and the winner proposes the next block of transactions. While this approach elegantly solves the double-spending problem, it introduces significant practical limitations. The energy consumption of Bitcoin mining is enormous — estimated at the time of writing at over $150 million per year — and the confirmation latency for transactions is measured in minutes to hours rather than seconds. For a high-value transaction, the recommended practice is to wait for six block confirmations, which takes approximately one hour on average. These limitations make proof-of-work consensus unsuitable for many real-world payment applications.

The core problem is that proof-of-work conflates two distinct concerns: Sybil resistance (preventing an attacker from gaining disproportionate influence by creating many identities) and consensus (agreeing on the state of the ledger). By tying both concerns to computational expenditure, proof-of-work achieves security at the cost of efficiency. The Ripple protocol decouples these concerns by using a different mechanism for Sybil resistance — the node-list/" class="glossary-link" data-slug="unique-node-list" title="Unique Node List">Unique Node List — and a separate iterative voting protocol for consensus. This decoupling allows the consensus algorithm to be both fast and efficient, as it does not need to perform any computationally expensive work.

In this paper, we present the Ripple Protocol Consensus Algorithm and provide formal analysis of its correctness and convergence properties. We define the conditions under which the algorithm guarantees safety (no two honest nodes will accept conflicting ledgers) and liveness (the network will continue to make progress). We then analyze the requirements on UNL overlap and Byzantine node thresholds that are sufficient to maintain these guarantees. Finally, we present simulation results that validate the theoretical analysis and demonstrate the algorithm's performance under a variety of network conditions and adversarial scenarios.

The remainder of the paper is organized as follows. Section 2 provides formal definitions of the key concepts used throughout the paper. Section 3 surveys existing consensus algorithms and their limitations. Section 4 presents the RPCA algorithm in detail. Section 5 provides a formal analysis of convergence. Section 6 discusses the properties and selection of Unique Node Lists. Section 7 describes the simulation framework and results. Section 8 discusses the implications and trade-offs of the design, and Section 9 concludes.

Introduction

ระบบการชำระเงินแบบกระจายจำเป็นต้องมีอัลกอริทึมฉันทามติเพื่อประมวลผลการชำระเงินให้ถูกต้องและทันเวลา แม้ในสภาพที่มีผู้มีส่วนร่วมที่ผิดพลาดหรือประสงค์ร้าย Bitcoin บรรลุฉันทามติด้วย proof-of-work ซึ่งกำหนดให้ทุกโหนดใช้ทรัพยากรคอมพิวเตอร์ในการแก้ปริศนาการเข้ารหัส แม้วิธีนี้จะให้การรับประกันความปลอดภัยที่แข็งแรง แต่ก็มีข้อเสียสำคัญ ได้แก่ การใช้พลังงานสูง ปริมาณธุรกรรมต่อเวลาต่ำ และความหน่วงในการยืนยันที่ยาวนาน ซึ่งอาจนานถึงหนึ่งชั่วโมงหรือมากกว่านั้นสำหรับธุรกรรมมูลค่าสูง

Ripple Protocol Consensus Algorithm เสนอแนวทางใหม่ของฉันทามติแบบกระจายที่ไม่ต้องอาศัย proof-of-work แทนที่จะทำเช่นนั้น โหนดในเครือข่ายจะร่วมกันตกลงบนชุดธุรกรรมผ่านกระบวนการโหวตที่ได้ฉันทามติภายในไม่กี่วินาที กลไกนี้ออกแบบมาโดยเฉพาะสำหรับข้อกำหนดของเครือข่ายการชำระเงินระดับโลก ซึ่งความหน่วงต่ำและปริมาณงานสูงเป็นเงื่อนไขสำคัญต่อการใช้งานจริง

นวัตกรรมหลักของ RPCA คือไม่ต้องให้ทุกโหนดในเครือข่ายเห็นพ้องกันทั้งหมด แต่ให้แต่ละโหนดเก็บ Unique Node List (UNL) ของโหนดอื่นที่ตนเชื่อว่าจะไม่สมรู้ร่วมคิด ตราบใดที่ UNL ของโหนดต่าง ๆ มีการทับซ้อนเพียงพอ และจำนวนโหนดที่ผิดพลาดต่ำกว่าเกณฑ์ที่กำหนด เครือข่ายจะบรรลุฉันทามติได้ แนวทางนี้ให้การรับประกันความปลอดภัยที่ระบบการชำระเงินต้องการ พร้อมกับความหน่วงฉันทามติระดับวินาทีแทนนาทีหรือชั่วโมง

Definition of Consensus

We begin with formal definitions of the terms and concepts used throughout this paper. These definitions establish the precise framework within which we analyze the correctness and performance of the consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="Ripple Protocol Consensus Algorithm">Ripple Protocol Consensus Algorithm.

Server. A server is any entity running the Ripple server software that participates in the consensus process. Each server maintains a copy of the ledger and communicates with other servers to reach agreement on new transactions. Servers may be operated by financial institutions, businesses, or individuals. A server may be correct (following the protocol faithfully) or Byzantine (behaving arbitrarily, possibly maliciously).

Ledger. The ledger is the complete record of all account balances and other state in the Ripple network. The ledger is organized as a set of account objects, each containing a balance denominated in one or more currencies, along with metadata such as trust lines, offers, and other protocol-level state. At any point in time, the ledger represents the authoritative state of the network.

Last-Closed Ledger. The last-closed ledger (LCL) is the most recent ledger that has been agreed upon by the consensus process. All servers that have successfully completed the most recent consensus round will have an identical LCL. The LCL serves as the base state from which the next round of consensus builds — new transactions are applied to the LCL to produce the next candidate ledger.

Open Ledger. The open ledger is the current working copy of the ledger that a server uses to process incoming transactions before the next consensus round begins. Each server maintains its own open ledger, which includes the LCL state plus any new transactions that the server has received but that have not yet been included in a closed ledger. Open ledgers may differ between servers because they have received different sets of transactions.

node-list/" class="glossary-link" data-slug="unique-node-list" title="Unique Node List">Unique Node List (UNL). The UNL of a server s is a set of other servers that s trusts not to collude in an attempt to defraud the network. The UNL is not a statement of complete trust — a server does not trust its UNL members to be correct in all circumstances. Rather, the UNL represents the set of servers that a node believes will not collectively conspire to produce fraudulent consensus results. The critical requirement is that a server's UNL should not contain a sufficient fraction of Byzantine nodes to subvert the consensus process.

Proposer Set. During each consensus round, a server's proposer set is the subset of its UNL from which it receives proposals. Due to network partitions, latency, or server failures, a server may not receive proposals from all members of its UNL in every round. The proposer set for a given round is therefore the intersection of the UNL and the set of servers from which proposals were actually received.

Consensus. Consensus in RPCA is the state in which all correct servers in the network agree on the same set of transactions to apply to the LCL, producing an identical new closed ledger. A consensus algorithm must provide two fundamental guarantees:

  1. Safety (Agreement): No two correct servers close different ledgers. If server s_1 closes ledger L and server s_2 closes ledger L' in the same consensus round, and both s_1 and s_2 are correct, then L = L'.

  2. Liveness (Termination): The consensus process completes in bounded time. Every correct server eventually closes a new ledger, ensuring the network makes forward progress.

Validation. After a server computes its closed ledger for a consensus round, it signs the ledger hash and broadcasts it as a validation message. A server that receives validations from a supermajority of its UNL for the same ledger hash can be confident that the network has reached consensus on that ledger. Validation messages serve as confirmation that the consensus round completed successfully across the network.

Transaction Set. A transaction set is a collection of transactions proposed for inclusion in the next closed ledger. During consensus, servers iteratively refine their proposed transaction sets, adding transactions that receive sufficient support and removing those that do not. The final agreed-upon transaction set is applied to the LCL to produce the new closed ledger.

Definition of Consensus

ในระบบแบบกระจาย ฉันทามติคือกระบวนการที่เครือข่ายของโหนดตกลงร่วมกันบนสถานะเดียวกัน แม้จะมีผู้เข้าร่วมที่ผิดพลาดหรือประสงค์ร้าย อัลกอริทึมฉันทามติต้องมีคุณสมบัติพื้นฐานสามประการ ได้แก่ correctness (โหนดที่ถูกต้องสองโหนดต้องไม่ตัดสินใจต่างกัน), agreement (โหนดที่ถูกต้องทั้งหมดต้องตัดสินใจเหมือนกัน), และ termination (โหนดที่ถูกต้องทั้งหมดต้องตัดสินใจได้ในที่สุด) คุณสมบัติเหล่านี้ทำให้ระบบกระจายทำงานเสมือนเป็นโหนดเดียวที่เชื่อถือได้

ความท้าทายของการบรรลุฉันทามติมาจากความไม่น่าเชื่อถือโดยธรรมชาติของระบบกระจาย โหนดอาจล่ม ข้อความอาจล่าช้าหรือสูญหาย และโหนด Byzantine อาจมีพฤติกรรมตามอำเภอใจหรือเป็นอันตราย ปัญหานายพลไบแซนไทน์ที่ Lamport, Shostak และ Pease นิยามไว้อย่างเป็นทางการ สะท้อนความท้าทายนี้โดยตรง: กลุ่มโปรเซสจะตกลงร่วมกันได้อย่างไรเมื่อบางส่วนอาจผิดพลาดและการสื่อสารไม่น่าเชื่อถือ

ผลลัพธ์คลาสสิกในงานคำนวณแบบกระจายชี้ให้เห็นขอบเขตพื้นฐานของสิ่งที่อัลกอริทึมฉันทามติทำได้ ผลลัพธ์ความเป็นไปไม่ได้ของ FLP แสดงว่าไม่มีอัลกอริทึมเชิงกำหนดใดรับประกันฉันทามติได้ในระบบอะซิงโครนัส หากแม้แต่โหนดเดียวมีโอกาสล้มเหลว ดังนั้นอัลกอริทึมฉันทามติภาคปฏิบัติจึงต้องแลกเปลี่ยนระหว่าง safety (ไม่บรรลุฉันทามติที่ผิด) และ liveness (ระบบยังคงเดินหน้าได้เสมอ) proof-of-work ของ Bitcoin ให้ความสำคัญกับ safety มากกว่า liveness ขณะที่ RPCA สร้างสมดุลที่เหมาะกับระบบชำระเงินมากกว่า โดยปิดรอบฉันทามติได้ภายในเวลาจำกัดและยังคงการรับประกัน safety ที่แข็งแรงภายใต้สมมติฐานความผิดพลาดที่สมจริง

Existing Consensus Algorithms

Several consensus algorithms have been proposed to solve the Byzantine Generals Problem in distributed systems. We review the most relevant approaches and discuss their limitations in the context of distributed payment systems, motivating the design of RPCA.

Practical Byzantine Fault Tolerance (PBFT). The PBFT algorithm, introduced by Castro and Liskov in 1999, demonstrated that Byzantine fault tolerance could be achieved with practical performance. PBFT tolerates up to f Byzantine faults in a network of 3f + 1 nodes, meaning the system remains correct as long as fewer than one-third of the nodes are faulty. The algorithm operates in a series of views, each with a designated primary that proposes an ordering of client requests. If the primary is faulty, the remaining nodes can execute a view change to elect a new primary.

PBFT achieves consensus through a three-phase protocol: pre-prepare, prepare, and commit. In each phase, nodes exchange authenticated messages with all other nodes, resulting in O(n^2) message complexity per consensus round, where n is the total number of nodes. This quadratic communication overhead makes PBFT impractical for large networks. A network of 1,000 nodes would require approximately 1,000,000 messages per consensus round, creating a communication bottleneck that limits both throughput and latency. Furthermore, all nodes must participate in every consensus round, meaning the system cannot tolerate large numbers of offline nodes without risking liveness failures.

Paxos and Raft. The Paxos family of algorithms, developed by Lamport, provides consensus in asynchronous systems with crash failures. Paxos and its more understandable variant Raft use a leader-based approach where a single designated proposer coordinates agreement. These algorithms can tolerate the failure of up to f nodes in a system of 2f + 1 nodes, but they assume crash failures rather than Byzantine failures. A crashed node simply stops responding, whereas a Byzantine node may send conflicting messages, forge signatures, or otherwise behave maliciously. Because Paxos and Raft do not handle Byzantine behavior, they are unsuitable for open, permissionless networks where adversarial participants are expected.

Proof-of-Work (Bitcoin). Bitcoin's Nakamoto consensus uses proof-of-work to achieve Byzantine fault tolerance in a permissionless setting. Miners expend computational resources to solve SHA-256 hash puzzles, and the first miner to find a valid solution proposes the next block. The difficulty of the puzzle is adjusted dynamically so that the network produces one block approximately every 10 minutes. Security derives from the assumption that no single entity controls more than 50% of the network's computational power.

While proof-of-work operates in a fully permissionless environment and handles an arbitrary number of Byzantine nodes (subject to the majority hash rate assumption), its practical limitations for payment systems are severe:

  • Latency. A single confirmation takes approximately 10 minutes. For high-value transactions, the recommended practice of waiting for 6 confirmations yields a latency of approximately 60 minutes. This makes point-of-sale and real-time settlement applications impractical.

  • Energy consumption. The computational work performed by miners is deliberately wasteful — it exists solely to make the puzzle difficult. At the time of writing, the Bitcoin network's annual energy consumption was estimated to exceed $150 million, a cost ultimately borne by users of the system through transaction fees and inflation.

  • Throughput. Bitcoin's block size limit and 10-minute block interval restrict throughput to approximately 7 transactions per second. Increasing either parameter requires a hard fork and raises concerns about centralization, as larger blocks favor miners with more bandwidth and storage.

  • Probabilistic finality. Even after multiple confirmations, a proof-of-work transaction is never absolutely final — there is always a nonzero (though exponentially decreasing) probability that a longer competing chain could emerge and reverse the transaction. This probabilistic finality model is poorly suited to financial applications that require definitive settlement.

Federated Byzantine Agreement (FBA). The Stellar Consensus Protocol, proposed by Mazieres, introduces a model where nodes choose their own "quorum slices" — sets of nodes that they consider sufficient for agreement. FBA shares some conceptual similarities with RPCA's Unique Node Lists, but the two approaches differ in their consensus mechanisms and formal guarantees.

RPCA addresses the limitations of these existing approaches by combining the low latency of voting-based protocols with a trust model that does not require global agreement on the set of validators. By replacing global trust with local trust (the UNL), RPCA achieves Sybil resistance without proof-of-work, while the iterative voting mechanism with increasing thresholds provides both safety and liveness with consensus latency measured in seconds rather than minutes.

Existing Consensus Algorithms

มีการเสนออัลกอริทึมฉันทามติหลายแบบเพื่อแก้ปัญหานายพลไบแซนไทน์ในระบบแบบกระจาย อัลกอริทึม Practical Byzantine Fault Tolerance (PBFT) ที่ Castro และ Liskov นำเสนอ สามารถทนต่อความผิดพลาดแบบ Byzantine ได้สูงสุด f ตัว ในระบบที่มี 3f+1 โหนด PBFT บรรลุฉันทามติผ่านหลายรอบของการแลกเปลี่ยนข้อความระหว่างทุกโหนด โดยมีความซับซ้อนด้านการสื่อสาร O(n^2) เมื่อ n คือจำนวนโหนด แม้ PBFT จะให้ safety ที่แข็งแรงและความหน่วงค่อนข้างต่ำในเครือข่ายขนาดเล็ก แต่ไม่ขยายตัวได้ดีในเครือข่ายขนาดใหญ่เนื่องจากภาระการสื่อสารแบบกำลังสอง

Paxos และอนุพันธ์ซึ่งพัฒนาโดย Lamport ให้ฉันทามติในระบบอะซิงโครนัส แต่ตั้งสมมติฐานความผิดพลาดแบบ crash แทน Byzantine Paxos ทำงานผ่านชุดรอบที่ proposer เสนอค่าและ acceptor โหวต แม้ Paxos จะทนต่อความล่าช้าของข้อความแบบไม่จำกัดและการล่มของโปรเซสได้ แต่การรับมือความผิดพลาดแบบ Byzantine ต้องใช้การออกแบบวิศวกรรมอย่างระมัดระวัง และในบางสถานการณ์อาจเกิด livelock

ฉันทามติแบบ proof-of-work ของ Bitcoin ใช้แนวทางที่ต่างออกไปโดยสิ้นเชิง คือทำให้การโจมตี Byzantine ไม่คุ้มค่าทางเศรษฐศาสตร์ โหนดแข่งขันกันแก้ปริศนาการเข้ารหัส โดยผู้ชนะจะเสนอ block ธุรกรรมถัดไป แม้แนวทางนี้จะสเกลได้กับขนาดเครือข่ายตามต้องการและรองรับความผิดพลาดแบบ Byzantine แต่มีข้อเสียรุนแรง ได้แก่ การใช้พลังงานมหาศาล (มีการประเมินว่าเกิน 150 ล้านดอลลาร์ต่อปีสำหรับเครือข่าย Bitcoin), ความหน่วงในการยืนยันยาวนาน (มัก 40-60 นาทีสำหรับธุรกรรมมูลค่าสูง), และ throughput ที่จำกัด (ประมาณ 7 ธุรกรรมต่อวินาที) ข้อจำกัดเหล่านี้ทำให้ proof-of-work ไม่เหมาะกับหลายกรณีใช้งานระบบชำระเงินที่ต้องการการชำระบัญชีรวดเร็วและปริมาณธุรกรรมสูง

Ripple Protocol Consensus Algorithm

The consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="Ripple Protocol Consensus Algorithm">Ripple Protocol Consensus Algorithm (RPCA) proceeds in rounds. Each round begins when a server determines that enough time has passed since the last ledger close (typically 3-5 seconds) or when it has accumulated a sufficient number of new transactions. The algorithm produces a new closed ledger by having all correct servers agree on a common set of transactions to apply to the last-closed ledger.

The algorithm proceeds through the following steps:

Step 1: Initial Proposal. Each server takes all valid transactions it has seen prior to the beginning of the consensus round — those in its open ledger that have not yet been included in a closed ledger — and forms them into an initial proposal. The server signs this proposal and broadcasts it to all servers in its UNL. The initial proposal represents the server's starting position: the set of transactions it believes should be included in the next ledger.

Step 2: Iterative Voting. Upon receiving proposals from other servers in its UNL, each server computes the overlap between the received proposals and its own proposal. A transaction is retained in the server's updated proposal if it appears in at least a threshold percentage of the proposals received from UNL members. This threshold starts at 50% in the first round, meaning a transaction must appear in proposals from at least half of the responding UNL members to survive.

The server then broadcasts its updated proposal and waits for responses. This process repeats through multiple rounds, with the threshold increasing at each round. A typical threshold progression is:

Round 1:  50% threshold  — transaction must appear in ≥50% of UNL proposals
Round 2:  60% threshold  — transaction must appear in ≥60% of UNL proposals
Round 3:  70% threshold  — transaction must appear in ≥70% of UNL proposals
Round 4:  80% threshold  — transaction must appear in ≥80% of UNL proposals (final)

The increasing thresholds serve as a filter that progressively removes contentious transactions — those that do not have broad support — while retaining transactions that are widely agreed upon. Transactions that were initially included by some servers but not others will be pruned in successive rounds as the threshold increases, until only transactions with near-universal support remain.

Step 3: Ledger Close. When a transaction achieves the final supermajority threshold of 80% support across a server's UNL, it is included in the server's final transaction set for this consensus round. The server applies all transactions in the final set to the last-closed ledger, computes the resulting ledger state, and cryptographically hashes the new ledger. This hash is signed by the server and broadcast as a validation message to all other servers in the network.

Step 4: Validation. Each server collects validation messages from its UNL members. If a supermajority (typically 80%) of a server's UNL sends validation messages containing the same ledger hash, the server accepts that ledger as the new last-closed ledger. If the server's own computed ledger hash matches the supermajority hash, the consensus round is complete. If the server's ledger hash differs from the supermajority, it means the server's local state diverged during consensus. In this case, the server fetches the correct ledger from its peers, updates its local state, and resynchronizes.

RPCA Consensus Flow:

Server A ──┐     ┌── Round 1 (50%) ──┐     ┌── Round 2 (60%) ──┐
Server B ──┼──►  │  Exchange         │ ──► │  Exchange         │ ──►
Server C ──┤     │  proposals        │     │  proposals        │
Server D ──┘     │  Filter by 50%    │     │  Filter by 60%    │
                 └───────────────────┘     └───────────────────┘
                          │
    ┌── Round 3 (70%) ──┐     ┌── Round 4 (80%) ──┐     ┌── Validation ──┐
──► │  Exchange         │ ──► │  Final round       │ ──► │  Sign ledger   │
    │  proposals        │     │  Apply surviving   │     │  hash, collect │
    │  Filter by 70%    │     │  txns to LCL       │     │  validations   │
    └───────────────────┘     └────────────────────┘     └────────────────┘

Transactions that fail to achieve the 80% supermajority in any consensus round are not discarded permanently. They remain as candidate transactions for subsequent consensus rounds. A transaction may fail to achieve consensus in one round because it arrived too late to be included in enough proposals, because network latency prevented some UNL members from receiving it, or because it conflicted with other transactions. In subsequent rounds, these transactions will be re-proposed and may achieve consensus if the conditions that prevented their inclusion are resolved.

The algorithm handles conflicting transactions (such as two transactions that attempt to spend the same funds) by relying on the threshold mechanism. Only one of the conflicting transactions can achieve 80% support, because any server that includes one conflict in its proposal will exclude the other. The iterative rounds ensure that the network converges on a single resolution of any conflict, with the most widely observed transaction typically prevailing.

A critical property of RPCA is that it does not require all servers in the network to participate in every round. Servers that are offline or unreachable simply do not contribute proposals, and the consensus process proceeds with the remaining servers. As long as the active servers satisfy the UNL overlap and Byzantine threshold requirements, the algorithm will reach consensus correctly. This tolerance for partial participation makes the protocol robust against server failures and network partitions.

Ripple Protocol Consensus Algorithm

Ripple Protocol Consensus Algorithm (RPCA) เริ่มต้นจากการที่เซิร์ฟเวอร์แต่ละตัวรวบรวมธุรกรรมที่ถูกต้องทั้งหมดที่ตนพบและยังไม่ถูกนำไปใช้ ให้เป็นธุรกรรมผู้สมัคร จากนั้นเซิร์ฟเวอร์จะทำตามโปรโตคอลหลายรอบ โดยทำงานแบบวนซ้ำเพื่อให้ได้ข้อตกลงร่วมกันบนชุดธุรกรรมที่จะนำไปใช้กับ ledger ปัจจุบัน ในแต่ละรอบ เซิร์ฟเวอร์จะยื่นข้อเสนอที่ประกอบด้วยธุรกรรมที่ตนเชื่อว่าควรถูกบรรจุใน ledger ถัดไป

ระหว่างแต่ละรอบของฉันทามติ เซิร์ฟเวอร์จะสื่อสารข้อเสนอของตนไปยังเซิร์ฟเวอร์อื่นใน Unique Node List (UNL) ของตน แล้วจึงคำนวณว่าธุรกรรมใดปรากฏในสัดส่วนถึงเกณฑ์ของข้อเสนอ ตอนเริ่มต้นเกณฑ์นี้ตั้งไว้ที่ 50% หมายความว่าธุรกรรมต้องปรากฏในข้อเสนอจากอย่างน้อยครึ่งหนึ่งของ UNL ของเซิร์ฟเวอร์ จึงจะถูกพิจารณาในรอบถัดไป เมื่อฉันทามติดำเนินผ่านหลายรอบ เกณฑ์นี้จะเพิ่มขึ้นทีละขั้น (โดยทั่วไปเป็น 60%, 70% และสุดท้าย 80%)

เมื่อธุรกรรมใดถึงเกณฑ์ supermajority ที่ 80% ของการสนับสนุนภายใน UNL ของเซิร์ฟเวอร์ ธุรกรรมนั้นจะถูกใส่ไว้ในข้อเสนอสำหรับรอบฉันทามติสุดท้ายของเซิร์ฟเวอร์ ธุรกรรมทั้งหมดที่ถึงเกณฑ์นี้ทั่วทั้งเครือข่ายจะถูกนำไปใช้กับ ledger จากนั้น ledger จะถูก hash และลงลายมือชื่อเชิงคริปโตกราฟี ledger ที่ผ่านการตรวจสอบใหม่นี้จะกลายเป็น last-closed ledger และกระบวนการจะเริ่มใหม่กับชุดธุรกรรมผู้สมัครถัดไป

กระบวนการฉันทามติโดยทั่วไปเสร็จสิ้นใน 5 วินาทีหรือน้อยกว่า โดยธุรกรรมส่วนใหญ่ต้องใช้เพียงหนึ่งรอบเพื่อถึงเกณฑ์ supermajority ธุรกรรมที่ยังไม่ถึงฉันทามติในรอบหนึ่งจะคงสถานะผู้สมัครสำหรับรอบถัดไป การออกแบบนี้ทำให้เครือข่ายเดินหน้าต่อเนื่องพร้อมรักษา safety ที่แข็งแรง เนื่องจากไม่มีธุรกรรมใดถูกนำเข้า ledger ได้หากไม่มีการสนับสนุนระดับ supermajority จาก validator ที่เชื่อถือได้

Formal Analysis of Convergence

The correctness of consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="RPCA">RPCA depends on two conditions: the fraction of Byzantine nodes within each server's node-list/" class="glossary-link" data-slug="unique-node-list" title="UNL">UNL, and the degree of overlap between the UNLs of different servers. We provide formal analysis of the convergence properties and prove that under specified conditions, the algorithm guarantees both safety and liveness.

Probability of consensus failure versus UNL size chart showing security thresholds for the Ripple Protocol Consensus Algorithm

Theorem 1 (Safety). If for every pair of correct servers s_i and s_j in the network, the overlap between their UNLs satisfies:

\[\frac{|UNL_i \cap UNL_j|}{\max(|UNL_i|, |UNL_j|)} > \frac{1}{5}\]

and the fraction of Byzantine nodes in every UNL is less than 1/5, then no two correct servers will close different ledgers in the same consensus round.

Proof sketch. Suppose, for contradiction, that two correct servers s_i and s_j close different ledgers. This means there exists some transaction T that is in the final transaction set of s_i but not in the final transaction set of s_j (or vice versa). For T to be in s_i's final set, it must have received support from at least 80% of UNL_i. For T to not be in s_j's final set, it must have received support from fewer than 80% of UNL_j.

Let n_i = |UNL_i| and n_j = |UNL_j|. The number of nodes that support T in UNL_i is at least 0.8 * n_i. Among these supporting nodes, some are in the overlap UNL_i ∩ UNL_j. Because Byzantine nodes constitute less than 1/5 of each UNL, at least 0.8 * n_i - 0.2 * n_i = 0.6 * n_i correct nodes in UNL_i support T. The overlap condition ensures that a sufficient number of these correct supporting nodes are also in UNL_j, providing enough support for T in UNL_j to prevent it from being excluded.

Specifically, if the overlap |UNL_i ∩ UNL_j| exceeds 1/5 of the larger UNL, then the correct nodes in the overlap that support T will constitute enough of UNL_j's responses to keep T above the threshold. The combination of the overlap requirement and the Byzantine node bound makes it impossible for T to simultaneously achieve 80% support in one UNL and fall below 80% in another, proving that both servers must produce the same final transaction set and therefore the same closed ledger.

Theorem 2 (Liveness). Under the same conditions as Theorem 1, and assuming that network messages are delivered within a bounded time, every correct server will close a new ledger within a bounded number of consensus rounds.

Proof sketch. Liveness follows from the deterministic progression of the consensus rounds. Each round has a fixed duration, and the threshold progression (50% to 80%) is predetermined. A transaction that has support from a supermajority of correct nodes will survive all threshold rounds because the correct nodes will consistently include it in their proposals. A transaction that does not have supermajority support will be filtered out by the increasing thresholds. In either case, the set of transactions stabilizes within a bounded number of rounds, and all correct servers arrive at the same decision. The bounded message delivery assumption ensures that proposals reach their destinations within each round's time window.

Corollary (Fork-freeness). Under the conditions of Theorem 1, the Ripple network will not fork. A fork would require two disjoint subsets of the network to close different ledgers simultaneously, but the UNL overlap condition ensures that no such disjoint partitioning of the network can occur while maintaining 80% support within each partition.

The 1/5 threshold for both the overlap condition and the Byzantine node fraction is derived from the interplay between the 80% supermajority requirement and the need for correct nodes to have decisive influence. With 80% required for inclusion and at most 20% Byzantine nodes, the correct nodes control at least 60% of each UNL, which is enough to ensure that their collective decision is reflected in the final outcome. The 20% overlap requirement ensures that the correct majorities in different UNLs are sufficiently connected to prevent divergence.

It is worth noting that these bounds are conservative. In practice, the network typically operates with much higher UNL overlap and much lower Byzantine fault rates, providing safety margins well beyond the theoretical minimums. The formal analysis establishes worst-case guarantees, while the practical behavior of the network is significantly more robust than the worst case would suggest.

The convergence rate of the algorithm depends on the number of rounds and the initial agreement level. Simulations show that when the majority of UNL members begin with the same proposal (the common case in a well-connected network), consensus is typically achieved in a single round of threshold progression (4 sub-rounds), completing in approximately 3-5 seconds. When proposals diverge more significantly (for example, after a network partition heals), additional rounds may be needed, but convergence is still guaranteed within a bounded number of rounds.

Formal Analysis of Convergence

ความถูกต้องของ RPCA ขึ้นอยู่กับระดับการทับซ้อนของ UNL ที่โหนดต่าง ๆ ในเครือข่ายเลือกอย่างมีนัยสำคัญ กำหนดให้ UNL_i คือ unique node list ของโหนด i และ UNL_i ∩ UNL_j คือเซตของโหนดที่อยู่ทั้งใน UNL_i และ UNL_j เพื่อให้เครือข่ายคงฉันทามติได้ ต้องมีเงื่อนไขว่าคู่โหนดใด ๆ i และ j มีขนาดจุดตัดของ UNL มากพอเมื่อเทียบกับขนาดที่ใหญ่ที่สุดของ UNL ทั้งสอง

Probability of consensus failure versus UNL size chart showing security thresholds for the Ripple Protocol Consensus Algorithm

โดยเฉพาะ โปรโตคอลรับประกัน safety เมื่อ |UNL_i ∩ UNL_j| / max(|UNL_i|, |UNL_j|) 1/5 สำหรับทุกคู่โหนด i และ j เงื่อนไขนี้ทำให้แม้โหนด Byzantine พยายามผลักดันให้ส่วนต่าง ๆ ของเครือข่ายตัดสินใจไม่ตรงกัน การทับซ้อนของโหนดที่เชื่อถือได้ก็ยังป้องกันการแตก fork ได้ หากเงื่อนไขนี้เป็นจริงและสัดส่วนโหนด Byzantine ใน UNL ใด ๆ ต่ำกว่า 1/5 โหนดที่ถูกต้องทั้งหมดจะลงเอยด้วยการตัดสินใจฉันทามติแบบเดียวกัน

หลักฐานเชิงรูปแบบดำเนินโดยแสดงว่า หากสองโหนดสามารถไปถึงการตัดสินใจฉันทามติที่ต่างกันได้ จะต้องมีธุรกรรม T ที่อยู่ใน ledger สุดท้ายของโหนดหนึ่งแต่ไม่อยู่ในอีกโหนดหนึ่ง การเกิดเหตุเช่นนี้ต้องการให้ T ได้รับการสนับสนุน 80% ใน UNL ของโหนดแรก แต่ต่ำกว่า 80% ใน UNL ของโหนดที่สอง อย่างไรก็ตาม ภายใต้ข้อกำหนดการทับซ้อนและข้อจำกัดจำนวนโหนด Byzantine สถานการณ์นี้พิสูจน์ได้ว่าเป็นไปไม่ได้: หาก T ได้ 80% ใน UNL_i ก็ต้องได้อย่างน้อย 60% ใน UNL_j ที่เข้าเงื่อนไขการทับซ้อน และเมื่อมีรอบฉันทามติเพียงพอ ค่าดังกล่าวจะลู่เข้าไปที่ 80% หรือถูกปฏิเสธโดยทั้งสองโหนด

คุณสมบัติ liveness ซึ่งหมายถึงการได้ฉันทามติในที่สุด มาจากข้อเท็จจริงว่าเกณฑ์การรวมธุรกรรมเพิ่มขึ้นแบบเชิงกำหนดผ่านแต่ละรอบฉันทามติ แม้จะมีโหนด Byzantine และความหน่วงเครือข่าย โปรโตคอลยังคงรับประกันว่าธุรกรรมที่ได้รับการสนับสนุนระดับ supermajority จากโหนดสุจริตจะถูกบรรจุในที่สุด ส่วนธุรกรรมที่ขาดการสนับสนุนดังกล่าวจะถูกตัดออก เวลาฉันทามติที่มีขอบเขต (โดยทั่วไปประมาณ 5 วินาที) จึงให้การรับประกัน liveness เชิงปฏิบัติที่เหมาะกับงานระบบชำระเงิน

Unique Node Lists

The node-list/" class="glossary-link" data-slug="unique-node-list" title="Unique Node List">Unique Node List (UNL) is the mechanism by which consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="RPCA">RPCA achieves Sybil resistance without proof-of-work. In a naive voting system where each node has equal influence, an attacker could create thousands of pseudonymous nodes (a Sybil attack) and overwhelm the honest nodes with fraudulent votes. The UNL prevents this by requiring each server to explicitly declare which other servers it considers trustworthy for consensus purposes. Creating additional identities provides no advantage unless existing servers voluntarily add those identities to their UNLs.

XRP Ledger network topology diagram showing two UNL node clusters with connectivity overlap

The trust implied by including a server in one's UNL is deliberately minimal. A server s that includes server t in its UNL is not asserting that t is always correct or that t will never fail. It is asserting only that t will not collude with other members of s's UNL to defraud the network. This is a much weaker assertion than full trust. For example, a server might include a validator operated by a major financial institution in its UNL not because it trusts that institution completely, but because it believes that institution will not conspire with the other validators in the UNL to commit fraud. The institution might occasionally have bugs or downtime, but these crash-type failures are handled by the consensus algorithm's tolerance for missing proposals.

The formal requirements for UNL selection are derived from the safety analysis. Two conditions must hold:

  1. Byzantine threshold: Fewer than 20% of the nodes in any server's UNL should be Byzantine. This means that when selecting UNL members, a server should choose nodes that it believes are operated by independent, trustworthy entities. Selecting nodes that are all operated by the same organization would violate this requirement if that organization behaved maliciously.

  2. Overlap requirement: For any two servers in the network, the overlap between their UNLs must exceed 20% of the larger UNL. This ensures that the local trust relationships form a sufficiently connected graph that consensus decisions propagate consistently across the network.

In practice, satisfying the overlap requirement is straightforward when the network provides a recommended default UNL. Ripple publishes a default UNL consisting of validators operated by a diverse set of entities — financial institutions, universities, blockchain companies, and other organizations. Servers that adopt this default UNL automatically satisfy the overlap condition with each other. Server operators who wish to customize their UNL may do so, but they should ensure that their custom list retains sufficient overlap with the UNLs of other servers they wish to reach consensus with.

The selection of UNL members can be guided by several heuristics:

Diversity. A well-constructed UNL should include validators operated by entities in different geographic regions, legal jurisdictions, and organizational types. This diversity reduces the probability that a common failure mode (such as a regional internet outage or a regulatory action in a specific jurisdiction) could simultaneously compromise a significant fraction of the UNL.

Independence. UNL members should be operated by independent entities that do not have incentives to collude. Validators operated by competing financial institutions, for example, are less likely to collude than validators operated by subsidiaries of the same parent company. The independence of UNL members directly affects the Byzantine fault tolerance of the system, as collusion between UNL members is the primary threat model.

Track record. Servers with a long history of correct behavior and high uptime are better candidates for UNL inclusion than newly created servers with no history. While past behavior does not guarantee future correctness, it provides a signal about the operator's competence and commitment to maintaining the validator.

Capacity. UNL members must have sufficient computational and network resources to participate reliably in the consensus process. A validator that frequently fails to deliver proposals on time due to resource constraints degrades the performance of the consensus algorithm for all servers that include it in their UNL.

The UNL mechanism also enables a natural path toward progressive decentralization. In the early stages of the network, the default UNL may be relatively concentrated among a small number of well-known validators. As the network matures and more independent operators demonstrate their reliability, the default UNL can be expanded to include a broader set of validators. Individual server operators can also customize their UNLs to reflect their own trust assessments, gradually diversifying the network's trust topology without requiring any protocol changes or coordinated upgrades.

A potential concern with the UNL model is that it could lead to a "trust hierarchy" where a small number of prominent validators are included in most UNLs, creating a de facto centralized system. To mitigate this risk, the protocol encourages diversity in UNL selection and provides tools for monitoring the network's trust topology. If the overlap between UNLs becomes too concentrated on a small set of validators, operators can be alerted to diversify their selections. The goal is a network where trust is distributed broadly enough that no single entity or small coalition can exert disproportionate influence over the consensus process.

Unique Node Lists

Unique Node List (UNL) เป็นองค์ประกอบหลักของ RPCA ที่ทำให้แตกต่างจากอัลกอริทึมฉันทามติอื่น ๆ แต่ละโหนดในเครือข่าย Ripple จะดูแล UNL ของตนเอง ซึ่งประกอบด้วยโหนดอื่นที่ตนเชื่อว่าจะไม่สมรู้ร่วมคิดเพื่อฉ้อโกงเครือข่าย ประเด็นสำคัญคือความไว้วางใจนี้เป็นแบบเฉพาะที่ ไม่ใช่แบบทั่วโลก: โหนดต่างกันสามารถมี UNL ต่างกันได้ และไม่จำเป็นต้องมีชุด validator เดียวที่ทุกฝ่ายตกลงร่วมกันทั้งเครือข่าย การออกแบบนี้ช่วยให้เครือข่ายขยายตัวอย่างเป็นธรรมชาติพร้อมรักษาความเป็นกระจายอำนาจ

XRP Ledger network topology diagram showing two UNL node clusters with connectivity overlap

UNL ทำหน้าที่เป็นกลไกป้องกันการโจมตี Sybil โดยไม่ต้องพึ่ง proof-of-work ในระบบโหวตแบบง่าย ผู้โจมตีสามารถสร้างตัวตนปลอมจำนวนมากเพื่อเพิ่มอิทธิพลอย่างไม่สมส่วน แต่เมื่อ RPCA บังคับให้แต่ละโหนดต้องเลือกอย่างชัดเจนว่าจะเชื่อโหนดใด การสร้างตัวตนเพิ่มจึงไม่ให้ประโยชน์ เว้นแต่ตัวตนเหล่านั้นจะโน้มน้าวโหนดที่มีอยู่ให้เพิ่มเข้ามาใน UNL ได้ ปัญหาการต้านทาน Sybil จึงย้ายจากการใช้ทรัพยากรคำนวณไปสู่เรื่องชื่อเสียงและความสัมพันธ์เชิงความไว้วางใจ

เพื่อให้เครือข่ายทำงานได้อย่างถูกต้อง UNL ต้องถูกเลือกให้มีการทับซ้อนเพียงพอตามที่ระบุไว้ใน formal analysis ในทางปฏิบัติ แม้ผู้ดำเนินการโหนดแต่ละรายจะมีอิสระในการเลือก UNL ของตนเอง แต่ต้องทำให้แน่ใจว่ารายชื่อดังกล่าวรวม validator ที่ส่วนอื่นของเครือข่ายไว้วางใจด้วย Ripple มี UNL เริ่มต้นที่ประกอบด้วย validator จากหลายองค์กรที่หลากหลาย แต่ผู้ดำเนินการโหนดสามารถปรับเปลี่ยนรายชื่อตามการประเมินความไว้วางใจของตนเองได้

กลไก UNL ยังเปิดเส้นทางตามธรรมชาติสู่การกระจายอำนาจแบบค่อยเป็นค่อยไป ในช่วงแรกของเครือข่าย การมีชุด validator ที่รวมศูนย์กว่าอาจเหมาะสมต่อความเสถียรและความน่าเชื่อถือ เมื่อเครือข่ายเติบโตและผู้ดำเนินการที่หลากหลายพิสูจน์ความน่าเชื่อถือได้มากขึ้น UNL ก็สามารถพัฒนาให้รวม validator ที่กว้างขึ้น เพิ่มทั้งความยืดหยุ่นและความเป็นกระจายอำนาจ โดยไม่ลดทอนคุณสมบัติความปลอดภัย

Simulation Code

To validate the theoretical analysis and evaluate the practical performance of consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="RPCA">RPCA under realistic conditions, extensive simulations were conducted using a custom-built network simulator. The simulator models a network of servers, each maintaining their own node-list/" class="glossary-link" data-slug="unique-node-list" title="UNL">UNL and participating in the full RPCA protocol including proposal generation, iterative voting with increasing thresholds, ledger close, and validation. The simulation framework allows precise control over network topology, Byzantine behavior patterns, message latency distributions, and UNL configurations.

The simulation parameters were varied across the following dimensions:

Network size. Simulations were conducted with networks ranging from 10 to 1,000 nodes. Larger networks test the scalability of the algorithm, as the number of proposals each server must process increases with the size of its UNL (though not with the total network size, which is a key advantage of the UNL-based approach).

Byzantine node fraction. The percentage of Byzantine nodes was varied from 0% (fully correct network) to 20% (the theoretical maximum for guaranteed safety). Byzantine nodes were programmed to exhibit various adversarial behaviors including sending conflicting proposals to different servers, withholding proposals, sending proposals with deliberately different transaction sets, and attempting to fork the network by supporting different transactions in different proposals.

UNL size and overlap. UNL sizes ranged from 5 to 50 nodes, with overlap percentages ranging from 20% (the theoretical minimum) to 100% (fully overlapping UNLs). The relationship between UNL overlap and consensus success was a primary focus of the simulation study.

Network latency. Message delivery times were modeled using a log-normal distribution to simulate realistic network conditions, with mean latencies ranging from 10ms (data center environment) to 500ms (global internet with congestion). Some simulations also included random message drops to test the algorithm's robustness to packet loss.

The primary metrics tracked in the simulations were:

Simulation Metrics:

Metric                  Description
──────────────────────────────────────────────────────────────
Consensus latency       Time from round start to ledger close
Fork probability        Fraction of runs where servers closed
                        different ledgers
Transaction throughput  Number of transactions included per
                        consensus round
Agreement ratio         Fraction of servers closing the same
                        ledger in each round
Recovery time           Time to resynchronize after a network
                        partition heals

Safety results. In all configurations where the UNL overlap condition was satisfied (overlap 20% of the larger UNL) and Byzantine nodes comprised less than 20% of each UNL, no forks were observed across tens of thousands of simulation runs. This empirically confirms the theoretical safety guarantee of Theorem 1. When the overlap condition was violated — for example, by configuring two groups of servers with non-overlapping UNLs — forks occurred with high probability, confirming that the overlap condition is necessary as well as sufficient.

Latency results. Consensus latency remained consistently between 3 and 5 seconds across all tested network sizes, from 10 to 1,000 nodes. This is because each server only communicates with its UNL (not the entire network), so the per-round communication cost scales with UNL size rather than network size. With UNL sizes of 20-30 nodes (typical for production deployments), the communication overhead is modest even in large networks. Network latency was the primary factor affecting consensus time: simulations with 10ms mean latency completed consensus in approximately 2 seconds, while simulations with 500ms mean latency required approximately 6 seconds.

Byzantine resilience results. With up to 15% Byzantine nodes actively attempting to disrupt consensus, the network maintained correct consensus in all simulation runs as long as the UNL overlap condition was met. At 18-19% Byzantine nodes (near the theoretical threshold), occasional consensus delays were observed as the algorithm required additional rounds to filter out Byzantine proposals, but safety was never violated. Beyond 20%, the safety guarantee no longer holds and forks became possible, confirming the theoretical bounds.

Partition recovery. Simulations of network partitions showed that the algorithm recovers gracefully when a partition heals. During the partition, each partition may close ledgers independently (if it contains enough UNL members to reach consensus). When the partition heals, the servers that were in the minority partition detect that the majority reached a different consensus, fetch the correct ledger, and resynchronize. The recovery process typically completes within one or two consensus rounds after the partition heals.

The complete simulation code was made available for independent verification, allowing researchers and developers to reproduce the results, explore additional parameter configurations, and validate the algorithm's behavior under conditions not covered by the original simulation study.

Simulation Code

เพื่อยืนยันการวิเคราะห์เชิงทฤษฎีของ RPCA และประเมินประสิทธิภาพภายใต้เงื่อนไขที่หลากหลาย ได้มีการจำลองอย่างครอบคลุมด้วยซอฟต์แวร์จำลองที่พัฒนาขึ้นเฉพาะทาง กรอบการจำลองจำลองเครือข่ายของโหนดซึ่งแต่ละโหนดดูแล UNL ของตนเองและเข้าร่วมในโปรโตคอลฉันทามติ โค้ดครอบคลุมการทำงาน RPCA แบบครบถ้วน ทั้งการเสนอธุรกรรม รอบโหวตที่เพิ่มเกณฑ์ตามลำดับ และการตรวจสอบ ledger

พารามิเตอร์สำคัญที่ถูกปรับในการจำลอง ได้แก่ ขนาดเครือข่าย (ตั้งแต่ 10 ถึง 1,000 โหนด), สัดส่วนโหนด Byzantine (0% ถึง 20%), ขนาด UNL (โดยทั่วไป 5 ถึง 50 โหนด), และการกำหนด topology ของเครือข่าย สำหรับแต่ละชุดพารามิเตอร์ มีการรันจำลองหลายครั้งด้วย random seed ที่ต่างกันเพื่อรับรองความน่าเชื่อถือเชิงสถิติของผลลัพธ์ การจำลองติดตามตัวชี้วัดสำคัญ เช่น ความหน่วงฉันทามติ ความน่าจะเป็นของการเกิด fork และ throughput ของธุรกรรม

ผลการจำลองยืนยันการคาดการณ์ทางทฤษฎีเกี่ยวกับการลู่เข้าและ safety ในทุกการกำหนดค่าที่เงื่อนไขการทับซ้อนของ UNL เป็นจริง และสัดส่วนโหนด Byzantine ต่ำกว่า 20% ของแต่ละ UNL เครือข่ายสามารถบรรลุฉันทามติได้โดยไม่เกิด fork ความหน่วงฉันทามติคงอยู่ในระดับต่ำอย่างสม่ำเสมอ (โดยทั่วไปเสร็จในเวลา 3-5 วินาทีจำลอง) ไม่ขึ้นกับขนาดเครือข่าย ซึ่งแสดงถึงความสามารถในการขยายตัวของอัลกอริทึม แม้มีโหนด Byzantine 15% พยายามรบกวนฉันทามติอย่างจริงจัง เครือข่ายก็ยังคง correctness ได้ ตราบใดที่เงื่อนไขการทับซ้อนของ UNL ยังถูกต้อง

การจำลองเพิ่มเติมยังครอบคลุมกรณีขอบและสถานการณ์ล้มเหลว เช่น การแบ่งพาร์ทิชันของเครือข่าย การเปลี่ยนองค์ประกอบ UNL อย่างฉับพลัน และการโจมตีแบบประสานงานโดยโหนด Byzantine ผลลัพธ์เหล่านี้ให้ข้อมูลเชิงลึกเกี่ยวกับความทนทานของโปรโตคอล และช่วยกำหนดแนวปฏิบัติที่แนะนำสำหรับการเลือก UNL และการปฏิบัติการเครือข่าย โค้ดจำลองทั้งหมดถูกเผยแพร่เพื่อรองรับการตรวจสอบอิสระและการวิจัยต่อยอด

Discussion

The design of consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="RPCA">RPCA involves several deliberate trade-offs that distinguish it from other consensus algorithms. Understanding these trade-offs is essential for evaluating the algorithm's suitability for different applications and for identifying areas where future improvements may be possible.

Latency versus proof-of-work. Compared to Bitcoin's proof-of-work consensus, RPCA achieves consensus latency that is approximately three orders of magnitude lower — seconds instead of hours. This improvement comes from replacing computational proof with a voting mechanism that can complete in a small number of message rounds. The trade-off is that RPCA requires servers to maintain UNLs with sufficient overlap, whereas Bitcoin requires no pre-existing trust relationships. For payment system applications where low latency is essential and where participants have incentives to select diverse, reliable validators, this trade-off is strongly favorable toward RPCA.

Energy efficiency. RPCA requires negligible computational resources compared to proof-of-work. The consensus process involves only cryptographic signing, hash computation for ledger validation, and network communication — operations that can be performed on commodity hardware with minimal energy consumption. The elimination of mining means that the cost of operating the network is limited to the cost of running the servers themselves, which is a tiny fraction of the energy expenditure required by proof-of-work systems. This energy efficiency makes RPCA suitable for deployment at scale without the environmental concerns associated with proof-of-work mining.

Trust assumptions. The most significant difference between RPCA and proof-of-work is the trust model. Bitcoin's security relies solely on the assumption that no entity controls more than 50% of the network's hash rate — a purely economic assumption that requires no trust between participants. RPCA requires that servers choose UNLs with sufficient overlap and low Byzantine fractions — assumptions that involve trust in the competence and honesty of specific validator operators.

This difference in trust models has important implications. In a proof-of-work system, security degrades gracefully as an attacker approaches the 50% threshold, and the cost of attack is continuously quantifiable in terms of hardware and electricity. In RPCA, security depends on the correctness of node-list/" class="glossary-link" data-slug="unique-node-list" title="UNL">UNL selection, which is harder to quantify. If server operators make poor UNL choices — for example, by including validators controlled by a single malicious entity — the safety guarantees may not hold. Mitigating this risk requires careful UNL curation and network-level monitoring of the trust topology.

Throughput. RPCA's throughput is determined by the rate at which consensus rounds complete and the number of transactions that can be processed in each round. Because consensus rounds complete every 3-5 seconds and each round can include thousands of transactions, the practical throughput is on the order of 1,500 transactions per second — significantly higher than Bitcoin's approximately 7 transactions per second. The throughput can be further increased by optimizing the consensus round duration and increasing the transaction capacity per round, though this must be balanced against latency and network bandwidth requirements.

Network topology. The structure of the network's UNL graph — the graph where each server is a node and each UNL inclusion is a directed edge — significantly impacts the properties of the consensus system. A highly centralized topology where all servers include the same small set of validators maximizes safety (because overlap is maximized) but creates a single point of failure if those central validators become unavailable or are compromised. A highly decentralized topology with minimal overlap increases resilience to targeted attacks but may approach the safety boundaries, especially if Byzantine nodes are strategically placed to minimize effective overlap.

The optimal topology depends on the deployment scenario. For a network of financial institutions that already have established relationships and mutual accountability, a moderately concentrated topology with high overlap provides strong safety with acceptable centralization. For a more open network with diverse participants, a broader UNL topology with careful attention to overlap requirements provides better resilience against collusion.

Comparison with Federated Byzantine Agreement. The Stellar Consensus Protocol (SCP) takes a similar approach to RPCA in that nodes choose their own trust sets (called "quorum slices" in SCP). However, SCP uses a different consensus mechanism based on federated voting with ballots, whereas RPCA uses iterative threshold-based voting. SCP also defines a different set of safety conditions based on quorum intersection rather than UNL overlap. Both approaches demonstrate that local trust can replace global trust in consensus systems, but they achieve this through different mechanisms with different performance characteristics and failure modes.

Future directions. Several extensions to RPCA merit further research. Adaptive UNL selection algorithms could automatically adjust a server's UNL based on observed validator behavior, improving resilience without requiring manual intervention. Dynamic threshold adjustment could allow the consensus algorithm to adapt to varying network conditions, completing faster when agreement is easy and taking more time when it is difficult. And formal verification of the algorithm using machine-checked proofs could provide stronger assurance of correctness than the hand-written proofs presented in this paper.

Discussion

เมื่อเทียบกับฉันทามติแบบ proof-of-work ของ Bitcoin แล้ว RPCA มีข้อได้เปรียบสำคัญหลายประการสำหรับงานระบบการชำระเงิน จุดเด่นที่สุดคือความหน่วงฉันทามติลดลงจาก 40-60 นาที (เวลาที่มักแนะนำสำหรับธุรกรรม Bitcoin มูลค่าสูง) เหลือประมาณ 5 วินาที การปรับปรุงนี้ทำให้ RPCA เหมาะกับงาน point-of-sale และกรณีใช้งานอื่นที่ต้องการการชำระบัญชีเกือบทันที นอกจากนี้ RPCA ใช้ทรัพยากรคำนวณต่ำมากเมื่อเทียบกับ proof-of-work จึงลดปัญหาการใช้พลังงานมหาศาลที่สัมพันธ์กับการขุด Bitcoin

อย่างไรก็ตาม ข้อได้เปรียบดังกล่าวมาพร้อมสมมติฐานความไว้วางใจที่ต่างออกไป ความปลอดภัยของ Bitcoin อาศัยเพียงสมมติฐานว่าไม่มีผู้โจมตีรายใดควบคุมกำลังคำนวณเกิน 50% ของเครือข่าย ขณะที่ RPCA ต้องการให้โหนดเลือก UNL ที่มีการทับซ้อนเพียงพอ และจำนวนโหนด Byzantine ไม่เกินเกณฑ์ภายใน UNL เหล่านั้น สิ่งนี้ย้ายความรับผิดชอบบางส่วนไปยังผู้ดำเนินการโหนดให้ตัดสินใจด้านความไว้วางใจอย่างรอบคอบ ในทางปฏิบัติ trade-off นี้ยอมรับได้สำหรับหลายกรณีใช้งานด้านการชำระเงินที่องค์กรผู้เข้าร่วมมีความสัมพันธ์ความไว้วางใจกันอยู่แล้ว

topology ของเครือข่ายและกลยุทธ์การเลือก UNL ส่งผลอย่างมีนัยสำคัญต่อคุณสมบัติของระบบฉันทามติ topology ที่รวมศูนย์สูง ซึ่งทุกโหนดใช้ validator ชุดเดียวกันใน UNL จะเพิ่ม safety ได้สูงสุด แต่สามารถลด liveness ได้หาก validator ชุดนั้นไม่พร้อมใช้งาน ในทางกลับกัน topology ที่กระจายอำนาจสูงและมีการทับซ้อน UNL ต่ำ อาจช่วย liveness แต่เสี่ยงต่อความล้มเหลวของฉันทามติหากการทับซ้อนเบาบางเกินไป การหาจุดสมดุลที่เหมาะสมจึงต้องพิจารณาร่วมกันทั้งบริบทการใช้งานจริงและระดับความเสี่ยงที่ยอมรับได้

งานในอนาคตอาจสำรวจอัลกอริทึมเลือก UNL แบบปรับตัวที่รักษาเงื่อนไขการทับซ้อนโดยอัตโนมัติพร้อมเพิ่มความเป็นกระจายอำนาจให้มากที่สุด กลไกที่ให้โหนดปรับ UNL แบบไดนามิกจากพฤติกรรม validator ที่สังเกตได้ และส่วนขยายของอัลกอริทึมฉันทามติที่ทนต่อสัดส่วนโหนด Byzantine ที่สูงขึ้นได้อีก การพัฒนาเหล่านี้จะช่วยเพิ่มทั้งความแข็งแรงและความสามารถในการประยุกต์ใช้ RPCA ในระบบการชำระเงินแบบกระจายขนาดใหญ่

Conclusion

The consensus-algorithm/" class="glossary-link" data-slug="ripple-protocol-consensus-algorithm" title="Ripple Protocol Consensus Algorithm">Ripple Protocol Consensus Algorithm represents a significant advancement in distributed consensus for payment systems. By utilizing collectively-trusted subnetworks (Unique Node Lists) rather than requiring global agreement among all nodes or computationally expensive proof-of-work, RPCA achieves consensus in a matter of seconds while maintaining provable safety guarantees against Byzantine failures.

The formal analysis demonstrates that the algorithm's correctness depends on two quantifiable conditions: the overlap between UNLs must exceed 20% of the larger list for any pair of servers, and the fraction of Byzantine nodes in any UNL must remain below 20%. When these conditions are satisfied, the algorithm guarantees that all correct servers will close the same ledger (safety) and that consensus will complete in bounded time (liveness). These guarantees provide the deterministic finality required for financial settlement — unlike proof-of-work systems where finality is probabilistic and may require waiting for multiple confirmations.

The simulation results confirm the theoretical predictions across a wide range of network configurations. Consensus latency remains consistently low (3-5 seconds) regardless of network size, because the communication complexity of each server depends on its UNL size rather than the total number of servers. The algorithm maintains safety even with up to 19% Byzantine nodes actively attempting to disrupt consensus, providing a substantial safety margin under typical operating conditions where Byzantine behavior is rare.

The practical implications extend beyond the Ripple payment network. RPCA demonstrates that the traditional trade-off between consensus latency and Byzantine fault tolerance can be overcome through the principled use of local trust relationships. This insight may prove applicable to other distributed systems where participants have existing trust relationships and where low-latency agreement is critical: inter-bank settlement systems, supply chain management, securities clearing and settlement, and other financial infrastructure applications that require both speed and security.

The decoupling of Sybil resistance from consensus — using UNL-based trust for the former and iterative voting for the latter — opens a design space that has been largely unexplored in the distributed systems literature. This separation allows each concern to be optimized independently, yielding a system that is both more efficient and more flexible than systems that address both concerns with a single mechanism. As the network continues to evolve and incorporate additional validators from diverse operators, it provides a practical demonstration that local trust can serve as a foundation for global consensus.

Conclusion

Ripple Protocol Consensus Algorithm เป็นความก้าวหน้าสำคัญของฉันทามติแบบกระจายสำหรับระบบการชำระเงิน ด้วยการใช้เครือข่ายย่อยที่ได้รับความไว้วางใจร่วมกัน แทนการบังคับให้ทุกโหนดต้องตกลงกันแบบทั่วทั้งเครือข่าย RPCA จึงบรรลุฉันทามติได้ภายในไม่กี่วินาที พร้อมคงการรับประกันที่แข็งแรงต่อความล้มเหลวแบบ Byzantine การวิเคราะห์เชิงรูปแบบยืนยันว่า หาก UNL ถูกเลือกให้มีการทับซ้อนเพียงพอ และจำนวนโหนด Byzantine อยู่ต่ำกว่าเกณฑ์ เครือข่ายจะบรรลุฉันทามติที่ถูกต้องโดยไม่เกิด fork

นัยเชิงปฏิบัติของงานนี้ไม่ได้จำกัดอยู่แค่เครือข่ายการชำระเงินของ Ripple เท่านั้น RPCA แสดงให้เห็นว่าการแลกเปลี่ยนแบบดั้งเดิมระหว่างความหน่วงฉันทามติกับการรับประกันความปลอดภัย สามารถก้าวข้ามได้ด้วยการออกแบบโปรโตคอลอย่างรอบคอบและการใช้ความสัมพันธ์ความไว้วางใจแบบเฉพาะที่ แนวทางนี้มีศักยภาพสำหรับระบบแบบกระจายอื่นที่ต้องการความหน่วงต่ำและมีผู้เข้าร่วมที่มีความไว้วางใจต่อกันอยู่แล้ว เช่น ระบบชำระบัญชีระหว่างธนาคาร การติดตามห่วงโซ่อุปทาน และงานโครงสร้างพื้นฐานทางการเงินอื่น ๆ

การนำ RPCA ไปใช้งานจริงในระบบ production ได้ยืนยันทั้งสมรรถนะและความทนทานของอัลกอริทึม เครือข่าย Ripple ประมวลผลธุรกรรมได้หลายพันรายการต่อวินาที พร้อมความหน่วงฉันทามติที่สม่ำเสมอที่ 3-5 วินาที แสดงให้เห็นว่าคุณสมบัติเชิงทฤษฎีสามารถแปลงเป็นผลลัพธ์จริงได้อย่างมีประสิทธิภาพ เมื่อเครือข่ายพัฒนาอย่างต่อเนื่องและเพิ่ม validator จากผู้ดำเนินการที่หลากหลายมากขึ้น RPCA จึงเป็นตัวอย่างเชิงปฏิบัติของระบบฉันทามติแบบกระจายอำนาจที่รักษาได้ทั้งความปลอดภัยและประสิทธิภาพในระดับสเกลใหญ่

References

Lamport, L., Shostak, R., and Pease, M. (1982). "The Byzantine Generals Problem." ACM Transactions on Programming Languages and Systems, 4(3):382-401. This seminal paper formalized the problem of reaching consensus in distributed systems with faulty components, establishing that agreement is possible if and only if fewer than one-third of the participants are faulty.

Castro, M., and Liskov, B. (1999). "Practical Byzantine Fault Tolerance." Proceedings of the Third Symposium on Operating Systems Design and Implementation (OSDI). Demonstrated that Byzantine fault tolerance could be achieved with practical performance through the PBFT algorithm, establishing the three-phase commit protocol (pre-prepare, prepare, commit) that tolerates f faults among 3f + 1 nodes with O(n^2) message complexity.

Nakamoto, S. (2008). "Bitcoin: A Peer-to-Peer Electronic Cash System." Introduced proof-of-work consensus as a solution to the double-spending problem in digital currency, enabling decentralized agreement without trusted parties. Established the longest-chain rule and demonstrated that probabilistic finality increases exponentially with the number of confirmations.

Lamport, L. (1998). "The Part-Time Parliament." ACM Transactions on Computer Systems, 16(2):133-169. Presented the Paxos algorithm for achieving consensus in asynchronous systems under crash failures. Paxos provides the theoretical foundation for many practical consensus implementations, though it does not handle Byzantine failures.

Fischer, M. J., Lynch, N. A., and Paterson, M. S. (1985). "Impossibility of Distributed Consensus with One Faulty Process." Journal of the ACM, 32(2):374-382. The FLP impossibility result proved that no deterministic algorithm can guarantee consensus in a fully asynchronous system if even a single process can fail, establishing fundamental limits on the achievable properties of consensus algorithms.

Dwork, C., Lynch, N., and Stockmeyer, L. (1988). "Consensus in the Presence of Partial Synchrony." Journal of the ACM, 35(2):288-323. Defined the partial synchrony model and showed that consensus is achievable under weaker timing assumptions than full synchrony, providing the theoretical basis for practical BFT protocols including PBFT.

Schwartz, D., Youngs, N., and Britto, A. (2014). "The Ripple Protocol Consensus Algorithm." Ripple Labs Inc. The present paper, describing RPCA and providing formal analysis of its safety and liveness properties under specified UNL overlap and Byzantine fault conditions.

Mazieres, D. (2015). "The Stellar Consensus Protocol: A Federated Model for Internet-level Consensus." Stellar Development Foundation. Introduced federated Byzantine agreement (FBA), where nodes choose their own quorum slices to define trust, sharing conceptual similarities with RPCA's UNL approach while using a different consensus mechanism based on federated voting with ballots.

References

Lamport, L., Shostak, R., และ Pease, M. (1982). "The Byzantine Generals Problem." ACM Transactions on Programming Languages and Systems, 4(3):382-401. งานคลาสสิกนี้ได้ทำให้ปัญหาการบรรลุฉันทามติในระบบกระจายที่มีองค์ประกอบผิดพลาดเป็นรูปแบบทางการ และวางรากฐานเชิงทฤษฎีให้กับระบบที่ทนต่อความผิดพลาดแบบ Byzantine

Castro, M., และ Liskov, B. (1999). "Practical Byzantine Fault Tolerance." Proceedings of the Third Symposium on Operating Systems Design and Implementation (OSDI). งานนี้แนะนำ PBFT และแสดงให้เห็นว่าความทนทานต่อ Byzantine fault สามารถทำได้จริงในทางปฏิบัติ แม้จะมีความซับซ้อนด้านการสื่อสาร O(n^2) ที่จำกัดการขยายตัว

Nakamoto, S. (2008). "Bitcoin: A Peer-to-Peer Electronic Cash System." เอกสาร whitepaper นี้เสนอฉันทามติแบบ proof-of-work เพื่อแก้ปัญหา double-spending ในสกุลเงินดิจิทัล ทำให้เกิดฉันทามติแบบกระจายศูนย์โดยไม่ต้องพึ่งผู้มีอำนาจที่เชื่อถือได้ แต่แลกมาด้วยความหน่วงสูงและการใช้พลังงานมาก

Lamport, L. (1998). "The Part-Time Parliament." ACM Transactions on Computer Systems, 16(2):133-169. บทความนี้นำเสนออัลกอริทึม Paxos ซึ่งบรรลุฉันทามติในระบบอะซิงโครนัสภายใต้ความล้มเหลวแบบ crash และมีอิทธิพลต่อการออกแบบโปรโตคอลฉันทามติในเวลาต่อมา

Fischer, M. J., Lynch, N. A., และ Paterson, M. S. (1985). "Impossibility of Distributed Consensus with One Faulty Process." Journal of the ACM, 32(2):374-382. ผลลัพธ์ความเป็นไปไม่ได้ของ FLP ได้กำหนดขอบเขตพื้นฐานของสิ่งที่อัลกอริทึมฉันทามติทำได้ในระบบอะซิงโครนัส และกำหนดทิศทางพื้นที่ออกแบบของโปรโตคอลฉันทามติเชิงปฏิบัติ