How did classical Ripple work?

Remembering pre-Bitcoin designs for digital money

Mike Hearn
Mike’s blog

--

Many people think the first proposal for a radical internet money system was Bitcoin, but they’re wrong. Before Bitcoin existed there was “classic” Ripple, an open source project by a guy named Ryan Fugger. Like with Bitcoin I was there at the start, and in fact I was able to find Bitcoin only a few months after it launched through being in that community.

Classic Ripple never took off and has long since been forgotten. That’s a pity because it was an interesting system. In my first email to Satoshi Nakamoto I asked him what he thought of it, to which he replied:

Ripple is interesting in that it’s the only other system that does something with trust besides concentrate it into a central server.

Over a decade later this analysis still holds. Bitcoin and its derivatives did much interesting work with smart contracts, P2P networks and many other technical topics, but at their core they are still creating ‘ordinary’ currencies. Ripple explored a totally different perspective on monetary theory, one in which money is a way to track debt, not holdings of a scarce token.

From time to time I get asked what Ripple was and how it worked. Unfortunately it’s hard to find good explanations online. At some point Ryan decided to sell the Ripple name to people who created a cryptocurrency firm, and this has rendered Wikipedia and Google useless for finding out about the original concept. In fact the wiki page for Ripple is now rather confusing and appears to be some sort of attempt to rewrite history. The old website is still available but changed location, and many links are dead.

Rather than explain classic Ripple in private emails or chats again, I think it’s time to just write it down for everyone. So let’s begin.

NB: In the following discussion the word “Ripple” always refers to the non-commercial concept that pre-dates the currently existing company of the same name. Despite sharing a name the two systems have very little in common.

Buying things from a grocery store

In conventional economies money is the right to re-allocate ownership of some artificially scarce ‘tokens’ to an entity of your choice. Beyond coins and notes no such tokens actually exist, they are an abstraction over a ledger-like data structure maintained by some sort of peer to peer network: either a consumer P2P network for cryptocurrencies, or a P2P-ish network between banks for government issued ‘fiat’ currencies. In fiat currencies banks are allowed to simply type more tokens into your account by law, as long as it’s considered to be a loan of some kind, and this is where nearly all money comes from. Thus people frequently say that in fiat money systems, ‘money is debt’. This is mostly but not completely true.

In the cryptocurrency world technology is very important, and the social construct of money is relatively unimportant. If you know how the dollar or euro works then you’ll feel right at home with cryptocurrencies because it is bought, sold and used in exactly the same way. Most discussion therefore focuses on technology related matters like cryptography, smart contracts, etc. Very little discussion considers debt relationships and most cryptocurrencies have no built in support for debt (though some people built debt-like instruments on Ethereum).

In Ripple the opposite is true. Ripple always had quite primitive technology, in fact all implementations that existed when I was exploring the project were bog standard centralized websites. Building a genuinely peer-to-peer Ripple implementation was hard for various programming related reasons and nobody had done it. Instead the focus was on the user model and overall economic concept.

The quickest explanation of how it was intended to work goes like this:

“John buys his groceries at the local food cooperative, and uses a smart card to make a Ripple payment in the store. The Ripple routing system finds that the food coop has a balance owing at the local hardware store where they buy maintenance supplies. The hardware store in turn has an outstanding bill with the lawyer up the street. John often does landscaping for the lawyer on credit. To complete John’s payment to the food coop, the Ripple system reduces the food coop’s bill at the hardware store, the hardware store’s debt to the lawyer, and finally lawyer’s debt to John. John walks out with his groceries.”

This explanation may be rather confusing because other than the vague mention of a smart card, this bears no resemblance to how you normally pay for things in a grocery store. Immediately we are faced with many questions:

  • What just happened, exactly? Why is there a hardware store involved? And why is John’s relationship with some random lawyer relevant to anything?
  • In what currency did this ‘payment’ take place, if any?
  • What if John didn’t know the lawyer? Could he still buy the goods?
  • Is this a realistic example or just a theoretical illustration?
  • Who issued the smart card? Is there a bank in this picture somewhere?
  • Why is this better than what we do now?

Let’s try to answer them.

The debt graph

In computer science a diagram consisting of circles and lines between them is called a graph. The pretty data visualizations the word refers to in normal English is to us software guys always a “chart”. In a graph the circles are called nodes or vertices and the lines are called edges.

