Ripple (XRP) — Quick Introduction

More of a Payment protocol, less of a Cryptocurrency

Published in
17 min readDec 8, 2019

--

The XRP Ledger is a decentralized cryptographic ledger powered by a network of peer-to-peer servers. The XRP Ledger is the home of XRP, a digital asset designed to bridge the many different currencies in use worldwide.

Assumption. The following article requires a basic understanding of the Bitcoin protocol.

History

In 2012, the creators of the XRP Ledger (Chris Larsen, Jed McCaleb, and Arthur Britto) gave 80 billion XRP to Ripple (the company, called OpenCoin Inc. at the time) in exchange for Ripple developing and promoting the XRP Ledger. Since then, the company has regularly sold XRP, used it to strengthen XRP markets and improve network liquidity, and incentivized development of the greater ecosystem. In 2017, the company placed 55 billion XRP in escrow to ensure that the amount entering the general supply grows predictably for the foreseeable future. At the start of each month, 1 billion XRP is released from escrow for Ripple to use. Ripple publishes sales figures quarterly in the market report.

Properties, Jargon, Definitions

  • Born in 2012
  • Drop = the smallest amount of XRP, i.e. 10^-6 (i.e. same concept as a Satoshi in Bitcoin)
  • 1 drop = 0.000001 XRP
  • Ledger = block (i.e. same semantics of a block in Bitcoin)
  • Ledger version = block height
  • Ledger node = an object in the ledgers state tree
  • Fixed Supply = 100 billion XRP
  • Block genesis starts at block 32569 (due to a historical bug)
  • Block mined every 4/5 seconds
  • Slightly deflationary
  • Throughput up to 1500 transactions per second (1500 tx/s vs. 50k tx/s of Visa)
  • Smart contract platform: not programmable (not to be confused with the Ethereum semantics), primitives for Escrow, Checks, and Payment Channels, support cutting-edge financial applications including the Interledger Protocol
  • Cryptography used: ecdsa, Ed25519
  • Saves the entire current state in every block
  • Trusted set of validators
  • Unique Node Lists (UNLs) = lists of transaction validators a given participant believes will not conspire to defraud them
  • BFT consensus protocol
  • Account-based model
  • Features: Payment Channels, Escrow, DepositAuth, Decentralized Exchange, Invariant Checking, Amendments…

Concepts

The XRP Ledger is a decentralized cryptographic ledger powered by a network of peer-to-peer rippled servers. We could describe the XRP protocol with six basic concepts:

  1. Payment Systems Basics. One of the primary purposes of the XRP Ledger is payment processing.
  2. Payment Types. The XRP Ledger supports point-to-point XRP payments alongside other, more specialized payment types.
  3. Issued Currencies. All currencies other than XRP can be represented in the XRP Ledger as issued currencies.
  4. Decentralized Exchange. The XRP Ledger contains a fully-functional exchange where users can trade issued currencies for XRP or each other.
  5. Consensus Network. The XRP Ledger uses a consensus algorithm to resolve the double-spend problem and choose which transactions to execute in which order. Consensus also governs rules of transaction processing.
  6. The rippled server. rippled is the core peer-to-peer server that manages the XRP Ledger.

XRP is the native cryptocurrency of the XRP Ledger. All accounts in the XRP Ledger can send XRP among one another and must hold a minimum amount of XRP as a reserve.

The XRP Ledger’s consensus algorithm settles transactions in 4 to 5 seconds, processing at a throughput of up to 1500 transactions per second. When the XRP Ledger began, 100 billion XRP were created, and no more XRP will ever be created. Each XRP is subdivisible down to 6 decimal places, for a grand total of 100 quadrillions (10¹⁷) drops of XRP. The available supply of XRP decreases slowly over time as small amounts are destroyed to pay transaction costs.

If the network is busy, potential transactions that promise to destroy more XRP can cut in front of the transaction queue. This is an anti-spam measure to make it prohibitively expensive to DDoS.

