Smart Contracts Basics

Cardano Explained

Smart Contracts Basics

Jul 7, 2021, by Eric Hill

The Alonzo hard fork is bringing smart contract capability to the Cardano ecosystem. We are all familiar with the term "smart contracts", but what are they? What is the potential they offer?

The next significant IOHK project to be launched is the Alonzo hard fork which will bring full smart contract capability to the Cardano ecosystem through the integration of Plutus scripts on the blockchain.  Alonzo is named after mathematician and theoretical computer scientist Alonzo Church.  Many Cardano community members are participating in the Plutus Pioneers set of courses to learn the core principles of coding in Plutus. Plutus is a “purpose built smart contract development language” that uses the functional programming language Haskell.  Alonzo’s testnet rollout plan has 5 stages: Blue, White, Purple, Red, and Black. The Blue phase is currently underway. 

   Smart contract capability will be a huge step forward for Cardano, so at this point in time I thought it would be useful to explain the basics of smart contracts: 
   
  We are all accustomed to the term “smart contracts”, but what are they? What is the incredible potential they offer?  Nick Szabo, a computer scientist, law scholar and cryptographer proposed the idea of smart contracts in 1997.  In a world that relies upon intermediaries, lawyers, middlemen, brokers, agents, and third parties, smart contracts embody the the most powerful democratizing elements of crypto currencies and blockchain technology.  Blockchain offers secure digital identity, secure storage of personal credentials and documents, and secure verifiable personal financial authenticity. We will all benefit from the capability of smart contracts running on the blockchain, but for at least 3 billion of earth’s residents who do not enjoy the commonly assumed privileges of personal documentation and legal authentication, the opportunities are literally life changing.
    
  Decentralization, immutability,  security, and the trust inherent in a distributed ledger are the foundation that smart contracts are built upon. For the “unbanked” and “undocumented” citizens of the world, these sureties will empower them and enable them to lead better lives. It is Cardano’s mission to make that life changing technology available.  For the residents of nations that have access to the normal advantages of modern society, smart contracts will be equally as liberating, but also highly disruptive to many industries, governmental organizations, and civilian data infrastructures.

   So what are smart contracts? Simply put, smart contracts are executed as pieces of code running on a blockchain.  A smart contract stores data, verifies rules, and self executes.  Smart contracts require no intermediaries or middlemen, deriving absolute trust from the shared distributed ledger.  They offer speed, accuracy, and the immutability of the blockchain. Smart contracts can be said to “codify business logic.” There is literally nothing that will not be changed by the combination of smart contracts and the  blockchain.  Smart contracts enable the development of apps that offer peer-to-peer functionality. Defi is the first and most obvious sector that is being enabled by smart contracts.  

   A simple description of smart contracts is the example of a Vending Machine.  A vending machine functions on rules which must be fulfilled and verified before it will dispense its offerings.  You put the required amount of money into the machine, it verifies that the rules have been fulfilled, and then it self executes the “contract” by dispensing a snack or a drink or whatever it holds for sale.  You don’t need a lawyer, or a broker, or an agent to verify the transaction and execute the interchange.   No one gets a commission on the deal between you and the vending machine.  And once the transaction is complete, it cannot be reversed, you can’t simply put the item back onto the machine and get a refund.  Furthermore, no one can alter the transaction by dispensing the incorrect item or requiring that more than the stated amount be paid. 

   The real world circumstances to which smart contracts can be applied  are everywhere in our lives.  Real estate, health care, law, energy production and consumption, government agencies, medical records, all aspects of personal and business finance, agriculture, commodities, construction, manufacturing, supply chain systems, product provenance, data gathering and processing…there is no end to the list. Everything from national census data and urban farming to all forms of personal identity and documentation will be revolutionized by the combination of the blockchain and smart contracts.  

  Smart contracts are written in a range of programming languages.  Their code is open and verifiable, any interested party can inspect the contract’s code and verify the logic it follows. They can be deployed by anyone. Once deployed and running on a blockchain they cannot be tampered with or altered. However, we are not all adept at coding and programming, so for those of us in the Cardano community, the good news is that Marlowe, a DSL,  (Domain Specific Language) has been created and the Marlowe Suite will be available in the near future. But I’ll leave that for the next post…
  


written by: Eric Hill     published at: Jul 7, 2021
Further articles you might be interested in

Marlowe In Brief

Jul 30, 2021 by Eric Hill

Marlowe is a Domain Specific coding language, but just as importantly it is a Suite of products aimed at three distinct sets of users.


The Great Expansion in the Darién Region

Jul 11, 2021 by Chris

In the past few months TGF has had an incredible boost. Thanks to the unwavering support and the many new members, TGF has been able to think in completely different dimensions in the past months than before.


Atala PRISM Mini-Tutorial

Jun 23, 2021 by Eric Hill

A quick mini-tutorial guide to help you get started establishing your own DID on the Atala PRISM App.


Atala Prism

Jun 6, 2021 by Eric Hill

For those of us who are passionate about blockchain technology and the Cardano network in particular, becoming informed about Atala Prism is essential. The IOHK website enables anyone to examine Atala Prism and explore the astonishing benefits it offers to literally everyone in the world.