Graphs are important to us because they’re a very general concept, and it turns out there’s lots of useful bits of mathematics and software that can be applied to them. A simple example is a social graph, better known as a social network, in which the nodes represent people and the edges represent friendships. A less obvious example is the road network, in which edges represent streets and nodes are ‘junction points’ of some sort where roads split or join. Regardless of what the circles and lines mean there are general algorithms that let you answer questions like “starting from A, how do I get to B?”. Whenever you get directions from Google Maps, variants of these algorithms are being used behind the scenes (the so-called “highway hierarchies” algorithm).

Ripple starts with a social graph. The nodes are people or companies. The edges represent lines of credit and also to what extent that line has been used up. Again, Ripple isn’t really about technology so exactly how this graph gets managed is left undefined. Let’s just assume people have a smartphone app that is linked to Facebook or something, it lets them type in that they’re willing to loan a friend or business a certain amount of stuff, and this data ends up …. somewhere.

“Willingness to loan” is a very general concept. In the example above, John was willing to loan the lawyer some hours of his skilled labour to landscape the lawyer’s garden. On the other hand, the hardware store was willing to loan the grocery store some equipment the grocery store hadn’t yet paid for. Ripple doesn’t require any particular unit for lines of credit. Anything will do. You can use ordinary currencies, cryptocurrencies, hours of your own time, bushels of wheat, lines of code written. Whatever you like. However, as we shall see, the system becomes more complicated if people don’t use commonly agreed units, so let’s assume from now on everyone is denoting debt in dollars.

The core observation behind Ripple is that if Alice owes Bob $10, and Bob owes Charlie $10, and Charlie owes Alice $10, then if you handed Alice a $10 note she would give it to Bob, erasing her debt, Bob would give it to Charlie, erasing Bob’s debt, and Charlie would then give it back to Alice, erasing his debt too. The piece of paper would travel in a circle and end up back where it started, yet, nobody would be in debt anymore. And Ripple observes that the entire economy can be viewed this way, as scarce tokens traveling around and around in large and complicated loops, erasing debts as it goes.

A grocery store worker is a simple example of this in real life. When they work for a week the company is building up a debt to them, and when the company makes payroll it’s erasing that debt. The worker will then probably go back into the store as a customer and take something off the shelf, creating a debt to the employer, and will then use some of their salary to erase that debt as they walk out of the store.

What if you could detect this outcome without needing the actual bit of money to flow around in a circle? Then, theoretically, you could dispense with the $10 bill entirely. The moment Charlie types into their smartphone app that they owe Alice $10 for some reason, the system could detect that there’s a cycle in the debt graph and instantly erase everyone’s debts. And because all payments can be seen as just erasing debts, you could actually dispense with the tokens entirely. The dollar bill would remain useful as a shared understanding of value and pricing, but the dollars themselves aren’t necessary anymore.

Well, you can do that. There’s been decades of research into efficiently detecting cycles in graphs and it’s a task programmers sometimes do solve. But there’s a catch: solving it for really big graphs (like a graph of the entire economy) is difficult, especially if you want that graph to not be held entirely on one computer. Hence the programming problems I alluded to earlier.

A more complex example

In Ripple the graph tracks two different things:

  1. How much debt actually exists between nodes (people/companies).
  2. How much debt is allowed to exist between nodes.

To make a payment the Ripple system does a pathfinding operation. It’s searching for one or more routes between you and the seller that have enough of a gap between the amount of debt that exists and the amount that can exist. If it finds such a set of routes then new debts are created along all the found paths, reducing the amount of credit available for next time. This is kinda like how Google Maps can show you multiple routes through the road network and take into account traffic whilst doing so, but the map is of financial relationships instead of streets.

When John bought some groceries the store let him walk out because the system told staff that indirectly the grocery store owed him stuff: the store owed the hardware shop, the hardware shop owed the lawyer and the lawyer owed John. The store doesn’t know or trust John but it doesn’t have to because by giving him food, its own debt to someone unrelated was reduced.

In a real deployment things wouldn’t work out so neatly. What if John’s bill is a big one, and he only did a couple hours work for the lawyer? Then the lawyer’s debt to John may be smaller than what he needs to clear his debt to the store. In this situation a few things can happen:

  1. Ripple may find more than one path through the debt graph, that sum up to the size of his bill. In this case the grocery store may find its debts with several different organizations or people all being reduced by a small amount.
  2. Ripple may find insufficient or no paths. Perhaps John hasn’t worked hard enough, or he worked for people who have no debt connection to the store.
  3. Ripple may find paths but they’re in incompatible units. For example John may have extended the lawyer credit in the form of “hours of landscaping labour” rather than dollars, but that’s no use for clearing a debt denominated in dollars.