One of the biggest features that sets the XRP Ledger apart from other cryptocurrency networks is that it also contains a full currency exchange that runs on the XRP Ledger. Within this system, businesses (typically called “gateways”) can freely issue any currency they want to customers, and those customers can freely trade issued currencies for XRP or other issued currencies issued by any gateway.

Ledger History

The XRP Ledger processes transactions in blocks called “ledger versions”, or “ledgers” for short. Each ledger version contains three pieces:

  1. The current state of all balances and objects stored in the ledger.
  2. The set of transactions that have been applied to the previous ledger to result in this one.
  3. Metadata about the current ledger version, such as its ledger index, a cryptographic hash that uniquely identifies its contents, and information about the parent ledger that was used as a basis for building this one.
Image 1: Ledger

As long as fewer than 20% of trusted validators are faulty, consensus can continue unimpeded; and confirming an invalid transaction would require over 80% of trusted validators to collude. If more than 20% but less than 80% of trusted validators are faulty, the network simply stops making progress.

Base Reserve and Owner Reserve

The reserve requirement is divided into two parts:

  • The Base Reserve is a minimum amount of XRP that is required for every address in the ledger. Currently, this is 20 XRP (20000000 drops).
  • The Owner Reserve is an increase to the reserve requirement for each object that the address owns in the ledger. Currently, this is 5 XRP (5000000 drops) per item.

In order to transact on the protocol, an account owner is required to have at least the minimum base reserve. If an account has less than 20 XRP in his balance it will not be able to send transactions.

Accounts

Accounts can send transactions and hold XRP. An account must hold a minimum reserve to execute transactions. This is an anti-spam measure to disincentivize making the ledger data occupy too much space. Accounts in the XRP Ledger are identified by an address in the XRP Ledger’s base58 format. The address is derived from the account’s master public key. You cannot spend or transfer the reserve requirement of 20 XRP, so this amount is locked up with each new account. The core elements of an account are:

  • Identifying address, as an example consider this address: rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn
  • Reserve: XRP balance
  • Sequence number (same semantics as in Ethereum), starting at 1 and increasing with each transaction sent from this account. No transaction can be included in a ledger unless the transaction’s sequence number matches its sender’s next sequence number
  • A history of transactions that affected this account and its balances

An account can also be the owner (or partial owner) of several other types of data. Non-XRP currencies and assets aren’t stored in an XRP Ledger Account itself; each such asset is stored in an accounting relationship called a “Trust Line” that connects two parties.

Unlike Bitcoin and many other crypto-currencies, each new version of the XRP Ledger’s public ledger chain contains the full state of the ledger, which increases in size with each new account. For that reason, Ripple discourages creating new accounts unless entirely necessary. Institutions who send and receive value on behalf of many users can use Source Tags and Destination Tags to distinguish payments from and to their customers while only using one (or a handful) of accounts in the XRP Ledger

Creating Accounts. There is not a dedicated “create account” transaction. The Payment transaction automatically creates a new account if the payment sends XRP equal to or greater than the account reserve to a mathematically-valid address that does not already have an account.

Addresses

A valid address is a string that has the following properties:

  • Between 25 and 35 characters in length
  • Starts with the character r
  • Case-sensitive

Example of a valid address: “rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn”

Transactions

A Transaction is the only way to modify the XRP Ledger. Transactions are only final if signed, submitted, and accepted into a validated ledger version following the consensus process. Transactions that fail are also included in ledgers because they modify balances of XRP to pay for the anti-spam transaction cost.

The transaction cost (sometimes called the transaction fee) is a minuscule amount of XRP destroyed to send a transaction. This cost scales with the load of the network, which protects the peer-to-peer network from spam. Transfer fees are optional percentage fees that issuers can charge to transfer the currencies they issue to other addresses within the XRP Ledger. The current minimum transaction cost required by the network for a standard transaction is 0.00001 XRP (10 drops). It sometimes increases due to higher than usual load. The transaction cost is not paid to any party: the XRP is irrevocably destroyed.

