Smart Contracts: Definition, How They Work & What They’re Used For (2023)

Athena Alpha

Imagine a world where agreed terms and conditions are executed seamlessly, without intermediaries and with iron clad security and finality. A world where businesses can effortlessly automate complex financial tasks and agreements, reducing costs and boosting efficiency. That’s the world smart contracts can build.

What Is A Smart Contract?

Smart contracts are code that’s stored on the blockchain and that automatically execute predefined actions without having to involve any external intermediaries. Once deployed on the blockchain, they are set and cannot be changed.

For example, the contract might automatically send some funds to another address once goods have been received and verified by the buyer.

These self-executing programs are designed to perform specific tasks when predetermined conditions are met, such as transferring funds, and once they’ve completed are irreversible just like other transactions on the Bitcoin network.

The creator of the contract defines the rules together with the various parties involved and then saves it onto the blockchain. Once there it remains forever as everything on the blockchain is immutable and cannot be altered.

It should be noted that difference cryptocurrencies each have their own blockchains and also their own smart contract scripting language. For example Bitcoin’s scripting language is simply referred to as Bitcoin Script and is made up of a set of 186 opcodes, where as on the Ethereum network, Ethereum smart contracts are written in its Solidity computer program language.

How Smart Contracts Work

Bitcoin-Control-OPCODES
An example of some of the “control” opcodes in Bitcoin Core

Smart contracts operate on an “if-then” logic and not legal language or terms of contract like traditional contracts do. They automatically run specific code when predetermined conditions are met and the details and transactions are all recorded forever on the blockchain.

A smart contract can retrieve data as well as handle transactions and carry out specified conditions after a set time delay. This gives the programmer considerable flexibility to create new and useful things that interact with the Bitcoin digital currency.

In order to create a smart contract you must write it using the specific smart contract’s code that defines the conditions and tasks. Then the user must deploy it on a blockchain platform and verifying its validity.

No-code smart contract platforms have also emerged, allowing users without coding expertise to craft smart contracts using user-friendly interfaces and templates just like WordPress and other content management systems have made creating websites easier.

By ensuring that all relevant parties are held accountable once an agreement is executed, and by maintaining clear and unalterable transactions, smart contracts remove the need to trust third parties and speed services up.

It’s also possible to have completely anonymous parties form contracts and agreements without the need for a central authority or external enforcement mechanisms.

From digital identity to real estate, insurance and voting systems, smart contracts are offering some extremely interesting ways to automate a number of different industries. These processes previously would take people or companies a lot of time and manual labor and are now being streamlined as a result.

Blockchain Technology

Just as a quick refresher, a Blockchain is a distributed database, also referred to as a distributed ledger, that’s shared between many nodes on a network. They are most commonly used in cryptocurrency networks, but they have been used for other things too. The data that’s stored in a blockchain is immutable, meaning that it can never be changed.

Let’s break down some of those key terms to further clarify that paragraph:

  • Blockchain: A type of database or file, similar to an Excel spreadsheet
  • Distributed: This means there is more than one copy stored throughout the world
  • Node: Any computer or server that runs the software and is part of the blockchain network
  • Immutable: This means that the data can never be altered or deleted

In order to keep track of who owns what tokens or coins, cryptocurrencies use blockchain technology. This big database or file is constantly updated to show who owns what. For example it might say “Bill owns 1 bitcoin”.

Smart contract code is stored entirely on this underlying blockchain technology and is self executing. This means that once it’s been deployed, you don’t have to keep your computer on or wallet open for them to run.

New to Athena Alpha? Start today!

Bitcoin’s Taproot Upgrade

The recent Bitcoin Taproot upgrade was a soft-fork upgrade with miners signalling their support for it with a 90% consensus. It improved the Bitcoin network in a number of ways by simultaneously activating three separate Bitcoin Improvement Proposals (BIPs).

This upgrade significantly enhanced Bitcoins smart contract capabilities due to the speed and efficiency improvements realized from the Schnorr signatures upgrade (BIP-0340). While smart contracts have always been a part of Bitcoin, Taproot has now allowed them to scale much better than before due to Schnorr signatures being able to aggregate multiple signatures into one.

Bitcoin Smart Contract Uses

Every transaction on the Bitcoin network actually has its own script that must be satisfied in order for the funds to be spent. For most single signature transactions this Bitcoin script is nothing, but many transactions do have more complex opcodes that they use, making them technically a smart contract. Some of the most notable ones include:

  • Lightning Network Channels: Bitcoin smart contracts allow for the Lightning Network to automatically create, manage and close lightning channels allowing for layer 2 scaling solutions and virtually free micro-payments
  • Multisig Wallets: These wallets require multiple parties to sign off on a transaction in order to spend the funds and as such, require very basic logic function (a script) to work. These very simple smart contracts provide an extra layer of security for those who want to protect serious investments
  • Decentralized Finance (DeFi): Bitcoin smart contracts can be used to create decentralized lending platforms, prediction markets, and other financial services that are all automated and run via the blockchain