If not enough credit can be found then either John cannot pay for the food, or, the store may decide to let him walk out anyway and simply record the fact that he’s in debt to the store in the Ripple ledger. This decision can be made ahead of time by creating a credit edge in the graph, e.g. because John visited the store manager and asked. Again, he can clear this debt by doing work for someone else as long as there’s some chain of debts between that person and the store. In a vibrant enough economy where everyone used Ripple all the time for everything, that debt should eventually go away.

Another way of seeing this is as follows: when John gets paid for some landscaping, his ‘payment’ looks like a bunch of people and companies he interacts with showing up on his phone as owing him something. He can go directly to them and request payment in the form of tokens, which is how Ripple and a non-Ripple systems can co-exist, or he can simply keep those obligations open and watch them disappear as he pays other people for things.

How would loans work? If John wants to expand his landscaping business he could, in theory, spend lots of time convincing individuals to open lines of credit in the app for him, but in reality there’d probably be middlemen who do that convincing full time and aggregate the resulting lines of credit for a fee. We might call these institutions banks, in recognition of the similarity of their role. In fact the Ripple FAQ says:

Ripple doesn’t preclude regular banks from participating. Your relationship with your bank right now is that you grant them near-unlimited credit, and your account balance is the bank’s IOUs that you hold. You may receive a small rate of interest. If you have a bank loan, the bank has also granted you some credit, usually at a much larger rate of interest.

The exact same relationship can be replicated with Ripple, by granting the bank’s Ripple node a large amount of credit at your Ripple node. Then you can send and receive payments through your bank like you do now. In fact, the entire banking and monetary system is just a very limited and centralized way of passing IOUs that evolved before we had the technological capabilities to search a complex trust network for connections between two people.

The way banks currently handle payments among themselves is very much like Ripple.

Other financial institutions would also exist in Ripple. One obvious one is FX traders. If lots of people owe me pounds that’s of no use when I go to the USA, but if I open a line of credit with an FX broker of £1000 and they immediately extend me a line of credit back for $1380 then as long as the FX broker is well connected and widely trusted, I can still buy whatever I need.

Ripple, taxation and inflation

Both Bitcoin and Ripple justified their existence by talking about the inefficiencies, overheads and injustices of the banking system. Whereas Bitcoin framed these in terms of lacking digital cash, Ripple framed them in evolutionary terms:

Since human beings have evolved to form trust relationships with other human beings, and not with institutions, the whole process is problematic, and requires a gargantuan legal framework of bureaucrats, lawyers, regulators, and accountants to stabilize it.

Ripple currency is underpinned by natural trust relationships that exist already within families and between friends. Bureaucrats and coercive legal frameworks are completely optional. The currency has value simply because people value their relationships with other people. It is financial capital backed by social capital.

NB: this answer has a confusing reference to “Ripple currency”, even though this classical Ripple was not a currency.

Ripple was a child of its time. Like Bitcoin, it emerged in the wake of the financial crisis. This led to a few programmers (like Ryan, Satoshi and me) re-evaluating the basics of banking and money. Not surprisingly the problems they were talking about were the problems that seemed important in 2008, like “too big to fail”, the sheer size and complexity of the institutions and so on.

A modern argument for Ripple might look different. It’s been 13 years since the last financial crisis and people are currently focused on other issues, like rapidly rising inflation as governments try to print their way out of the ruinous economic destruction of lockdowns, or the privacy and control issues posed by tech companies. Bitcoin also justified itself via reference to these problems and is thus in a better position to capitalize on modern day concerns, but Ripple is equally capable of solving these issues.

An economy that uses Ripple is immune to governments creating inflation via money printing, because no actual money is being swapped anywhere. ‘Legacy’ currencies are used only to establish shared understandings of the prices of things. Thus a government can create as many tokens in its own central bank computers as it likes, but it wouldn’t be able to spend them into the economy because it wouldn’t have new lines of credit in the Ripple ledger. Therefore in a pure Ripple economy a government would have to implement taxation by forcing people to open lines of credit to the government on a regular basis. Anyone who refused to do this would be penalized in the normal manner, or the government would have to take over the ledger somehow and directly edit the graph to add the debts.

From a libertarian economics perspective this is very interesting because people often don’t recognize inflation as a form of tax. Governments like to present it as a sort of semi-mystical force that’s outside their direct control. They measure it, they target it, but they can’t simply make it be a certain value. In reality all inflation is derived from the ‘printing’ of money by governments (normally obfuscated via mechanisms like bond purchases and control of reserve ratios, but it boils down to the same thing). The newly created money effectively gives the government an invisible first dibs on the economy’s resources. Forcing all taxation to be explicitly materialized in the would make it transparent to everyone how much work they are being forced to do for the public sector, which in turn would make the politics of tax and spending much more concrete than they are today.