Deposit authorization. With Deposit Authorization enabled, transactions cannot send value of any kind to the account unless the sender of those transactions is the account itself. Financial services regulations and licenses may require that a business or entity must know the sender of all transactions it receives. This presents a challenge on a decentralized system like the XRP Ledger where participants are identified by pseudonyms which can be freely generated and the default behavior is for any address to be able to pay any other. The Deposit Authorization flag introduces an option for those using the XRP Ledger to comply with such regulations without changing the fundamental nature of the decentralized ledger. With Deposit Authorization enabled, an account can only receive funds it explicitly approves by sending a transaction. The owner of an account using Deposit Authorization can perform the due diligence necessary to identify the sender of any funds before sending the transaction that causes the account to receive the money.

Source and Destination tags. Source tags and destination tags are a feature of XRP Ledger payments that can indicate specific purposes for payments from and to multi-purpose addresses. Source and destination tags do not have direct on-ledger functionality; source and destination tags merely provide information about how off-ledger systems should process a payment. For example, a payment to an exchange or gateway address can use a destination tag to indicate which customer to credit for the amount of the payment in that business’s own systems. A payment to a merchant could indicate what item or cart the payment is buying. The practice of giving customers the ability to send and receive transactions from your XRP Ledger address using another interface is called providing hosted accounts. Hosted accounts typically use source and destination tags for each customer.

Checks

The Checks feature in the XRP Ledger allows users to create deferred payments that can be canceled or cashed by the intended recipients. Because funds are not put on hold when the Check is created, cashing a Check can fail if the sender doesn’t have enough funds when the receiver tries to cash it, just like traditional checks. XRP Ledger Checks have expiration times after which they may no longer be cashed. If the receiver doesn’t successfully cash the Check before it expires, the Check object remains in the XRP Ledger until someone cancels it.

Image 2: Check example

Why Checks? Traditional paper checks allow people to transfer balances without immediately exchanging physical currency. XRP Ledger Checks allow people to exchange funds asynchronously using a process that is familiar to and accepted by the banking industry. XRP Ledger Checks also solve a problem that is unique to the XRP Ledger: they allow users to reject unwanted payments or accept only a portion of a payment. This is useful for institutions that need to be careful about accepting payments for compliance reasons.

Problem: To comply with regulations like BSA, KYC, AML, and CFT, financial institutions must provide documentation about the source of funds they receive.

Solution: Accounts with Deposit Authorization enabled can only receive funds through Escrow, Payment Channels, or Checks. Checks are the most straightforward, familiar, and flexible way to transfer funds if Deposit Authorization is enabled.

Escrow

Escrow is a feature of the XRP Ledger that allows you to send conditional XRP payments. These conditional payments, called escrows, set aside XRP and deliver it later when certain conditions are met. Escrows can depend on time limits, cryptographic conditions, or both. The XRP set aside in an escrow is locked up. No one can use or destroy the XRP until the escrow has been successfully finished or canceled. Before the expiration time, only the intended receiver can get the XRP. After the expiration time, the XRP can only be returned to the sender. Escrow only works with XRP, not issued currencies.

Image 3: Escrow example

Partial Payment

The “Partial Payment” flag allows payment to succeed by reducing the amount received instead of increasing the amount sent. Partial payments are useful for returning payments without incurring additional costs to
oneself. The “sent amount” and the delivered amount (Amount) may be
denominated in different currencies and converted by consuming Offers in the XRP Ledger’s decentralized exchange. Direct XRP-to-XRP payments cannot be partial payments; issuance-to-XRP payments or XRP-to-issuance payments can be partial payments.

Payment Channels

