0%

What are smart contracts?

Feb 4, 2023 8 min read
News Article Banner Image

In 1996, Szabo laid out his vision for a digital marketplace that could function in a trustless manner, one that was able to incorporate advanced contract law with digital commerce. This is where we get the ethos of trustlessness and freedom from intermediaries that is a hallmark of Web3 technology today.

And this proposal set the framework for Vitalik Buterin’s Ethereum whitepaper, which outlines a smart contract system that is an improvement upon the Bitcoin protocol. What Buterin understood was that the applications of a system that can transfer value without one party needing to trust the other went far beyond that of Bitcoin. This could be in any area that involves contractual agreements, such as within supply chains, payment processing, or real estate transfers of ownership.

A smart contract can be defined as a computer program that can execute a agreement. The record of its actions and existence are recorded on a blockchain, making it permanent, immutable and transparent. This is especially useful for contracts in a trustless system as it means that they cannot be tampered with and are easily traceable. In terms of function, one can consider smart contracts to execute “if/when…then…” code. That is, if ‘x’ parameters are satisfied, then ‘y’ happens. You can see that this is quite rudimentary, but as the space matures and more assets appear on-chain, applications will advance as well.

TL;DR

Smart contracts allow people to enter agreements trustlessly and without intermediaries. They are computer programs that execute contracts based on pre-defined parameters and are stored on the blockchain. Because of their immutable and permanent nature, they are especially useful in executing the transfer of assets.

How do smart contracts work?

In considering how smart contracts work, it’s important to remember that they are essentially programs that execute actions when preconditions are met. Similar to how a notary is used to witness the signing of, verify the identities within, and help facilitate the execution of a physical contract between parties, a smart contract performs a similar function with code. That is, it contains a digital contract and two public keys that represent the user and the smart contract.

The workflow of a smart contract

First, the smart contract is created by a developer and its terms are encoded in computer code. The code is then uploaded onto a blockchain. Next, the smart contract is deployed to the decentralized network, where it becomes publicly accessible and its code is stored on the network’s nodes. Here, a trigger event, such as the receipt of a payment or the fulfillment of a specific action, occurs, activating the smart contract. This is done by an EOA, or externally owned account.

After this, the contract automatically executes its terms, which may involve the transfer of ownership or assets, the release of funds, or other actions as defined in the contract’s code. Of course, if preconditions are not met, then the code will return an error, and the smart contract will not execute. After execution, the decentralized network’s nodes validate the execution of the contract, ensuring that the contract’s terms have been executed as intended. This validation happens throughout the network and is done so with redundancy through use of a consensus mechanism to bring trust and security to the process.

And after all of this, the outcome of the contract’s execution is recorded on the decentralized network and is publicly accessible for anyone to verify, which is the transparent part of all this.

The smart contract has now completed its execution and the terms of the agreement have been automatically fulfilled, reducing the need for intermediaries and increasing the security and transparency of the transaction.

Can one change a smart contract?

One very crucial attribute of a smart contract is its immutability due its storage on a blockchain. Through use of a secure and strong consensus mechanism, a smart contract is permanent and cannot be changed.

This feature gets a little more complex when a contract has a deletion function built into it. As with other parameters that it abides by, if the parameters for deletion are met, a smart contract can “self-destruct”. It is important to remember here, though, that this function has to be coded in before deployment on the blockchain. Because adding a deletion function afterwards would constitute a change to the smart contract itself, which is not possible.

Features of smart contracts

There are some very crucial attributes that grant the power that smart contracts contain, and the public interest that they have cultivated. Let’s go over some of them:

Security and immutability: A paramount theme of blockchain tech, and certainly a talking point of the past couple of years, is security. With hacks and exploits abound, both in Web2 and Web3, knowing that one’s assets are secure is of the utmost importance for adoption. Smart contracts excel in their security because it is code, not humans, that execute these contracts, meaning no human error. Not only this, but because they are stored on distributed networks, their legitimacy is trustless and their record is unchangeable (also referred to as immutable).

Efficiency: To get a sense for a smart contract’s efficiency at scale, let’s take the example of a supply chain problem. Currently, when goods arrive at a warehouse, it is up to a human-run system to make sure that approvals are gathered and that payment is sent to the seller of said goods. With a smart contract, these sorts of approvals are sent for by the program and payment is executed automatically, cutting down on time, stress, and strain. This could aid in times when a supply chain would otherwise be strained to the point of disruption. Disruption that can, in turn, cause prices of the affected goods to increase, putting economic pressure on the consumer.

