Showing posts with label XRP. Show all posts
Showing posts with label XRP. Show all posts

2017-05-29

What other cryptos can learn from Ripple

While last week I criticised Ripple's XRPs, we can't equate the whole system to its currency. There are many fundamental features of the Ripple system that other cryptos can learn from. A lot of them are small and obscure to anyone who hasn't had a hands-on experience developing systems on top of cryptos. Luckily enough, that's my speciality.

So here are a few features of the Ripple system that other cryptos can learn from, as viewed by a programmer.

AccountTxnID and Memos


Sometimes you need to send a transaction with some extra data attached. Whether it's an invoice ID, customer number, or some other business-related information, you have some data that needs to go into the blockchain. This will help you keep track of what transaction did what, give some identifiable information as to the origin of the transaction and so on.

Even Bitcoin recognised the need for this feature by introducing OP_RETURN in 2014. Before that, people used to create unspendable transaction outputs that the system would have to keep track of forever.

Ripple already had that at launch in 2012 in the form of AccountTxnID and Memos. The first is a short field, ideal for including transaction IDs and similar short strings. The latter can store a lot more complex data structures - long strings, multiple hex arrays, that sort of things.

LastLedgerSequence


When building a more complex cryptocurrency system, you have to deal with the fuzzyness of transactions before they enter a block. Essentially, when you send a transaction out, you might not know what will happen to it until it either becomes part of a block, or a conflicting transaction becomes part of a block. If a transaction becomes lost in the network, gets stuck in a processing queue, or there is something else wrong with the system, it's essentially stuck in a limbo. It may be confirmed in the next second, it may never be confirmed, or maybe it will take a few hours.

So here's the problem - how do you handle such transactions? You can try resubmitting them if you have the hex representation of them, but that still doesn't guarantee an outcome. You can try double-spending yourself, but then you have two transactions stuck in a limbo. Do you resubmit a different transaction to credit the same person? Then you might accidentally send them the money twice if you're not careful. All of those outcomes are less than ideal.

Here is where LastLedgerSequence comes in. It's a field you can include in a transaction that allows you to specify when a transaction will DEFINITELY fail. You put a ledger number sometime in the future, and if the transaction is not included before that given ledger number, you know for sure it will NEVER be included in a ledger. The transactions are allowed to fail gracefully in a predictable manner.

Data vs Metadata


First generation cryptos are fairly straightforward. A transaction does one thing and one thing only - move money around. If a transaction gets included in a block it means the transfer went through, if it doesn't - it didn't. There are only two outcomes here.

When talking about a more complex system, there will naturally be more possible outcomes. Maybe a transaction got included in a block and it did exactly what it was supposed to. Maybe it got included in a block but failed to achieve anything. Maybe there are different paths it could've taken to get to the outcome, etc.

This is why Ripple transactions have both data and metadata to them. The first shows what a transaction SHOULD do, the second - what it DID do. This allows the transactions to be more complex, while still ensuring that any given transaction call returns all the information relating to a given transaction.

Built-in, dedicated distributed exchange


An efficient Crypto 2.0 system benefits a lot from having a distributed exchange built into it. While some systems like NXT only allow trading a given IOU for its native token, Ripple goes one step further and treats all currencies the same. You can trade any currency for any other, even to the point of undermining the value of XRPs because of it. It is also a very important part of a few other features.

While systems with smart contracts like Ethereum can mimic the functionality of Ripple's built-in exchange, it would be hard to compete with the efficiency of a dedicated exchange logic. As someone who has experience programming a crypto exchange, I can attest that order sorting and matching can be a complex task that would be hard to efficiently execute in a smart contract. Ripple has the strongest distributed exchange that I've seen in any crypto project.

Trades as part of a payment


In a system with multiple currencies, how do you go from having currency A to sending someone currency B? Quite often, you'll have to take that currency to some sort of market, trade it, then use the resulting funds to send the second currency directly. Alternatively, you use some sort of third party to brokerage the deal, take a cut and take its sweet time to get there.

This is not a case with Ripple. A trade can happen as a part of a payment. Sending money from one address to another is just as simple whether you hold the same currency or not. The currencies don't matter, only the value does.


A Ripple payment that can be fulfilled by 4 different currencies

This feature leverages the power of a distributed exchange to its full potential. Everyone has access to the same market and doesn't need to hold more than one currency to transact with anyone on the network.

Atomic, multi-currency transactions


A big issue with transactions that span multiple currencies is the possibility of the transaction failing partially and the funds ending up in some transitory currency. If you're sending USD and expecting them to end up as GBP, you wouldn't want to end up with EUROs. This would be a bad outcome discouraging people from sending more complex transactions.