Payment Channels are an advanced feature for sending “asynchronous” XRP payments that can be divided into very small increments and settled later. The XRP for a payment channel is set aside for a given time period. The sender creates Claims against the channel, which the recipient verifies without sending an XRP Ledger transaction or waiting for a new ledger version to be approved by consensus. At any time, the recipient can redeem a Claim to receive an amount of XRP authorized by that Claim.

Why Use Payment Channels? The process of using a payment channel always involves two parties, a payer and a payee. The payer is an individual person or institution using the XRP Ledger who is a customer of the payee. The payee is a person or business who is receiving XRP as payment for goods or services.

Image 4: Payment Channel flow

Payment Channels set aside XRP. The recipient can claim XRP from the channel in bulk using signed authorizations. Individual authorizations can be verified without sending a full XRP Ledger transaction. Payment channels are good for extremely high-volume micropayments or “streaming” payments.

Issued Currencies

All currencies other than XRP can be represented in the XRP Ledger as issued currencies. These digital assets (sometimes called “issuances” or “IOUs”) are tracked in accounting relationships, called “trust lines,” between addresses. Issued currencies are typically considered as liabilities from one perspective and assets from the other, so the balance of a trust line is negative or positive depending on which side you view it from. Any address may freely issue (non-XRP) currencies, limited only by how much other addresses are willing to hold. Issued currencies can be traded with XRP or each other in the XRP Ledger’s decentralized exchange. The issuer of a currency can define a percentage transfer fee to deduct when two parties transact in its issued currencies. Addresses can also freeze issued currencies, which may be useful for businesses to comply with financial regulations in their jurisdiction.

Frequently, issued currencies in the XRP Ledger, represent value held by gateways in the world outside the XRP Ledger. The address that issues those funds in the XRP Ledger is expected to pay the balance back, outside of the XRP Ledger, when users redeem their XRP Ledger balances by returning them to the issuer.

Rippling

Rippling through another address is the process of moving debt around. In the typical case, this involves reducing an issuer’s obligation to one party and increasing the obligation to another party. In the XRP Ledger, “rippling” describes a process of atomic net settlement between multiple connected parties who have trust lines for the same currency. Rippling is an essential part of issued currencies because it allows users who trust the same issuer to send issued balances to each other with the issuer as a passive intermediary. In a sense, rippling is like a passive, two-way currency exchange order with no limit and a 1:1 exchange rate for two currencies with the same currency code but different issuers. Rippling only occurs along the paths of a payment. Direct XRP-to-XRP payments do not involve rippling.

Image 5: Rippling example

Example of Rippling. See Image 5. “Rippling” occurs when more than one trust line is adjusted to make a payment. For example, if Alice owes Charlie money, and Alice also owes Bob money, then you could represent that in the XRP Ledger with trust lines like so: If Bob wants to pay $3 to Charlie, then he could say, “Alice, take $3 of the money you owe me, and pay it to Charlie.” Alice transfers some of the debt from Bob to Charlie.

This process, where two addresses pay each other by adjusting the balances of trust lines in between them, “rippling”. This is a useful and important feature of the XRP Ledger. Rippling occurs when addresses are linked by trust lines that use the same currency code. The issuer does not need to be the same: in fact, larger chains always involve changing issuers.

Fees

The TransferRate setting in the XRP Ledger allows financial institutions that issue currency in the XRP Ledger to charge users a transfer fee for sending the currencies issued by that financial institution. The sender of the transfer is debited an extra percentage based on the transfer fee, while the recipient of the transfer is credited with the intended amount.

Image 6: Fees example
Image 7: Fees example

Paths

A single Payment transaction in the XRP Ledger can use multiple paths, combining liquidity from different sources to deliver the desired amount. Thus, a transaction includes a path set, which is a collection of possible paths to take. The paths in a path set must start and end with the same currency. Every step is either:

  • Rippling through another address with the same currency.
  • Exchanging currency at an order book.
Image 8: Path example

Decentralized Exchange

