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


2017-05-14

Another crypto bubble and the rise of altcoin markets - a story in 9 charts

The crypto markets seem to be in another bubble, orders of magnitude bigger than the last. However, this time a lot of the money is flowing into altcoins interestingly enough. How this situation will play out and where the market will stabilise at will be a really interesting story to watch unfold - whether Bitcoin will re-capture the market, or will some other crypto take its place. I would like to take this time to go over some of the history that brought us here however, as it's also a fascinating tale (if you like graphs).

Here is a short version of the story, in one graph by Woobull:
Bitcoin network congestion, market dominance, and altcoin marketcap, by Woobull.


This is a cautionary tale for Bitcoin, but before we can really talk about how Bitcoin might be impacted, we have to talk about some altcoins. So strap yourself in for this whale of a tale in 9 charts...

Story leading up


The story of this bubble really starts around 2015, when some Bitcoin core developers wanted to address the network congestion they saw coming in Bitcoin. This was the start of the Bitcoin scaling debate that gave rise to BitcoinXT, Bitcoin Unlimited, SegWit, UASF, etc. The writing was on the walls - if Bitcoin continued to grow in popularity, soon the blocks would be full and we would have to deal with the consequences. Two years have passed, and no consensus has been reached, thus priming us for the current events.

Bitcoin Unlimited Rally


The bubble proper was started by the disagreement on how to scale Bitcoin. At the moment, there were two major solutions being proposed to address the issue - SegWit and Bitcoin Unlimited. Perhaps tired of waiting for consensus to emerge, perhaps prompted by Roger Ver's ambitions, Bitcoin Unlimited started to rally people behind its hard fork. Those came in two main waves - around October 2016, and March 2017, increasing both node count and number of blocks mined.




The fact that Bitcoin Unlimited was gaining momentum, coupled with rumours of a planned 51% attack to cull a network split made serious waves in the community. We were faced with a real possibility that the network will fork and perhaps split. Every major player was taking sides in the discussion, and the tensions kept rising. The problem got exacerbated by the Covert ASICBOOST scandal. If Bitcoin had a doomsday clock for the network splitting, it would probably be uncomfortably close to midnight.

With the uncertainty of Bitcoin's future and the rising tensions, other events started to take place.

Rise of Ethereum


2016 has been a bit of a rollercoaster for Ethereum. The year started at a sub-dollar price per ETH, reached about 20 USD/ETH due to The DAO, then slumped to about 7 USD/ETH after its hard fork and network split. The new year started on a positive note with a roadmap for the future of Ethereum. ETHs were sitting comfortably at #2 market spot by market cap, increasing a bit with Bitcoin price increases (1, 2, 3, 4) as you'd expect in a calm market.

Then March came along. Bitcoin Unlimited started gaining popularity, and the fear of a potential Bitcoin network split started shaping the market. While historically Bitcoin has been seen as the stable gold standard among cryptos, the safe heaven you'd park your money at if you didn't want to cash out into fiat. However, with the future of the network being uncertain, some people decided to move their wealth elsewhere.

March was the month where Bitcoin slumped and Ethereum was there to pick up the money moving away (1, 2, 3, 4). You can practically see the ~21B USD market cap shifting gently towards Ethereum, giving it a boost from 1.6B USD to 4.6B USD in that month, while Bitcoin went from 20B USD to 15B USD.



In April the Bitcoin situation started to calm down. Bitcoins started to recover along with their market cap going back to 21B USD by the end of the month (1, 2, 3, 4, 5). However, another important development started brewing elsewhere...

Litecoin and SegWit


Litecoin has always been "silver to Bitcoin's gold", its shadow. Sometimes outperforming Bitcoin price increases percentage-wise, but rarely making a big splash overall. Seeing Bitcoin stumble with its scaling solutions, it seized on the opportunity to make a name for itself.

What is important to remember, is that Litecoin can be classified as a "copycoin" - a cryptocurrency largely operating similar to Bitcoin, on a pretty similar codebase with minor tweaks. It's so similar, that by chance or negligence, Litecoin's multisig addresses have the same prefix as Bitcoin. Copycoins in general operate on hype and innovation (real or manufactured) - there are so many similar coins that if you don't stand out from the crowd, you're going nowhere.

While Litecoin did not have the network congestion issues of Bitcoin, it still decided to improve its network and push for SegWit adoption. While it looks like the process started in February, there was a considerable rally for SegWit in late March, as indicated by the sudden jump in SegWit blocks and market activity.



The process was spearheaded by Charlie Lee, the creator of Litecoin. A notable opposition to the SegWit progress were Bitmain and Antpool. Supposedly they were blocking Litecoin's SegWit activation to prevent further SegWit adoption on the Bitcoin blockchain, where they are allegedly profiting from Covert ASICBOOST. After a long ordeal, Litecoin finally locked in and activated SegWit mere days ago.

There have been some other altcoins that also followed Litecoin's SegWit adoption, but their stories aren't that interesting.

The price also reflected that - going from under 5 USD/LTC at the start of the year with about 220M USD market cap, to a high of 35 USD/LTC and 1.8B USD market cap in the recent weeks. While this would normally allow it to take #3 spot on the crypto market cap list, another network had a meteoric rise that came largely out of nowhere...

Rise of Ripple