Ripple solves that issue by forcing every transaction to be atomic. Either the transaction is fully processed, or it completely fails. There is no way to end up somewhere down the middle. Moreover, there is virtually no limit to how complex a transaction can be. You can send out one type of currency, which would take multiple different routes and touching on multiple currencies before ending up at your destination as the intended currency. It is rather remarkable.

The consensus algorithm and predictable block times


Ripple does not rely on a traditional mining algorithm to create its blocks. Instead, Ripple uses a consensus algorithm to issue its ledgers. While the system is more centralised than most cryptos because of that, it solves a lot of other important issues.

First of all, the block times are quite consistent. You know exactly how often they are created and the interval between the blocks is very short and stable. Secondly, the system is more resilient against front running, making the distributed exchange more honest. Lastly, the system in general is less susceptible to market manipulation by the miners - they can't stall certain transactions or oracle data in hopes of manipulating the market and gaming the system.

Conclusions


While the Ripple system has its flaws, it also has a lot of interesting features other cryptos can learn from.

2017-05-22

Counterarguments to XRP value preposition

As some of you might know, I really like the idea behind the Ripple system. Creating a settlement layer based on trust and IOUs, being able to issue any asset easily, working quite well as a middleware layer, incentivising specialisation, creating a singularity of money, all of that is great. The system is not without its flaws however - centralisation of validators is an issue, and so is the token distribution. While both are interesting topics, with the recent meteoric rise in XRP price, I think it's worth focusing on that part of the discussion.

Basics of Ripple and XRPs


Ripple is a Crypto 2.0 system launched in late 2012. It is based on a protocol predating Bitcoin by a few years, known as Ripplepay. As any good Crypto 2.0 network, Ripple allows its users to issue and transact in any currency. It also supports its own native currency - ripples, or XRPs.

XRPs have a few key uses on the Ripple network. They are used to pay transaction fees, and are required as reserves for any address using the network and creating trust lines. All in all, it serves as an anti-spam measure for the network. Moreover, since every account on the Ripple network can accept XRPs, it is also promoted as a bridge currency.

IOUs are user-created currencies. While any address can issue their own currency, most people will be using IOUs issued by gateways. Those will usually be denominated in fiat or crypto. The IOUs can be traded directly on the network, sent from one user to another, and even perform atomic, multi-currency bounces in a single transaction.

There are a few key differences between XRPs and IOUs. IOUs have a counterparty risk - if the issuing gateway defaults, the tokens will be worthless. You can only send IOUs to or through people that also trust the same gateway. The gateways usually charge a small percentage fee on every transaction. IOU transactions are a bit bigger and more complicated, meaning they can cost more to execute. XRPs are their own cryptocurrency, meaning they are not redeemable for anything directly.

Beyond that, the Ripple network handles both XRPs and IOUs identically - both can be traded on the decentralised exchange built into the network, both can be part of multi-currency transactions, both operate at the same speed and they are both highly divisible.

Criticism of XRPs


The main criticism levelled at XRPs and thus also against the Ripple network is the way the coins were distributed. Ripple Labs, the creators of Ripple, created the network with 100B XRPs in it, and no new XRPs were created since the network inception. This is not an unknown practice in the crypto space - a lot of networks premine their tokens. However, the network creators usually only keep a fraction of the tokens for themselves, preselling the rest to anyone that wishes to buy some. Ripple Labs however, still owns about 60% of the originally issued tokens. This raises a few issues.

First, the company could try cashing out and potentially crash the market. It is very unlikely however. Ripple Labs has recently taken steps to promote its XRP market and put the majority of their XRPs into an escrow (then again, the escrow is unlocking 1B XRP every month for the next ~4.5 years, so it could be better).