The XRP Ledger contains a fully-functional exchange where users can trade issued currencies for XRP or each other. Offers are the XRP Ledger’s form of currency trading orders. Autobriding automatically connects order books using XRP as an intermediary when it reduces costs. Issuers can set custom tick sizes for currencies to reduce churn in order books over minuscule differences in exchange rates.

Offers

In the XRP Ledger’s decentralized exchange, orders to trade currency are called “Offers”.

Auto-Bridging

Any Offer in the XRP Ledger’s decentralized exchange that would exchange two non-XRP currencies could potentially use XRP as an intermediary currency in a synthetic order book. This is because of auto-bridging, which serves to improve liquidity across all currency pairs by using XRP when doing so is cheaper than trading those currencies directly.

Consensus

The XRP Ledger uses a consensus algorithm to resolve the double-spend problem and choose which transactions to execute in which order. Consensus also governs rules of transaction processing. The peer-to-peer XRP Ledger network consists of many independent XRP Ledger servers (typically running rippled) that accept and process transactions.
In general, consensus can continue without problems as long as only a small percentage (less than about 20%) of trusted validators are misbehaving at a given time. If more than about 20% of validators are unreachable or not behaving properly, the network fails to reach a consensus. The only way to confirm an invalid transaction would be to get at least 80% of trusted validators to approve of the transaction and agree on its exact outcome.

Image 9: Consensus flow

At the core, the XRP Ledger is a shared database that records information such as accounts, balances, and offers to trade assets. Signed instructions called “transactions” cause changes such as creating accounts, making payments, and trading assets.

The main job of the XRP Ledger Consensus Protocol is to agree on a set of transactions to apply to the previous ledger, apply them in a well-defined order, then confirm that everyone got the same results. 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. Ripple proposes a consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks within the larger network.

This protocol, known as the XRP Ledger Consensus Protocol, is designed to have the following important properties:

  • Everyone who uses the XRP Ledger can agree on the latest state, and which transactions have occurred in which order.
  • All valid transactions are processed without needing a central operator or having a single point of failure.
  • The ledger can make progress even if some participants join, leave, or behave inappropriately.
  • If too many participants are unreachable or misbehaving, the network fails to make progress rather than diverging or confirming invalid transactions.
  • Confirming transactions does not require wasteful or competitive use of resources, unlike most other blockchain systems.

These properties are sometimes summarized as the following principles, in order of priority: Correctness, Agreement, Forward Progress. It’s OK if a small proportion of validators don’t operate properly all the time. As long as fewer than 20% of trusted validators are faulty, consensus can continue unimpeded; and confirming an invalid transaction would require over 80% of trusted validators to collude. If more than 20% but less than 80% of trusted validators are faulty, the network simply stops making progress.

Amendments

The Amendments system provides a means of introducing new features to the decentralized XRP Ledger network without causing disruptions, i.e. provide smooth upgrades to the existing feature set, so the technology can continue to evolve without fracturing the ecosystem or causing uncertainty around times of transition. The amendments system works by utilizing the core consensus process of the network to approve any changes by showing continuous support before those changes go into effect. An amendment normally requires 80% support for two weeks before it can apply.

Rippled server

rippled is the core peer-to-peer server that manages the XRP Ledger.

Stats

Storing thefull history of the XRP ledger is expensive. As of 2018–12–11, the full history of the XRP Ledger occupies approximately 9 terabytes of disk space, which must be entirely stored on fast solid-state disk drives for proper server performance. Such a large amount of solid-state storage is not cheap, and the total amount of history you must store increases by approximately 12 GB per day. Some protocol numbers as of 2019:

  • Current block height: 51.000.000+
  • Transactions: 1.259.000.000+
  • Addresses: 1.860.000+

Conclusion

In this short article, we briefly walked through the core principles and concepts of the XRP Ledger protocol. Even though it shares some of the characteristics of Bitcoin and Ethereum we can easily conclude that the XRP protocol is slightly more of a Payment Protocol and less of a Cryptocurrency.

References

Last modified date: 09/12/2019

--

--