Ripple has had a mixed reputation in the Bitcoin community. It's the oldest and one of the most prominent Crypto 2.0 networks. It has been caught the ire of bitcoiners in 2013 for being seen as "pro-regulation" during US Senate hearingsdeclared dead in 2014 (Bitcoin has been declared dead over 100 times now), has been fined by FinCEN for Bank Secrecy Act Violations, etc. Ripple Labs have developed essentially a competitor to its own network - the Interledger Protocol.

However, more recently it looks like the company is going back to its roots and focusing on the Ripple network. It stated publishing quarterly market reports on XRPs and talking about its plans for the future. There are more and more news about various banks using its network. All in all, it looks like the market has warmed up to the currency:


While we see a small blip on the chart in early April when it crossed 1B USD market cap, the currency started to enter a meteoric rise around the start of May (1, 2, 3). The year started with a market cap of 220M USD and a price of 0.006 USD/XRP, while currently it sits at 8.4B USD and 0.22 USD/XRP.

Now, let's look at how this all comes together.

Market dominance


At the time of writing, we this is how the market looks like:

#1 Bitcoin - price: 1813 USD/BTC, market cap: 29.6B USD
#2 Ripple - price: 0.22 USD/XRP, market cap: 8.4B USD
#3 Ethereum - price: 90.8 USD/ETH, market cap: 8.3 BUSD
#4 Litecoin - price: 29.6 USD/LTC, market cap: 1.5B USD

Total market capitalisation of all coins: 55B USD, of which 25B USD are in altcoins. This means Bitcoin's market dominance is under 55%, while at the start of the story, it was about 85%:


Bitcoin has historically been the "gold standard" for crypto. The market leader, the first mover, the biggest whale. However, it seems like in this market if you're standing still, you're moving backwards.

Since the start of our story, Bitcoin has periodically dipped in its price, but overall we're seeing all-time high price. The recovery was probably due to people worrying less about the potential network split that might come from Bitcoin Unlimited. Bitcoin is certainly stronger than ever, but there might also be blood in the water - despite the price of bitcoins rising, so too did the altcoin markets grew in leaps and bounds.

Whether this bubble we're in right now (and it certainly has the look of a bubble) will pop hard and the market will rebound in Bitcoin's favour, or whether a new paradigm will be made where bitcoins play less of a dominant role, only time will tell. It is very unlikely Bitcoin will ever sink too deep into the coin list, but if the scaling stalemate continues, Bitcoin's advantage will be eroded over time.

For years one could easily dismiss altcoins as being a fad, nowhere near as mature as Bitcoin. But at some point you have to realise you might have to compete for your top dog spot. We're living in a market that is used to exponential growth, and Bitcoin's market cap is "only" two doublings away from its next competitor.

Conclusions


We are probably in the biggest crypto bubble to date. Not only has once again reached its all-time high price recently, but the altcoins have also grew by leaps and bounds.

In the near future, I would expect some large contraction, especially in the alt market. Litecoin will probably dip back down now that SegWit is activated and its rally is over.

It will be interesting to see where the money will flow if the value of bitcoins will pop - whether people will be cashing out to fiat, or altcoins.

The biggest threat for Bitcoin is still the scaling issue - if that's not dealt with soon, the issue might just go away... along with many Bitcoin users that will switch to some of the alternatives.

2017-05-07

Direct and indirect earnings in crypto

The crypto space is a strange place to be in over a long period of time. Once the coins you bought for a few dollars start becoming a noticeable portion of your net worth, you may start thinking to yourself - "should I work a normal job, or should I work for the cryptocurrency"?

This mostly stems from the fact that you generally can't use a cryptocurrency without also being invested in it. I may hold $1000 in a credit card, but I don't own any shares in Visa or Mastercard. However, when I hold $1000 worth of bitcoins, I inevitably own a part of the Bitcoin economy. As its value rises and falls, so too do the coins in my wallet. While this also is true for real-world currencies, their market cap is so far beyond us mere mortals that we can't really hope to influence it in a significant way. Cryptos are still fledgling economies where each person could make an impact.

Some of the Bitcoin core developers are also early Bitcoin adopters. I would imagine a good number of them hold a significant amount of coins. Those that do don't need to expect a salary for developing the core technology behind Bitcoin if their work contributes to the increased price of Bitcoin. If you hold $1M worth of coins and the value increases by 10% in a year, you have indirectly earned $100k that year. This is essentially the same as working for equity, except you can cash out more freely.

The same goes to a lesser or greater extent to everyone else in the space. Anyone holding the coins stands to benefit from the coins increasing in value. While this can be benevolent, the same economic forces can encourage people to use their influence for personal gain at the expense of the much broader community. Because coins aren't stocks, you can cash out and change "allegiance" at a drop of a hat unfortunately.

Even when we're not talking about people that can influence the market, the endowment effect is very much real in the crypto community. You value and perceive the coins you own much more favourably than the ones you don't. If you don't own ethers you might have cheered when the network forked and belittle its rise in price in the more recent times. It's a similar mechanism behind the "hodl" mentality. Even though you may benefit from selling coins when the value is going down and buying when the value is going up, some people tend to prefer holding onto their coins going up and down rather than realising their gains or losses. "If the price is going up, my bitcoins will be worth more. If the price is going down, I'll be able to buy more bitcoins".

With the value of various coins going through the roof in recent months, more and more of us will have to face the dilemma of what to do in regards to our growing crypto stash. Whether we continue working our day jobs like nothing happened, retire to a possible life of luxury, or perhaps start working for our cryptos in hopes of contributing to the community and indirectly to the value of our coins. A single person's contribution might not be that large, but a large community working towards similar goals can be influential. Everyone owning a crypto has their skin in the game.