What are Smart Contract Platforms?

Smart contract platforms are a special type of computer used to create, store, authenticate and trade cryptocurrency tokens and NFTs.

Unlike most traditional computer networks – which are run by centralized third-parties such as Facebook, Microsoft or Google – these platforms are 1) distributed (i.e. simultaneously hosted by thousands of different computers all over the world) and 2) decentralized (i.e. not controlled by a single entity).

In fact, many refer to smart contract platforms as “world computers” as they are:

  • Democratic: No single party can control the network and tell users what they can and cannot do

  • Open to Everyone: You don’t need permission to use smart contracts and you can’t be blocked – anyone can use them at any time and from any location

  • Permanent: No one can ever turn them off or shut them down

  • Immutable: Data recorded on a smart contract platform is permanent, and can never be changed or manipulated

  • Transparent: Everyone can see every transaction on a smart contract platform and easily audit things when necessary

Historically, running such a network was thought to be impossible due to a concept known as the Byzantine General’s Problem.

While I’m oversimplifying a bit, this theory basically states that large groups of humans can’t trust one another or coordinate across vast distances without using centralized third parties like banks or corporations to establish trust.

For example, when a stranger sends you money online, you must rely on a third-party (in this case, your bank) to ensure that: 1) they are whom they say they are and 2) they have the money they say they have and 3) they actually send it.

This all changed in the early 2010s with the invention of Bitcoin and Ethereum. These platforms made it possible – for the first time in history – for strangers to exchange assets without relying on banks, corporations or legal systems to enforce the rules and establish trust. While these networks are often colloquially referred to as “blockchain”, they actually combine three technologies – blockchains, digital key cryptography and consensus mining – to make the concept of “decentralization at scale” possible.

To understand how this works in practice, imagine that Alice wants to buy an NFT from Bob. She needs to ensure that 1) the NFT is authentic, 2) Bob actually owns it and 3) that he actually sends it. Using the three technologies above:

  1. Blockchains would store the NFT and ensure that it is authentic

  2. Digital key cryptography would verify that Bob owns it

  3. Consensus Miners would ensure that Bob sends the NFT to Alice in exchange for payment

What are Blockchains?

NFTs store their data on a blockchain. At its core, a blockchain is little more than an electronic database – i.e. a collection of information – that is shared across many different computers.

Unlike a traditional database, blockchains organize data into groups known as blocks. These blocks have limited storage capacity, so when they become full they are locked and linked to the previous block with a “hash”. This forms a chain – hence the name, blockchain.

These hashes are extremely important because they make blockchains immutable, that is, data (such as your Ethereum balance or the code for your NFT) can’t be deleted, tampered with or changed once it is locked into the chain.

Hashes are created through a cryptographic process (known as hashing) that takes a given set of information and converts it into a unique code (which is basically a long string of characters). For example, the word “fox” could be hashed as DFTY786DCFJ894SUSH865AAHJAI978 and the sentence “the quick brown fox jumps over the lazy dog” could be hashed as SOIAUYA7865ASLUAN098A5489USYAN. There are three important things to note about hashes:

  • Virtually anything can be hashed (i.e. you can hash a word, a sentence or the entirety of War and Peace)

  • Hashes are always unique (i.e. if you changed a single letter in War and Peace you would get a completely different hash)

  • It’s impossible to guess the original data from looking at the hash (i.e. you wouldn’t know that DFTY786DCFJ894SUSH865AAHJAI9785 was “fox”)

Because all new blocks are required to store the hash of the previous block, it’s easy to see if the blockchain has been tampered with. If the hash contained in the new block matches the old, you know that the data is secure. If they are different, everyone will know that the block has been tampered with.

What is Digital Key Cryptography?

Digital keys are nothing more than long strings of numbers (256 bits long for Bitcoin) and come in pairs – a public key and a private key.

  • Public Key: A public key is similar to a bank account number as it serves as your address on a cryptocurrency network. For example, instead of recording that “Alice owns 2 Cryptokitties, the Bitcoin blockchain would record that “ 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 owns 2 Cryptokitties”

  • Private Key: A private key is similar to a secret PIN code that allows users to access and control their account.

Every public key has only one private key, and – like a key and a lock – they are linked through cryptography. The important thing to note about this link is that it only flows one way. Although one can always access a public key with a private key, it’s mathematically impossible to do the reverse.

It’s Impossible to Decipher a Private Key from a Public Key

This one-way logic forms the basis of cryptocurrency transactions. For example:

  • To Receive an NFT: In order to receive an NFT, a user would share his public key with the sender, who would deposit the NFT in that address. Because it’s impossible to decrypt a private key from the public key, this is completely safe (and necessary).

  • To Send an NFT: In order to send an NFT, a user would user her private key to “unlock” her public key on the blockchain to authorize the transfer of the asset. Again, because it’s mathematically impossible for anyone but the holder of the private key to do this, the blockchain can be sure that this person owns the NFT.

In practice, users rarely see either their keys, as they are often stored inside digital wallets and managed by software (i.e. you just click buttons that say “send” and “sign” on a wallet such as Metamask and the application does the rest for you).

What is Consensus Mining?

Centralized networks, such as banks, have a small army of bookkeepers, accountants and auditors to process transactions.

While decentralized networks can’t rely on an in-house staff, they can leverage a distributed group of users known as “miners” for a similar purpose.

Miners are the defacto auditors of decentralized platforms. They are responsible for processing the output of transactions, confirming asset ownership, ensuring there is no fraud and updating the blockchain with the new results. Unlike auditors at a traditional bank, almost anyone can be a miner – there’s no hiring process, no location requirements and miners don’t even have to disclose their identity (in fact, most miners are completely anonymous).

As such, most decentralized platforms have thousands of miners located all over the world that can validate transactions.

While this seems like an elegant solution to the problem of centralization, it raises a few concerns. In particular: how can we trust the miners? How do we know that they won’t abuse their power and send a bunch of money to themselves or their friends?

The answer is surprisingly simple – we use economic incentives to reward good behavior and punish bad behavior.

While there are several incentive schemes, the most popular– used by both Bitcoin and Ethereum – is known as “Proof of Work”.

Overview of Proof of Work Mining

Proof of Work requires miners to solve an extremely difficult math problem to earn the right to validate new blocks. This problem is so difficult that it can only be solved by random guessing. As such, miners often employ dozens to hundreds to thousands of computers to make millions of guesses, hoping that one of them gets the correct answer.

This uses a lot of electricity, and therefore effectively costs miners a lot of money to “bid” on the right to validate transactions (it’s not uncommon for a miner to spend tens to hundreds of thousands on electricity costs before successfully mining a block).

Once a miner solves the puzzle, she will then update the blockchain with the new transactions and send it to the other miners on the network for approval.

  • If she did everything correctly, the network will accept the new block and she will receive a reward (the current rewards are ~$4K for mining an Ethereum block and ~$180K for mining a Bitcoin block).

  • If, however, she tries to cheat the system, it would be painfully obvious to everyone – the aforementioned hash would be broken and the new block wouldn’t connect to the old one. As such, the network will reject the new block, causing the miner to not only lose out on the rewards, but also waste money on electricity costs.

So, at the end of the day, the network is secured by economic incentives and game theory – a miner who acts appropriately could receive hundreds of thousands of dollars in rewards, while one who attempts to cheat the system will almost certainly be left with nothing but a huge electricity bill.

Last updated