Apr 30, 2016

Five Features of Smart Contracts on a Blockchain

Five features of smart contracts on a blockchain - peer to peer, cryptographic trust, automated rules, immutable and fungible transactions


 Bitcoin versus other Blockchain Projects

Towards the end of April, as bitcoins crossed the $450 mark, news articles started appearing focusing on Bitcoin’s seeming resilience despite all the negativity and the price of bitcoin having doubled from last year
 .
Despite so many initiatives coming up that claim to eventually sideline or displace Bitcoin altogether, that gloomy prognosis is still at least five years away. 

What could be the reason? For one, Bitcoin is a use case which was implemented using existing technology. Only two things can take down Bitcoin. One, a better Bitcoin application or two, a 51% attack. 

On the other hand, many blockchain projects are trying to create innovative technical designs while simultaneously looking for use cases that apply. This cart before horse approach is no doubt, where the future lies for enterprise solutions. However, it is both time consuming and expensive. 

In this article, we take a step back toward the underlying premise of Bitcoin and Ethereum applications, which is smart contracts, an idea which has its roots from some of earliest proponents of digital cash and Bit Gold such as Nick Szabo.

Cryptocurrency followers are familiar with the notion of smart contracts as explained through Nick Sbazo’s website, Satoshi Nakamoto’s white paper, articles on the Bitcoin wiki, as well as through Ethereum architecture. 

Long story short, a good blockchain use case should implement smart contracts. Otherwise you are better off with a highly redundant database locked away in a vault. 

What is a smart contract? These are the five features that one can consider as characteristics of a smart contract.

Note: In order to describe the concept, this article has taken several liberties with the definitions. Many terms are not strictly true to the dictionary definitions, but used in a more generic context without losing the meaning. 

1. Smart Contracts enable Peer to Peer Agreements

Contracts are made between two or more parties, who are both beneficiaries of the agreement. When two parties, or peers in this case, who are otherwise unknown to one another, enter into a contract, a third party enforces trust, dispute remediation or even intermediary services. 

For example, Uber, AirBnB or other sharing economy applications allow people to use services in a peer to peer model opening a vast supply of resources than conventional taxi or hotel industry can provide. Uber or AirBnB act as the trusted third party and also provide the platform to connect suppliers and consumers. A contract between two parties is made using the platform and payments are made to the service provider who charge the supplier. Thus Uber can drive pricing and control who can use the system.

In Satoshi Nakamoto’s introduction to Bitcoin on the P2P forum, the creator of Bitcoin has pointed out the disadvantage of a third party aka central authority. Centralized systems can shut down or be shut down leaving consumers and suppliers high and dry, many times causing them some loss as well. 

If Uber fails, consumers have to look for another platform provider. 

A smart contract uses the blockchain to allow two parties to make a contract automatically. Instead of using a third party to determine the pricing and participants for all, two parties can directly set-up and execute a contract with mutually agreed rules. 

For example, Alice and Bob who are unknown to one another can enter into a transaction for a precious asset say a diamond. Alice who owns the diamond can sell the diamond to a highest bidder, Bob in this case. Alice receives payment only when she delivers the diamond to Bob. If Bob does not receive the diamond after a specified interval of time, he receives an automatic refund. 

2. Smart Contracts Secure Rightful Ownership through Cryptography Technology Protocols

A smart contract allows two parties to define and enter into a custom contract. But a trusted third party provides one more function. It establishes who the rightful parties are and this knowledge is limited to the parties of the contract and the third party. 

In a smart contract, rightful ownership is established through security protocols such as cryptographic keys. Bitcoin and other blockchain applications use public private key cryptography to assign digital signatories to a contract. The public portion of the key establishes an identity and the private key is the signing authority. Public keys designate who the parties are and signing using a private key executes or enforces a contract. 

Trust is not limited to the ownership but also extends to the asset or contract object(ive). A smart contract can use cryptography protocols to establish unique and immutable digital identities to assets. 

For example, when Bob buys a diamond from Alice, he sends her digital money by signing the transaction with his private key. Alice has designated the diamond as an asset and she releases the asset by signing it with her private key. The money can now be transferred using Alice’s private key. In turn, the diamond’s ownership is assigned to Bob and only he can unlock it for future transactions such as a sale, a gift or heirloom. 

Three: Smart Contracts Enforce Contract Rules Automatically

A smart contract should include contract rules that can execute automatically. Most contracts involve an exchange (event) between two (or parties) subject to conditions which must be fulfilled (e.g. sufficient balance). These rules should be encoded within the contract. The objective being, of course, fulfilling the role of trust and enforcing rules more consistently, objectively and using escrow than escalation mechanisms. 

In the Alice and Bob example, there are four rules. The price at which Bob and Alice agree for the diamond. Alice should receive the money. Bob should receive the diamond. The transaction should be completed within a stipulated time. A smart contract application would enforce all these rules which would execute at a stipulated time and/or when an event such as payment receipt is triggered. 

Four: Smart Contract Transactions are Immutable

A smart contract once executed cannot be reversed through system rules, hacked or tampered with or violate agreed fulfillment rules. 

Smart contracts are immutable, in the sense that while some rules are changeable, the effects of a contract rule once executed, cannot be reversed or modified, without substantial (and meaningless) collateral damage. The blockchain makes transactions immutable to eliminate the “double spending” problem, another human problem that requires trusted third party. 

Alice can sell her diamond to Bob and then again to Carol, except that the blockchain (or a Merkle tree of transactions) will track her asset history and prevent her or another willing buyer to enter into another transaction unknown to Bob. If (and since) the blockchain is a distributed transaction ledger sitting on many different nodes or a peer to peer network,  timestamped (in real time or near real time), Alice’s transaction is buried under many other transactions and blocks. 


Five: Smart Contracts Enable Fungible Transactions

I think that the most important benefit of smart contracts is the technology allows for an immense scale of transactions from the infinitesimal to large scale. Transaction costs, market driven value and supply and demand, have always excluded micro-transactions or made customization very expensive. 

Like the sharing economy, smart contracts enable peer to peer transactions of smallest value possible. Bitcoins are fungible to 8 decimal places and can be used to make micro-payments and purchase of multi-million dollar luxury villas at the same transaction fee and speed. Smart contracts make allow pricing unit items such as blog article or Internet tipping, where a unit or contract token can break down into a million parts or more. 

Using a smart contract Alice can sell Bob a diamond, a used guitar or even rent a single room in her house, an idea that Slock.it, a smart contracts startup is pioneering on Ethereum.   

Summary

Smart contracts are the single most important use case that blockchain technology enables. Describing blockchains as a globally distributed database is looking at just one aspect. Applying smart contract features is one way to validate use cases for decentralized applications on a blockchain.

No comments:

Post a Comment