Are you ready for Smart Contracts?

Smart Contracts are just trying to make the world of simple contracts as fair as possible

Rick McFarland
6 min readSep 17, 2021

Before I tell you why Smart Contracts are rapidly changing the world of contracts, let me first show you why they are special.

What if I asked you to facilitate a $1 bet between two people, Rick and Nick, where they bet on the number of 6’s that result from rolling a die 10 times.

How would you go about setting up a fair bet for this situation?

First, you would have Rick state the number of 6’s he thinks will come up and have Nick do the same. Rick says 2 while Nick says 3.

Now, how would you make this situation more fair in case they change their minds after few rolls? Let’s document the bet by writing down their bets and describing the resulting payments. Let’s call this the contract.

Example Contract
If the # of 6 resulting from 10 roles of die is 2 then Nick pays Rick $1
If the # of 6 resulting from 10 roles of die is 3 then Rick pays Nick $1

So, now who will roll the die? If it is Nick, Rick will worry about him using too much wrist-action and cheating. Likewise, if Rick rolls, Nick will worry about Rick cheating. What is the solution?

Find a mutually agreed upon 3rd party to roll the die. Let’s call this person an oracle.

The oracle rolls the die 10 times and the contract is executed when the individual who loses pays $1 to the individual who won.

All that sounds great when the bet is small, like $1. What happens if we change this bet to be $1,000,000 and based on 1 million die rolls? So, now with higher stakes and more processing, we need to formalize some of the procedures.

First, we collect $1mm from each player and put it in Escrow because that’s a lot of money and neither bettor wants to risk the loser welching out on the bet.

Second, it will take a long time to roll the die 1 million times. What if we distribute the effort? Suppose the bettors select 1,000 oracles and ask them each to roll a die 1,000 times each and report back their findings.

Third, the management and execution of this contract is complex and neither bettor trusts the other to manage the contract fairly. So, they agree to hire an independent third-party party, Mr. Block, to be responsible for collecting all the results from the oracles and to execute the contract once the results are tallied. He will then transfer all the money in escrow to the winning party.

Hold on, Rick is worried that Mr. Block will like Nick more than him since he is a famous TV celebrity. How do we keep Mr. Block from potentially biasing the bet? We can anonymize the contract by hashing the bettor information that is provide to Mr. Block so that the contract might look something like this:

Anonymized Contract
If the # of 6's resulting from 1,000,000 roles of die is 200,000 then transfer escrow WW23WJWE to bettor ADFD98DUA
If the # of 6's resulting from 1,000,000 roles of die is 300,000 then then transfer escrow WW23WJWE to bettor FSDD99SDH

Sounds like we are all set. Hold on, Nick has his concerns about Mr. Block since he is a pretty important linchpin in the entire betting process. What happens if something happens to him? Plus, the bettors received an estimate from Mr. Block for facilitating the bet and it is nearly $500k! This substantially eats into the winner’s profits.

Is there a cheaper and more reliable option? Yes, through programming and automation we can drastically reduce costs and remove the dependence on Mr. Block in the whole process.

First, we automate Mr. Block by converting the work that he does into a computer program (e.g., collect the die roll results from the oracles, tally the scores, determine the winner based on the contract, release the money in escrow to the winner). The anonymized contract example above is purposely written in a format that resembles a simple if-then computer program. This program is stored on a computer and, since the private information in the contract is hashed, even if the program is hacked, the identity of the bettors and the contract are well-protected.

Wait, what if the hacker gets mad and decides to take the computer down?!? Since everything is anonymized, instead of running on a single computer we can put the program on a large, public network of interconnected computers (nodes) with the same program running asynchronously on all the nodes of the network. Let’s call this network of computers a Blockchain. Once on the blockchain, it is sure to be executed since it exists and runs on all the nodes of the network so if, say one of the nodes goes down, the remaining nodes will ensure the contract is monitored and executed.

To further automate this process, rather than having the blockchain collect die roll information from 1,000 oracles, we can covert the oracles’ die rolls into a computer program and put them on network that aggregates them all and feeds the results to the blockchain. Let’s call this network an oracle network. To further ensure the contract is run in a timely fashion, we can boost that network to tens-of-thousands of oracles and let the network collect the first and fastest responders to a contract request until the goal of 1,000,000 rolls is achieved.

And voilà, we have now derived what is referred to as a Smart Contract.

Below is a diagram of the Smart Contract process we created:

Created by author.

And here is a summary of some of the benefits of Smart Contracts:

  • They are robust. The blockchain networks that host the smart contracts are impervious to hacks or failures. Every node has the same copy of the blockchain that every other node has. So, in order to execute a hack or cause a failure, more than half of the the entire network would have to be affected. A good example of the resistance of distributed networks is that the Bitcoin network has not been hacked once in its entire 12 years of existence.
  • They are secure. By hashing the parties and the contract information, smart contracts can be stored on a public blockchain network so that anyone accessing the contract will be unable to know who or what the contract is about.
  • They are fast-executing. The automated nature of smart contracts enable them to perform monitoring and execution in real-time.
  • They are resistant to corruption. Single, human sources of contract and data management are susceptible biases from inside- or outside- factors. While a bribe may influence a source in a traditional contract situation, these are avoided through the consensus protocols employed by blockchains. Thus, any single biased node is removed by the consensus mechanisms that decide the legitimacy of the contributions made by a majority of the nodes in the network.
  • They are efficient. By converting contract management to source code and storing it on a blockchain, smart contracts remove expensive management and mediator fees can take a cut of the final payout of traditional contracts.

For these reasons, Smart Contracts are rapidly becoming a popular way for financial institutions to manage financial contracts. For example, they are used in crypto-currency exchange trades, since these currencies are constantly being traded in hundreds of exchanges around the world making it difficult to identify a stable value without leveraging a consensus-based approach. Indeed, major financial institutions like JP Morgan and BlackRock are starting to invest in blockchain and crypto assets which ultimately means that they will be dealing with Smart Contracts that are needed to trade these assets. Given that, it may not be long before Smart Contracts are leveraged in main-stream trading since the conditional contract format of trade contracts lend themselves well to being converted into source code (e.g., execute if certain price or volume conditions are met).

Stay tuned for my next articles on Smart Contracts where I will dig deeper into the oracle networks and the evolution of Smart Contracts in the Legal profession.

--

--

Rick McFarland

Rick McFarland is the Chief Analytics Officer for Chubb and is converting data into intelligence with the goal of reinventing the business of insurance..