Automatic execution: The power of Smart Contracts

blog image

Play with Crypto!

Buying something using cash facilitates the execution of a contract between buyer and seller. Such a transaction is typically instant, so the execution of the contract is not necessarily recognized.

But even unseen, all financial transactions between multiple parties are governed by these contracts. Where cryptocurrency is concerned, transactions are governed by what are known as 'Smart Contracts'.

What is a smart contract and how does it work? You will learn the answer to that question, and more, from this post. Needless to say that cryptocurrency would not be what it is without the function smart contracts provide. Furthermore, the power inherent to the smart contract is that which makes blockchain technology applicable to much more than just monetary systems.

A contract between computers

Let us begin with an understanding that the smart contract is similar to a legal contract in some ways. We can illustrate it with a legal contract governing the sale of a piece of property. That contract stipulates the responsibilities and rights of both parties. You, as the buyer, have certain responsibilities that include furnishing payment before title of the property is transferred. The contract might also stipulate you have the right to inspect the property before making payment.

The other side of that contract are the seller's rights and responsibilities. The seller has the right to receive payment in exchange for title to the property. He or she also has the responsibility of transferring the property to you once payment has been made.

A smart contract is something similar. It is a contract between two sets of computerized instructions governing some sort of exchange. You may have a computer at the front of a department store connected to a computer in the warehouse. The instructions programmed into both computers govern inventory control. What would this look like?

Let's say the cash register computer records the sale of a pair of shoes. Once that computer submits the transaction information to the warehouse computer, the warehouse computer then releases that pair of shoes from the store's inventory. The computer at the front of the store would show those shoes as being sold while the inventory computer would have one less pair of shoes to keep track of.

Automatic execution

The difference between this computer contract and a legal contract between buyer and seller is that the former is executed automatically while the latter is executed manually. That really is the power of smart contracts. They are executed automatically without any input from human beings.

Going back to our example of the legal contract between buyer and seller, execution does not begin until you make payment for the property. In fact, you may not make payment until you inspect the property. Making payment then requires the seller to actively engage in the process of transferring the title to you. Both of you must do something to physically execute your own responsibilities under the contract.

The contract between front end computer and warehouse computer in our smart contract scenario doesn't require any human intervention to execute. Once the pair of shoes passes through the scanner, the computers take care of the rest. They each execute their ends of the contract to complete the transaction.

And by the way, there are other computers and contracts involved here as well. There are computers and contracts governing the transfer of money, the accounting of the sale, and so forth.

Smart contracts in cryptocurrency

With that basic understanding of how smart contracts work, let us talk about how and why they are the driving force behind cryptocurrency. Remember these four fundamentals governing cryptocurrency payments:

  1. No physical currency changes hands.
  2. Coin is pushed from buyer to seller.
  3. A transaction is not complete until all computer nodes finalize it.
  4. Once complete, a crypto transaction cannot be reversed.

Executing a cryptocurrency payment requires multiple smart contracts along a chain of transactions that take place across multiple computers. We can describe this by discussing what it takes to play slots online with bitcoin.

The transaction from A to Z

To illustrate this transaction we will assume the online casino accepts cryptocurrency payments directly, which is to say they do not use a payment processor. You making a deposit would involve sending bitcoins to the casino operator by transferring them from your wallet to theirs.

The first smart contract is executed when you make that push. Your wallet sends transaction information to the recipient's wallet along with both public and private keys. The first contract is executed. That execution causes both your wallet and the recipient's wallet to send information about the transaction over the Bitcoin network. The second contract has been executed.

Each node on the Bitcoin network receives the information which automatically triggers a contract that tells those nodes to process the transaction. Each node then goes about decrypting the transaction, verifying it, and then adding it to its copy of the distributed ledger. When that task is completed, it triggers the execution of another contract that finalizes the transaction and makes it irreversible.

There are no bankers involved. There are no payment processors or bank tellers. There is no exchange of physical cash. All of this happens automatically and within minutes. Each computer in the network does what it is supposed to do when its contract is initiated. Fulfillment of each contract triggers the next one, and on down the line until the transaction is finalized.

Smart Contracts and Crypto Exchanges

We see the execution of smart contracts much more visibly on a cryptocurrency exchange. Remember that when you buy on an exchange, you can buy using either market orders or limit orders. A market order means you are buying coins at their current price regardless of who is selling them. A limit order allows you to buy coins only when the price reaches your target.

In either case, you place your order at the time you want to purchase. Your order includes the kinds of coins you want and the amount of money you want to spend. The exchange's computer handles the actual transaction on your behalf. You place the order; the computer finds the seller and completes the exchange. It is all done through smart contracts.

The same thing applies if you are selling. You post your coins by agreeing to either sell them through a market or limit order. Then you leave it to the exchange. When a buyer comes along, a market order is immediately filled. Limit orders are filled when the coin reaches your target price.

Smart Contracts beyond crypto

All of this might seem a bit overwhelming to you. If so, you are not alone. The concept of smart contracts can be difficult to understand if you are neither an IT professional nor a trained attorney. Just know that the power of smart contracts goes way beyond buying and selling online. It goes way beyond depositing bitcoins to play e.g. the great Wild Gladiator slot.

Here are just a few examples of smart contracts outside of the crypto arena:

1. Logistics

The world's biggest logistics providers rely on smart contracts to keep track of inventory. For example, you must be familiar with tracking an item you purchased online. Tracking is only possible thanks to smart contracts that follow your package from the moment you make your purchase to the moment it arrives at your door.

2. Escrow payments

In many parts of the world, taxes and insurance on residential properties are paid through monthly mortgage payments. A certain portion of your monthly payment might be put in an escrow account so that the money is there when insurance and taxes are due. Your escrow account is handled via smart contracts. There is no human being withdrawing money from your mortgage payment and depositing it into your escrow account. Everything is done automatically by computer.

3. Automatic bill pay

Maybe you use an automatic bill paying system linked to your bank account. You've gone into your account and scheduled certain bills to be paid on the same day each month. Once again, there is no human being withdrawing that money from your account and sending it to your creditors. Smart contracts do everything automatically.

4. Video games

Perhaps the most amazing use of smart contracts that very few people know about is found in the typical video game. Take your average RPG title. What you do as a character determines your progress in the game and there are virtually unlimited possibilities. Yet every action you take requires the game to somehow respond. It responds by executing smart contracts.

It is the smart contract that determines how different characters in the game relate to the story. If you buy or sell in the game, the execution of that code within the game software relies on smart contracts.

We could go on all day about smart contracts. We won't. The point here is that smart contracts are really the power behind cryptocurrency and its underlying philosophy of decentralization. But smart contracts touch many more areas than most people know. They are all around us, working within the computer systems that govern nearly every aspect of modern life.

Next Post: Casino Gambling and Sports Betting from India : New for 2019