A Simple Explanation of Smart Contracts

Francis Song
3 min readJun 5, 2021

We live in a dynamic world. Technology continues to rapidly change society and digitize our interactions. A digital revolution is occurring, and behind every digital revolution there are fundamental building blocks that flourish its expansion. These underlying frameworks allow for the development of new structures, inventions, and ideas, and in the case of decentralized applications and cryptocurrencies, these building blocks are what we call smart contracts.

The term “smart contracts” was first coined by Nick Szabo in the early 1990s and formally defined as, “a set of promises, specified in digital form, including protocols within which the parties perform on these promises”. Since then, smart contracts have surged in popularity with the development of blockchain technology. They serve as the application logic for decentralized applications, allowing for secure, permissionless, and verifiable transactions and agreements. For a more specific definition, using the decentralized exchange Uniswap as an example, smart contracts are the backend code that allow you to perform functions such as swapping tokens and adding liquidity on the protocol.

Smart contracts are deployed onto a blockchain and are then immutable and permanent. Just like your wallet account, each smart contract has its own unique address that can hold token balances and manage transactions. Similarly, any deployed smart contract is visible through a block explorer like Etherscan. You can look at the Uniswap Factory contract here: https://etherscan.io/address/0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f

Currently, the most popular programming language to develop smart contracts is Solidity, along with other languages such as Vyper and Haskell. The image below is a simple smart contract function written in Solidity, that allows for the transfer of a token:

Code of a transfer function

As depicted in the code, the smart contract takes in data such as the recipient’s address and the amount, and then performs the transaction, decreasing the balance of the sender and increasing the balance of the recipient. If you want to send some cryptocurrency to a friend, you can call this function with a user interface like Metamask’s and the smart contract will automatically receive your input data and emit the Transfer event. A simple and easy process, all through the power of a smart contract.

As time progresses and smart contracts continue to develop, the definition has begun to expand and take on more use cases. Since its initial proof-of-concept to now responsible for billions of dollars in transactions a day, smart contracts continue to pioneer a revolutionary movement. And as many would agree, we are only at the beginning.

To conclude in the same manner as the historic writing of smart contracts by Nick Szabo in 1996, “the idea of smart contracts is to recognize that these efforts are striving after common objectives, which converge on the concept of smart contracts”.

--

--