Ripple as a materialization of social capital

In today’s world becoming a credit-granting agency is a very difficult thing, which is why not many people create a bank. Ripple makes it easy enough for everyone to do, or perhaps should I say, explores what life would be like if it was that easy.

One effect of this is that it lets you turn social capital (i.e. the trust of your friends) into actual capital (i.e. the acquisition of products and services). Phrased another way, Ripple expects you to ‘rate’ the people around you by specifying exactly how much you’re willing to get into debt on their behalf.

This would be a very new and uncomfortable thing. It’s the aspect of Ripple that people react to the strongest. In particular it opens up the possibility of social bankruptcy. The FAQ puts it like this:

If you make payments through a friend and don’t repay that debt, your friend will be liable to the next link in the chain for those payments. You are putting your friend in uncomfortable position of having to make good on your debts to maintain their good name. They only granted you credit in the first place because they trusted you to not put them in this position!

Simply put, if you don’t pay someone back, you have hurt your relationship with them. What you have gained in financial capital, you have lost in social capital. If you go about not repaying your debts, you will soon have no one left to grant you credit. Money is useless without a community of people who will accept it.

One of the implications of this is you can’t really say how much wealth you have access to. There are no bank balances in Ripple-world, only debts and credits. So whilst you may have a million bucks of spending power today, tomorrow you may have far less if there’s some sort of recession and people start withdrawing their lines of credit to you, or defaulting on their debts. This can of course happen in the present system too (a bank run) but governments are generally unwilling to let the ATMs break and will inflate the currency by arbitrary amounts to prevent it, so in reality people tend to view bank balances as fixed piles of gold that will stick around if not being spent … albeit that may become progressively less valuable over time.

Making Ripple peer to peer

A big reason Ripple never took off was that all usable instantiations were run on a single computer by one person. Bitcoin was truly peer to peer and thus could credibly claim to be immune to centralized takedown — an ever present risk for any project that seeks to revolutionize anything.

Although it was hardly noticed at the time, when I worked at R3 on Corda we actually implemented a P2P Ripple-like protocol. It was a competition entry for Project Ubin, organized by the Singaporean central bank. The code was mostly written by Roger Willis, a friend of mine, and is fully open source under the Apache 2 license. The technical report explains how it works.

The way banks are linked to each other is much like what Ripple proposed. During the day banks open lines of credit with each other on a big central bank operated computer. At night after the banks close that computer does something they call “payment compression”, “net out” or “deadlock breaking”. This searches for cycles of debt between the banks just like Ripple would do between people, and when found, the cycles are eliminated. The goal of this is to improve the capital position at the central bank. In fact this process is one of the reasons that bank payments are often still tied to the solar cycle.

For a variety of reasons like resistance to outages, cyber attacks etc, central banks became interested in whether enterprise blockchain technology could decentralize this process. It was a good chance to show off the power of the Corda platform (which I did most of the design work for), in particular by pushing Corda’s unique “flow framework” to the limit. Flows are a feature that makes it much easier to write complex P2P apps compared to other platforms and we wanted a real world example of this in action.

It wasn’t exactly the original intent, because we weren’t sure how far we could get in the very limited time the competition allowed. Nonetheless by the end we had a decentralised, peer to peer cycle detection and clearance system able to operate at large scales. The code modeled both cash payments to settle debts and obligations, proving you could build a peer to peer Ripple-esque system in reality as long as you had a BFT consensus module and some sort of identity verification system (Corda requires nodes to have names, but those names can be anything e.g. pseudonyms, DNS names could also be acceptable in some networks).

Conclusion

Classical Ripple has been forgotten. It never took off like Bitcoin did and due to a name swap became hard to learn about. Nonetheless, the ideas in it are still as fresh as they were 15 years ago.

With time it became clear that cryptocurrency valuations weren’t stabilizing in the way we originally hoped, largely due (in my view) to the market manipulations practiced by central banks combined with lack of volume. The dream of a cryptocurrency becoming a useful global form of electronic cash died thanks to technical inadequacy, community takeover+infighting, and the 25%+ overnight value swings that made them nearly impossible to use as a working business currency.

Because it doesn’t actually create a new currency at all the classic Ripple concept should be much more immune to market gyrations. With Corda we showed that you could make the concept work in a technologically p2p and decentralized manner. And it would offer a way to escape the re-awakened dragon of consumer inflation.

Although I’ve moved on to other things, perhaps someone else may be interested in exploring this old idea. Let me know if you do!

--

--