The big blockchain misunderstanding
Crypto proof of stake token protocols and decentralised blockchain Bitcoin dapps are disrupting many technology sectors. In particular, many argue that Ethereum-based Solidity protocols are to cryptocurrency prediction markets what pre-sharding ICOs used to be to mining immutable ledgers with smart contracts.
Wait, what?
The more observant among you may have noticed not all of the above are interchangeable synonyms.
Plan
Uno…
I am going to tell you a story (The Fake News story) which I came up with that might help some of you develop better intuition for what is actually happening when a proverbial Bitcoin gets transferred. I feel like a lot of confusion comes from the fact that many people still try to put blockchain transactions in the framework of banking transactions which they are more familiar with.
Bank transaction != Bitcoin transaction
Dos…
Later, I would like to touch on some of the components underlying the hype around blockchain technology. That will revolve around three themes:
- applications that use blockchain but don’t actually need it
- reasons why people think they should be using blockchain that are actually false
- applications that call themselves blockchain but actually are something else
Tres…
Finally, I will strike a different note and tell you why I think blockchain is the most exciting thing that happened at the intersection of business and academia in computer science since 2006 (when we realised deep learning actually works).
The Fake News story
When something important happens, usually several news services cover the story. Not unexpectedly, the information published differs both due to unavoidable inaccuracy (high variance), as well as deliberate manipulation by the parties involved (high bias).
Let’s take an example of a demonstration taking place on the streets of a certain city. News services biased in favour of the demonstrators’ views might overestimate the number of participants and vice versa. In such cases, there is a need for establishing what the true number was, or at least obtaining a near zero bias, low variance estimate. How can we go about this?
The bank way
First, there’s the bank way (the centralised way). Let’s choose a committee that we decide we trust and let’s let them gather all the relevant information and provide the estimate. It seems like a good idea because the committee is full of trusted experts who know what they’re doing and care about doing their job as best they can.
But then again, can you ensure that experts will never get tempted, manipulated or decide to become manipulators themselves? And what if that happens when a lot is at stake? Isn’t it that it’s precisely when a lot is at stake that people get tempted?
It seems like it would be great to be able to achieve the same without having to choose a trusted committee. In fact, ideally you would be able to trust nobody. This is when you switch to the blockchain way of thinking.
The blockchain way
What if instead of choosing a committee of experts, we chose a random citizen to validate news (certainly not a novel idea). Ideally, that person would do their research as best they can and provide an estimate that is based purely on their research, no personal views or biases involved.
But then again, people are lazy. Also, if a lot is at stake there is nothing stopping them from taking a bribe and saying whatever the manipulating party wants. Or themselves becoming manipulators.
What if the randomly chosen person had an incentive to both do their thorough research and refuse to get manipulated? Let’s take those two one at a time.
Incentive
How to incentivise someone to do their research properly when estimating the number of participants at a demonstration? Simple — promise to give them money if they get it right. The problem is though, we don’t know what the right answer is. Worse still, most of the time nobody knows what the right answer is because nobody actually counted the people. All we have is biased and inaccurate reports, conflicting opinions, historic data of questionable relevance. What now?
The way to go is to try to reach consensus. It is an equilibrium whereby the same number of people would like to see the estimate go up as go down (think stock prices or wisdom of the crowd). The randomly chosen person would be incentivised to do their research thoroughly and provide an estimate that is as close to true as possible. They will only receive a financial reward if their estimate is close to what society-wide consensus is happy to converge to. When there are no possibilities of malicious cooperation, your best bet is to try to be close to the truth.
Majority steals from minority
Here comes a big caveat to the story. Naturally, if over 50% of the population are publicly in support of the demonstration then it might be that the best bet is to overestimate. This however still requires coordination.
As an example, let’s say the piece of news to validate is to what extent a certain politician, call them X, has been involved in fraud. You might have done your research and become convinced that they are guilty but you know that majority are supportive of them. In spite of what you believe, the rational thing to do would be to vote for front page A rather than front page B (see below) because that’s what the society-wide consensus is likely to converge to. However, you need to be quite convinced that most people will put their personal preferences first. Otherwise, it might still be the safest option to have a go at establishing what the truth is.
Nevertheless, majority attacks are definitely a possibility and frankly it’s something that could make Bitcoin, an almost 100 billion dollar industry as of September 2017, disappear overnight. There is absolutely nothing stopping people from deciding to transfer billions of dollars worth of Bitcoin to non-existing accounts. If 51% of the users decide to go with it then that’s the end of the currency. All investors rush to sell their Bitcoins to the few unlucky who were slow to realise what’s happened. Within minutes price of Bitcoin drops to zero and never recovers.
What stops that from happening (or at least has been since January 2009) is the fact that it is precisely in Bitcoin’s users interest to prevent it. They benefit from the network and want it to be in good shape so that price of Bitcoin, which they hold or earn by mining, is as high as possible.
Let’s go back to The Fake News story. For it to work we need to assume that society as a whole cares about the system it has devised to defy inaccurate and manipulated news reports. I personally think it’s not an unreasonable assumption because citizens who decided to participate in the scheme in the first place did it to oppose centralised manipulation and would be less likely to become its active supporters later on. It’s not impossible though, just like it’s not impossible that overnight Bitcoin miners spontaneously decide that they no longer want to benefit from the currency and 51% of them coordinate on destroying it.
Here we go then. Via the mechanism of consensus, a randomly chosen citizen is economically incentivised to act according to the protocol of the scheme that is do their research, refuse to get manipulated and provide the most accurate estimate they can. Let’s work through how this would operate in practice.
How it would actually work
New facts to be validated get constantly published such that at any point in time there is a list of such. Independently, citizens get chosen at random to provide their estimates of some uncertain pieces of data (e.g. the number of people that took part in a demonstration). After they’ve done their research and provided their estimate, it gets published. Note that as citizens get chosen randomly and at random times and they are free to choose which item from the list they want to work on, quite often two or more of them will publish their estimates roughly at the same time. That, both literally and figuratively, creates a fork in our blockchain of events and for a brief period we have two (or more) alternative realities unfolding before our eyes.
The next citizen who is about to publish their estimate for some other event has a choice to make. They can either attach it to one of the forked events (A or B below) or, if both estimates provided seem off, attach it to the previous event (C below). In fact, there is nothing stopping them to fork off an event from a day or a week ago if they are not happy with what has been published since. The important part is that by means of attaching a new block, a user expresses their approval (or at least indifference) of what’s previously been published on that branch. Let’s call it proof of validation (not to be confused with proof of work, stake, time, spacetime and many others).
As a result, at any given point in time, our blockchain of events would actually look more like a tree with many branches.
This is getting quite interesting.
Which branch of the tree of truth is the actual truth?
Naturally, it’s the one that has accumulated the most proof of validation, in other words, the longest one. This is where our economic incentive comes in too.
Citizens only get a payout when their estimates are part of what turns out to be the eventual (longest) true chain.
This is helpful in yet another way. Based on how often new events get published onto the chain and how much branching occurs you can estimate how long it usually takes for a new event to get validated (see average confirmation time for Bitcoin or Ethereum transactions).
As a natural consequence, if a particular event has been validated a long time ago (gathered large amount of proof of validation) there is no point to try and fork off it. You would need a large proportion of users to follow you for that branch to overtake the longest branch. That gives our scheme a very desirable property — history never gets altered. This is precisely what makes blockchain immutable — decentralisation and economic incentives. In any other circumstances blockchain is not immutable, a conclusion I will go back to later in this article.
I hope the above story, even though didn’t mention anything specific about how blockchain is actually implemented in practice, made some concepts a bit more intuitive. Now, I would like to discuss a few topics relating to the blockchain as we know it, starting from its security.
Security
I’ve heard people say that we should be switching from keeping money in banks to blockchain because it is more secure. While that statement is probably overall more true than untrue there are two important caveats. Switching to blockchain in search for security only makes sense if you know what you’re doing and you don’t trust your bank.
To say that cryptocurrencies are more secure than banks is like saying that cars are more safe than airplanes.
True, if an airplane crashes the probability of survival is near-zero while it is much higher during a car crash. However, there is much more strict regulation around flying airplanes and it’s always a professional crew that is in charge while cars can be driven by anyone, there’s DUI, low quality vehicles or roads. As a result, statistics clearly show that cars are a much more dangerous means of transport than airplanes (source needed).
The bank way
If someone steals my credit card, they are still far from free access to all my money. If I also give them my PIN number, they might be able to withdraw a few tens of dollars before the bank gets suspicious of my anomalous behaviour and blocks the card. And even if that happens, customer service is likely to compensate for my losses for marketing reasons.
The blockchain way
On a blockchain, the experience is quite different. You are issued a private key which is a long string of characters which, if intercepted by someone, gives them instant and irrevocable access to all your money. You could distribute funds among several accounts but that adds to the hassle of maintaining and keeping all your private keys secure. What is more, if you loose or mess with your private key in any way, that also means that all your funds are gone just like that.
If that sounds daunting there are of course other solutions. Currently there are several wallet-type products which do the dirty work for you and provide an easy to use and intuitive app for maintaining your crypto-money. One thing to bear in mind though is that it kind of contradicts the reason why you switched to cryptocurrency in the first place. It was because you don’t trust your bank (or fiat currency or regulators), remember? Whereas now you decide to trust whoever built your wallet app. You are probably also using some intermediate software rather than talk directly to the Bitcoin/Ethereum protocol.
This is not an argument pro or against cryptocurrencies but rather I’m bringing attention to the fact that it actually requires a lot of effort to operate in an environment which is truly trustless.
What blockchain is not
I am slightly confused whenever I hear of projects involving private or permissioned blockchains. The opposites, public and permissionless, sound to me like necessary (not sufficient though) conditions for that technology to exist as we know it.
That’s why my interpretation of such projects is that they offer blockchain-like data structures (immutable ledger) and mechanisms (consensus, smart contracts) in house, usually for applications working on data that could never be written to a public blockchain for compliance reasons.
My issue with that is that I feel like it’s a bit wasteful and sends a wrong message for the wrong reasons. If the blockchain is private, permissioned and controlled by a single party then by definition it is not decentralised and the ledger will never be immutable. And if instead of a simple database, we’re using blocks, cryptographic hash functions and Merkle trees doesn’t make it any more immutable.
There’s no such thing as ‘almost immutable’
Don’t get me wrong, I do think it’s useful to experiment with moving some applications that have always been centralised onto blockchain. However, we must make sure it’s clear for everyone that for a blockchain to bring about all its benefits, blocks, hashes and consensus mechanisms aren’t enough. What’s necessary (on top of the above) is an underlying peer-to-peer network — sufficiently large and decentralised.
This brings us to the next topic. If something feels a bit like blockchain but actually isn’t blockchain therefore does not enjoy any of its benefits — why bother? (Let’s put because it’s cool arguments aside for a moment.) An on-blockchain version of an application (if possible) would take 3–5 times longer than an off-blockchain one (source needed).
Why use blockchain
Perhaps I haven’t manifested it enough in this article so far — I am a huge blockchain fan and I believe there are use cases where blockchain is the only way to go. What’s more, I think it’s so fascinating that I most certainly understand people who use it just for the sake of using it and learning even though they could do without it. That is, as long as they are aware of it.
There is also the case I alluded to earlier (private chains) that uses the blockchain technology in such a way that all the benefits are gone and technological overhead remains. Examples include blockchains based on networks that are too small or centralised to be secure or leveraging a non-trusted third party.
For me there are really three aspects that make blockchain fascinating and why I think it is the next (current) big thing:
- the technology itself
- redistribution of resources
- opportunities for machine learning (AI)
Technology
First of all, it’s the technology behind it. I tried my best to give some intuitions with The Fake News story but I’m aware that’s nowhere near enough and I do recommend reading up online, particularly some of the most important white papers. Also, I definitely recommend installing an Ethereum client and trying it yourself so you get a good feel for more abstract questions like:
- what would miners do if people suddenly stopped submitting transactions?
- why can the outside world talk directly to smart contracts and not vice versa?
- what would it actually take to implement sending Bitcoin or Ether by means of a post on social media, a phone call or as a result of an arbitrary real-life event?
Redistribution of resources
Secondly, think about redistribution of resources. If I were to set up a financial transaction with a farmer in Venezuela or a truck driver in Russia, all potential benefits would be negligible compared to the cost of actually making it happen. Not to mention the fact that we would never have a chance to get to know about one another’s existence in the first place.
Think about a global registry of resources and a system for their efficient management. That’s a perfect use case for blockchain because I cannot imagine a body which could be solely entrusted with handling it. We would like to be able to freely redistribute resources among individuals, businesses and states on a global scale. It must be impossible to tamper with the redistribution algorithm, yet it must be fully transparent — a perfect use case for a smart contract. I personally think it could be a use case for machine learning algorithms continuously being retrained on data they gather along the way. This brings us to the last aspect which in my mind makes blockchain special.
AI
Blockchain is the platform which could allow machine learning (AI, if you will) to flourish freely. It’s been no secret for a number of years now that machine learning is actually all about data.
If I were to choose between state of the art model + little data and terrible model + lots of data, I’d always go for the latter.
It’s no wonder that Google let’s you use Tensorflow for free, Amazon gives you computing power almost for free. As long as it is them who have the data, they win.
Now on to some less concrete and more science-fiction-sounding ideas (inspired, among other things, by these blog posts). Currently, there are many cryptocurrencies, coins, tokens available on Ethereum. (Some people say this is precisely because it’s so easy to launch them.) That means there is room for trading and speculation — opportunities to make a bit of money or loose a bit more money. But there is also room for models trained to do algorithmic trading. All data on the blockchain is there, begging for someone to mine it (pun intended) and train some 7-layer-deep convolutional neural network with dropout, max-pooling, embeddings pre-trained on ImageNet, MNIST, Wikipedia corpus — all the good stuff.
It is not impossible that I do manage to train a model that would learn to exploit people’s mistakes and make some fairly regular profit. Blockchain seems to me like a dream environment for training models — all data is public, all data is structured (contract ABIs, protocols, events) and, increasingly, there’s lots of it. So let’s imagine I did manage to train a fairly decent model and on top of that I managed to implement it in Solidity. Of course in that case I would need to go less fancy (not to mention gas cost) but, as machine learning practice teaches us, usually you can get 90% there with, say, a simple logistic regression with well designed features.
So this is how it would work. My smart contract is given some Ether to start with, then sits there, listens for events* (see image description below), featurises them, feeds into our logistic regression model and translates its output into actions it should take (buy/sell tokens, borrow/lend money, clone a slightly different version of itself which would try to make some money and bring profit home).
I glossed over a tonne of detail but there’s nothing that makes that scenario fundamentally impossible. Now, what happens if my smart contract, during its lifetime does generate steady profit? You guessed it — it slowly devours all the money available in the ecosystem. Based on the rules we’ve just defined there is no other option but for it to eventually be all gone.
Where is it gone to though? Nobody stole it. I don’t have it, even though I launched the contract (unless I had set up a backdoor which allows me to withdraw it). It hasn’t disappeared either. It’s in possession of the smart contract, an etheric entity which lives by paying people to let it materialise itself on their computer for a few milliseconds and be gone again. And by materialise I mean perform some computation on their CPUs. The only way to stop it would be to try to force people to stop transacting with it or shut down the blockchain. But haven’t we just spent all that time designing it such that it’s impossible? As long as there are economic incentives for users to maintain it, it will live on. That’s the genius behind blockchain which does sometimes bring about considerations of such slightly concerning scenarios.
As a final thought I would like to briefly go back to The Fake News story and the power of consensus and decentralisation. Those concepts are definitely at the heart of what some of the pioneers of blockchain development think about in terms of the future. Maybe in 5, 10, 20 or 50 years it will be unheard of for any piece of news to get published without some sort of consensus-based decentralised review?
Is that a dream come true since all manipulation and propaganda are gone forever or did we just relinquish all control to an all-powerful entity that is impossible to stop?
Have a think about blockchain. It definitely has the potential to transform the world as we know it.