Other use cases for smart contracts also include:

  • Supply Chain Management: They can be used to track the movement of goods, verify authenticity, and enforce agreements between parties in a supply chain
  • Real Estate Transactions: Bitcoin smart contracts can simplify the process of buying and selling real estate property by automating many of the different aspects of the transaction such as funds and title transfers

Pros & Cons Of Smart Contracts

While smart contract’s are automatically executed and thus save a lot of time, they also have other benefits that traditional contracts don’t have.

Benefits Of Smart Contracts

  • Elimination Of Intermediaries: Often responsible for delays, additional costs and potential points of failure in legacy contracts, a smart contract removes the need for intermediaries or trusted third parties which is a huge advantage. Not only does this removal reduce costs and increase reliability, it also means the contracts are executed 24/7/365 instead of just during business hours
  • Reduction In Errors: No one is perfect, least of all financial institutions and those working with complex legal contracts. As smart contracts are written in well defined code their ability to reduce errors is huge. By automating the execution of tasks and agreements based on predefined conditions, human errors can be minimized, leading to more accurate and reliable transactions
  • Increased Transparency & Trust: As all details and outcomes are fully transparent and visible on the blockchain, smart contracts greatly increase trust and accountability between all parties by ensuring that everyone stays honest and are held accountable once the agreement is executed

Potential Drawbacks

  • Coding Mistakes: Any mistakes in the contract code can have serious consequences, potentially resulting in the loss of funds or other undesirable outcomes. While they avoid some human errors such as incorrectly filling out forms, they can introduce others as humans are still the ones writing the software code
  • Lack Of Skilled Talent: Due to the newness of Bitcoin, blockchain technology and especially smart contracts, there is a limited supply of people that are qualified and have sufficient experience in writing smart contracts. As a result, those that are available may not have had enough experience and further contribute to incorrectly written code that results in the loss of funds
  • Lack Of Regulatory Framework: The absence of clear regulations for smart contracts due to how new the technology still is could lead to legal ambiguity and potential issues

Origins Of Smart Contracts

Smart contracts was first proposed by American computer scientist Nick Szabo who also invented a virtual currency called “Bit Gold” in 1994. In his groundbreaking paper he described them as “a computerized transaction protocol that executes the terms of a contract.” He also noted that one of their main uses was to minimize the need for trusted third parties.

The general objectives of smart contract design are to satisfy common contractual conditions (such as payment terms, liens, confidentiality, and even enforcement), minimize exceptions both malicious and accidental, and minimize the need for trusted intermediaries.

Nick Szabo

While many people believe that Satoshi Nakamoto invented everything to do with virtual currency such as Proof-of-Work and smart contracts, they actually brought together a number of already suggested technologies and then further improved on them with things like the difficulty adjustment mechanism.

The Athena Assessment

The intricacies of smart contracts is a huge rabbit hole to dive down. There are dozens of opcodes just in Bitcoin’s scripting language alone each with their own meaning and use case. You can then combine them all together in a million different ways to create a million different computer programs that are executed automatically and operate totally outside the legacy financial world.

The world of digital money and computerized transaction protocols has only just begun with various programming languages competing for dominance and new ideas being built every day. With the introduction of new code that allows artificial intelligence to also make and receive bitcoin transactions the smart contract world is sure to only grow from here.

Whether it’s improvements to brand new fund transfer tools, new self custody programmability like our proposed Time Locked Multisig wallets or just reducing simple human error, blockchain based smart contract code will likely change the way many industries operate in the future. All with Bitcoin at their core.

Frequently Asked Questions

What Is An Example Of A Smart Contract?

A smart contract is code that’s stored on the blockchain that executes automatically based on predetermined if-then logic. Examples of real world applications that use smart contracts include decentralized cryptocurrency exchanges as well as other simpler things like vending machines.

Is Smart Contract A Blockchain?

No. Smart contracts are programs (code) that are stored on a blockchain. This blockchain is also what runs them when certain predetermined conditions are met. Smart contracts automate the execution of an agreement between two or more parties without any having to rely on any trusted third parties or intermediary’s.

How Do Smart Contracts Function?

Smart contracts function by running predefined code automatically and run on the blockchain. When predetermined conditions are met, they securely record this information on the blockchain ledger and run whatever code is in them.

What Industries Can Benefit From Smart Contracts?

Smart contracts can revolutionize any industry that uses money and existing contracts, which is basically all industries. Currently they are mostly confined to the cryptocurrency world, but there are many people working on integrating them into everything from real estate to automating an insurance payment.

Want to get serious about safely and privately using Bitcoin? You need to subscribe now.

Benefits Include:
Read by the top experts, writers, investors and companies in Bitcoin
Learn more about Bitcoin than 99% of people in just one hour a month
Secure your Bitcoin investments and ensure they stay safe from hackers
Know what risks your investments are exposed to and how to fix them
Keep pace with Bitcoins rapid growth and what opportunities it enables
Get insights into how Bitcoin can help your business or work save thousands
Step-by-step guides for all aspects of Bitcoin (wallets, buying and more)
How to do all of these things and maintain your privacy!
NO MORE LOST FUNDS!