Transparency: Smart contracts are stored on the blockchain, which is a public ledger. Thus, they can be audited as they’re completely transparent.

Use cases

Smart contracts are customizable, and are thusly able to cater to a host of different applications in the real world. From GameFi to decentralized exchanges to the verification of NFT ownership, smart contracts are the linchpin of many of the exciting applications that we see popping seemingly every day in the world of Web3. Let’s take a look at two of the main ones- finance and decentralized applications:

Finance

Many banking services that we know and use today are able to be decentralized and made without intermediaries. DeFi platforms like Uniswap and Curve utilize such smart contracts to offer such financial services. This is an example of what is so exciting about smart contract technology. The financial services of today that may be prohibitive for one reason or another, especially financially, can be reproduced in a much more democratized way with the use of dApps.

But how exactly can one trust a computer program to handle something as important as finances? Well, there are some key attributes to consider when looking at the viability of a smart contract-powered solution. One key feature of smart contracts, automation, eliminates the need for intermediaries and reduces the risk of human error, making financial transactions faster, more efficient and more reliable. This is particularly useful in areas such as cross-border payments, which can currently be slow and costly due to the need for intermediaries and compliance checks.

Another financial service use case for smart contracts is in the area of digital assets. The use of smart contracts allows for the creation of programmable digital assets, such as cryptocurrencies and security tokens, which can be easily traded and managed on a decentralized network. This allows for the creation of new financial products and investment opportunities, such as tokenized real estate, and can provide greater accessibility and security for investors.

dApps

One of the most important applications of smart contracts today is their enablement of decentralized applications, commonly referred to as dApps. As defined before, a smart contract on its own is a quite simplistic mechanism (if/when…then…). However, when linked together, they give rise to complex applications like games, lending platforms, and media platforms. When talking about how smart contracts can improve current systems, let’s take the example of gaming.

Gaming dApps have been quite a popular application of smart contract tech, especially in the realm of GameFi. Many games, especially the mobile games of today, have what’s called an in-game economy. Players collect in-game currency and spend them on in-game items. Players also spend real money on in-game items. The operative term here, if you couldn’t already tell, is ‘in-game’. With smart contracts, one can NFT-ize these items to no longer just exist within one game, but become a transferable asset. One that might even find its way across games, and even across metaverses. Because of their immutability and ability to verify ownership, smart contracts enable the monetization of gaming, and that has not been lost on projects such as Mines of Dalarnia ( DAR) and Walken ( WLKN). These two projects employ the use of NFTs to help users earn while playing or exercising, respectively.

was originally published in The Poloniex blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

Popular news

How to Set Up and Use Trust Wallet for Binance Smart Chain
#Bitcoin#Bitcoins#Config+2 more tags

How to Set Up and Use Trust Wallet for Binance Smart Chain

Your Essential Guide To Binance Leveraged Tokens

Your Essential Guide To Binance Leveraged Tokens

How to Sell Your Bitcoin Into Cash on Binance (2021 Update)
#Subscriptions

How to Sell Your Bitcoin Into Cash on Binance (2021 Update)

What is Grid Trading? (A Crypto-Futures Guide)

What is Grid Trading? (A Crypto-Futures Guide)

Start trading with Cryptohopper for free!

Free to use - no credit card required

Let's get started
Cryptohopper appCryptohopper app

Disclaimer: Cryptohopper is not a regulated entity. Cryptocurrency bot trading involves substantial risks, and past performance is not indicative of future results. The profits shown in product screenshots are for illustrative purposes and may be exaggerated. Only engage in bot trading if you possess sufficient knowledge or seek guidance from a qualified financial advisor. Under no circumstances shall Cryptohopper accept any liability to any person or entity for (a) any loss or damage, in whole or in part, caused by, arising out of, or in connection with transactions involving our software or (b) any direct, indirect, special, consequential, or incidental damages. Please note that the content available on the Cryptohopper social trading platform is generated by members of the Cryptohopper community and does not constitute advice or recommendations from Cryptohopper or on its behalf. Profits shown on the Markteplace are not indicative of future results. By using Cryptohopper's services, you acknowledge and accept the inherent risks involved in cryptocurrency trading and agree to hold Cryptohopper harmless from any liabilities or losses incurred. It is essential to review and understand our Terms of Service and Risk Disclosure Policy before using our software or engaging in any trading activities. Please consult legal and financial professionals for personalized advice based on your specific circumstances.

©2017 - 2024 Copyright by Cryptohopper™ - All rights reserved.