Secondly, since the network fees are paid through burning XRPs, they essentially enrich everyone in proportion to the amount of XRPs they hold (if 1% of the tokens got burned, the remaining tokens would be worth about 1% more provided the market doesn't change). This means Ripple Labs is essentially earning 60% of all network fees on the network. This probably doesn't amount to much at the current time, but may be more important in the future.

Lastly, the amount of XRPs owned by one company gives it a negative reputation. A lot of people in the crypto space dismiss Ripple outright as "a premined scamcoin" just because of the amount of coins owned by Ripple Labs.

All in all, that isn't too damning really. Ripple Labs appears to be reputable enough not to try cashing out of what appears to be their golden goose. However, they are not the only major players around...

The founders of Ripple Labs, Jed McCaleb, Chris Larsen and Arthur Britto gave themselves 20B XRPs early on. This later came to bite Ripple Labs in the ass. Jed left the team to start his own version of Ripple called Stellar, and decided to sell his XRP stash, resulting in a legal kerfuffle, a settlement, and a schedule for how those coins may be sold. If those numbers are correct, Jed is still cashing out 20k USD per week, and come ~2019, he will be able to cash out 750M XRP (worth ~256M USD at today's price of 0.34 USD/XRP). Not an ideal situation if the money from your network will be going to a former employee building your direct competitor to the tune of a quarter of billion dollars. While some of those funds might go to charity, that's still not an ideal outcome.

Now that we've dealt with most of the issues XRPs had to face, let's have a look at how XRPs fare on their own network.

XRPs vs IOUs


While Ripple the network has to compete with Bitcoin, Ethereum and other cryptocurrency networks, XRPs the currency have another important competitor - the rest of the assets on the Ripple network. Some networks, like NXT or Counterparty, ensure their native token is at the centre of every trade - you can't trade IOUs for one another on those networks. In Ripple, you can transact purely in IOUs all day every day without touching XRPs for anything else than the fees.

This ties to the central value proposition of XRPs - being the universal medium of exchange.

Distributed currency network vs XRP as medium of exchange (source, presentation)

In short, the problem is as follows. If you have many different currencies on the network, you can have potentially a very large number of markets between those currencies (mathematically, twice as many markets as there are currencies). This means you would have to have a lot of market makers providing liquidity to every market. However, if everyone agreed to use XRPs as the common currency, you would only need to make one market per currency - between that currency and XRP.

At the moment, it looks like that is the case - the major markets on the Ripple network are all trading XRPs for the various currencies issued on the network. At the time of writing, 11M USD worth of trades and 88M USD worth of payments have been executed on the Ripple network in the last 24 hours, majority of which were using XRPs.

The main advantages given for XRPs being better than IOUs are:

  • XRPs are acceptable by anyone on the Ripple network
  • There are no extra transfer or trade fees on XRPs
  • XRPs have no counterparty risk

However, there are also some drawbacks to XRPs, even not counting the coin distribution and centralisation.

Just because someone can receive XRPs, doesn't mean they'll want to settle in XRPs. The network just essentially forces everyone to have an unlimited trust line to XRPs, even if they wouldn't want to hold them.

XRPs might be a decent universal currency for people that want to hold XRPs, but that might not be ideal for banks or big institutions. That's why we see networks like Corda, or even Interledger Protocol (also developed by Ripple Labs) that don't rely on a native cryptocurrency gain traction, while the best example of a real-world application relying on crypto token in the middle is Abra. Creating a universal, international settlement currency was the idea behind Bitcoin, and you don't really see banks using it for that cause.

Market making essentially boils down to either trading the currency like any other crypto, or copying the market from another source to offset your trades. The amount of liquidity you could copy with XRPs is small in comparison to the nigh-bottomless FX market from the real world. If you are going to see real-world use cases being deployed on Ripple, it will be more likely to see them leveraging the existing FX markets rather than going through XRPs.

While XRPs have no counterparty risk, they also have no counterparty protection. If anyone steals your XRPs, they are gone. With IOUs, you can still appeal to the issuing gateway to halt the transaction and potentially track down where it was withdrawn to. The IOUs are thus much less of a target.

On a similar note, XRPs are much harder to track, which would make them less appealing from a compliance standpoint. Gateways on the other hand can whitelist and blacklist addresses that can use their IOUs, thus having an easier time identifying anyone that uses their IOUs.

If a value of a given currency changes in value, you only need to adjust the market using that currency. If XRPs were the universal currency against which all of the currencies would be traded, any time the value of XRPs would fluctuate, you'd have to adjust the entire market.

Adding a new currency to the distributed IOU network wouldn't necessarily mean you'd have to trade it against every other currency. You could only start trading it against the most popular currency or a few currencies that are easy to make the market for (say, fiat<->USD, fiat<->EUR). Because you can easily execute multi-currency atomic transactions on the network, connecting to even one other currency connected to the network instantly means you are connected to the rest of the network.

XRPs have no transfer fees attached to them. While is possible for a gateway to issue IOUs without transaction fees (that's essentially Tether's business model, but on another network), perhaps even leveraging some other big crypto like Bitcoin or Ethereum through voting pools, the fees on those IOUs can always be changed. It seems that the network standard for transfer fees is about 0.2%, which seems to be smaller than the spread on XRP's biggest market (at the time of writing, 0.00015086 sell, 0.00015003 buy, giving about 0.55% spread). So it is possible that sending money through a very liquid FX market you would pay less in transfer fees than going through a less liquid XRP market on just the spread.

So this leaves XRPs with their primary role - paying transaction fees and fulfilling the needed reserves. All in all, about 50-100 XRPs per person / account would be enough for a lifetime of usage. That used to be less than 1 USD, and now is about 35 USD.

Conclusions


The Ripple network is a very useful Crypto 2.0 tool. However, because of the high flexibility and value propositions of the IOUs on the Ripple network, they are XRPs' main competitor in its home court. While XRPs are still needed to pay the network fees, most of the remaining value prepositions can be seen as overstated. The recent rise in the price of XRPs appears to be largely relying on market speculation (as is the case for all crypto) and a new exchange coming on the market.

Related links