What are Smart Contracts? | How they power the DeFi Ecosystem
Our lives are now dependent on computer code. It’s responsible for our increasingly automated world and is behind all the software products we use to live, work and play.
For example, to manage finances, run a business or socialize with friends. Code has let us create so many interesting and useful products because of its flexibility. Now, we can combine code with blockchains to get smart contracts. Just as code powers the world we live in today, it’s smart contracts that’ll enable us to build unique, blockchain-based solutions to a wide range of problems.
So what exactly are smart contracts?
Smart contracts are code or computer programs stored on blockchains which automatically run when certain conditions are met. Despite the name, they’re not really “smart” — they can only do exactly as they’re programmed.
You can think of smart contracts as digital agreements. However, they have unique properties which distinguish them from ordinary contracts or agreements. For example, they’re:
- trustless — once conditions that have been agreed upon are met, smart contracts will automatically execute. They don’t require human intervention, which means you don’t need to rely on or trust third parties to fulfil the agreement
- immutable — smart contract code can’t be changed or manipulated once it’s been published to the blockchain, and
- transparent — the code and details of the agreement are publicly accessible
When paired with user-friendly interfaces, smart contracts can be used to create decentralized applications (dApps). Here’s an overview of some of the dApps available on Ethereum.
To understand how smart contracts work in practice, we’ll go through examples of how they can be used to create dApps which enable:
- peer-to-peer marketplaces; and
For each example, we’ll share how existing solutions work without blockchain technologies, and then explain how it compares with dApps.
Kickstarter is a crowdfunding platform which allows creators to fundraise for creative projects. It uses an all-or-nothing model, meaning creators only receive funding if their fundraising goal is met by a certain deadline. If you were to support a project, you would have to trust Kickstarter to hold your funds until that deadline, and then either return it to you, or distribute it to the creator.
However, with smart contracts, you don’t need to trust third parties like Kickstarter. For example, PartyBid is a dApp which enables crowdfunded purchases of digital assets, using a similar all-or-nothing model. Its smart contract holds the funds and depending on the outcome, it’s programmed to either let users claim tokens representing their ownership of the successfully purchased asset or re-claim their funds.
Another area where trust can be eliminated is in peer-to-peer marketplaces. Think about the experience of buying or selling electronic event tickets using platforms like Facebook Marketplace. As a buyer, if you make payment first, will you receive a legitimate ticket? Has it been sold to anyone else? Or as a seller, if you send the ticket first, will you receive payment? Without knowing the other party, we have to rely on signals like the quality of their personal profile.
Smart contracts remove that uncertainty. For example, OpenSea is a dApp which enables the buying and selling of digital assets. Instead of needing to vet the other party to your transaction, OpenSea’s smart contracts will automatically facilitate the correct exchange of digital assets and funds for you.
Banks are another example of an intermediary which can be cut out using smart contracts. Very simply, banks collect deposits and use those deposits to fund loans. When you ask your bank for a loan to buy property, they’ll do extensive checks to make sure you can repay it based on your personal circumstances. As part of the agreement, the bank will hold your property as collateral so that they can sell it if you fail to repay the loan.
As an alternative, decentralized financial (DeFi) applications such as AAVE have made it possible to get loans without talking to anyone. All you need to do is deposit funds as collateral into the AAVE smart contract and then choose what, and how much, you want to borrow. Unless you’re engaging in financial crimes, AAVE doesn’t even care who you are or where you’re from, and unlike your bank, it’s accessible 24/7. With smart contracts, there’s an opportunity to enable access to cheaper, trustworthy and more transparent financial services for anyone across the globe.
But remember — smart contracts are immutable, so the terms of your DeFi loan can’t be changed or negotiated away. Recently, a crypto lending company called Celsius filed for bankruptcy but still had to prioritize paying down their DeFi loans to reclaim their collateral.
The future of smart contracts
Clearly, not everything needs or can be programmed into a smart contract. However, where the rules of an agreement can be clearly defined and set in stone, smart contracts can be incredibly beneficial and efficient.
What makes them even more exciting is that smart contract code is open and transparent. This turns them into digital LEGO blocks which are composable, meaning they can be freely combined in different ways. For example, Atlas DEX leverages other smart contracts to aggregate the best prices for token swaps and enable swaps to occur between blockchains.
Together, the flexibility and composability of smart contracts is enabling faster development of blockchain-based applications. While it’s impossible to know what will eventually be created, we can be sure that innovation is happening at a much faster pace!
Learn something new today? Don’t be shy to share them with a friend that might be interested to learn more!
Not a part of our community yet? It’s not too late to join.
💥 | Check out our website: Atlas DEX