(If you’re new to blockchain technology, start with my short introduction: What can Blockchain do for you?)
Smart contracts are all the rage these days, and for good reason.
When Ethereum appeared in 2015, it took the blockchain community by storm by demonstrating that it was possible to do so much more with the technology than just digital currency. Suddenly, a whole new class of decentralized applications could be conceived of, and deployed onto a blockchain which could support them.
A smart contract is just a computer program on a blockchain: the basic unit of a dapp, a decentralized application. A dapp can be thought of as a collection of inter-related smart contracts, which together cause the emergence of high-level functionality — much like large IT systems are composed by multiple subsystems or modules working together to become more than the sum of their parts.
A dapp is implemented by deploying a collection of smart contracts onto a blockchain layer, and then interacting with these smart contracts. Examples:
Blockchain is the technological revolution that commoditizes trust. Smart contracts are the tools we use to realize this revolution.
This is a tricky concept to grasp, so let’s look at a simple game as an example.
Let’s play a game. There’s three players: Alice, Bob and Charlie.
Charlie thinks of a number. Alice and Bob have to try and guess a number as close to Charlie’s number as possible; they write it down in an envelope, along with a €5 bill, and hand their bets to Charlie. Charlie gives both €5 bills to whomever got closer.
For example, if Charlie thought of 86, Alice guesses 10 and Bob guesses 90, Bob will win because he was closer.
As long as Alice, Bob and Charlie are trusted parties, this simple game works well. But these simple rules do, in fact, have some holes in them that may need to be addressed.
First of all, Charlie could just take the money and run.
Second, Charlie can conspire with one of the players, let’s say Bob, so that he always says Bob’s guess was closer. Alternatively, Charlie can try to disguise the cheating by just paying Bob a higher proportion of the times that Bob would have been entitled to by chance alone.
Now, how do we work around this? We can make Charlie write his number down and, after the results are in, allow Alice and Bob to see each other’s bets. This way, we’re creating a trail that can be audited.
Alas, this is no longer fun, or profitable, for Charlie. He can’t be easily bribed by Bob any more. So, he decides to start charging Alice and Bob a percentage of the bets, as a fee for his services.
As such, Alice and Bob find themselves intermediated by a costly third party, but the problem is still unsolved. Charlie can still conspire with one of them to always generate numbers within a certain range, so that they’re easier to get closer to — even with an audit, no foul play could be proven.
This leaves Alice and Bob paying an insurance premium against cheating, to a corruptible third party, who could still find ways to cheat anyway.
This is where smart contracts can come in. If Charlie were not a real person, but a smart contract on a blockchain, both Alice and Bob could inspect its code and audit it to ensure its validity and impartiality. Charlie’s random number and the bets would be recorded for auditing, too.
Additionally, being a program and all, Charlie would have no notion of “fun” or “profit”, and wouldn’t need to charge any fees. It would have no agency. It would just mindlessly keep executing its instructions forever.
This is an important word here, that brings me to my next point. Permanence and immutability are two core properties of blockchain technology. In fact, and this is what makes this field so exciting, blockchain is the only way we know how to achieve permanence and immutability in digital records. Once a smart contract is deployed, it remains the same forever. And so, Alice and Bob can keep playing forever, confident that Charlie will never change, because a smart contract is like a digital tattoo: once deployed, it stays deployed, replicated and validated by thousands of nodes, unchanging and eternal.
This is why I like to say that blockchain technology is the revolution that commoditizes trust. This example was simple, but the principles illustrated work equally well at arbitrary levels of complexity. Once we finally appreciate the implications of this disintermediation power, I fully expect the transformation to be as or more profound than what we’ve seen with the Internet and the Web.
So, what can we do with smart contracts? We can trust them. We can trust them to be true to their code, and do exactly as they were told.
This means that we can port a lot of current, real-world functionality into the blockchain and, scaling issues aside, this could bring our current systems an unprecedented level of transparency and confidence. Things like currencies, investment funds, and insurance contracts are premium candidates for migrating into a blockchain.
What’s even more interesting, is that we can use smart contracts to develop and implement new cryptoeconomic paradigms. Cryptoeconomics is one of the most interesting approaches there are to trust. It combines cryptographical certainty with economic mechanism design to incentivize a certain behaviour.
Cryptoeconomics is about using economic incentives to reward participants who further the system’s objectives, and penalize participants who harm the system’s objectives (Vitalik Buterin has a great talk on this).
This allows for new classes of systems, that weren’t really possible to implement before we had blockchain technology. Let’s look at another example: token-curated registries.
Token-curated registries are a mechanism to incentivize the production and curation of lists. It’s a cryptoeconomic protocol that embodies a virtuous economic cycle to keep its curation activity ongoing. BigchainDB’s upcoming Ocean Protocol, a data exchange, makes use of token-curated registries for tracking the reputation of their data sources.
Let’s imagine a simple list system: a list of best restaurants. There are three classes of participants in this system: consumers, candidates, and curators.
First, the list consumers. They don’t pay to use the system, but are the main drivers of its relevance, as their consumption of the list has implications in the real world, because they will go spend money at some restaurant they found on the list.
The second class of participant consists of candidates. If this list becomes popular it will, in turn, cause restaurants to want to be present on it. Therefore, they buy tokens of this ecosystem, and use them to apply to the list. Applications involve staked tokens (meaning that, to apply, you put some tokens in escrow), to prevent candidates spamming lists, and also to provide fees for curators.
Curators, the third class of participant, then vote. They buy tokens and use them to determine whether or not the application should pass, and the restaurant should come on to the list. If they reject it, the restaurant loses their tokens. If they accept it, the tokens are held in escrow. In any case, curation activity is rewarded by paying curators with a part of the tokens staked by the restaurants.
So, summary: curators are incentivized to produce the best possible list. This is because the best lists attract a lot of consumers, and in turn a lot of applicants wanting to attract the attention of those consumers. These applicants have to buy tokens of the system to apply, driving their value up.
What’s fascinating here is that this creates a whole new democratic microeconomy out of thin air. Anyone can participate in these systems by buying some tokens and becoming a curator, therefore standing to earn more tokens from curation activity. Tokens have to be liquid, otherwise people couldn’t buy them to apply to lists, and this means that token holders can also convert them to fiat or another cryptocurrency and cash out.
We invented some new magic internet money, secured it with cryptography, and designed the economic incentives such that this system will work by itself, with no supervision, governed by nothing else than game theory and the trust in the fact that people will always like money.
I’m excited to see what lies ahead.
Thinking of exploring blockchain? Talk to us. Life on Mars is an elite software consultancy now moving into the blockchain space.
Create your free account to unlock your custom reading experience.