A smart contract is just like a contract in the real world, the only difference is that Smart Contracts are completely digital. In fact, they are actually a computer program created by coding which is stored on the blockchain.
Smart contracts are extremely popular nowadays. But how are they used in DeFi? What are smart contracts and what problems do they solve? Let's get into it.
First, let’s review a real life example to understand how smart contracts work, by first looking at GoFundMe, the large fundraising platform. Product creators can go to GoFundMe’s website, showcase their project, set a funding goal and start collecting money from others who like in the idea or want to invest in it.
The company, GoFundMe, is the third party governor that sits between product creators and their supporters. This means that both of them need to trust GoFundMe to handle their money correctly. If the project gets successfully funded, the project team expects GoFundMe to give them the money.
On the other hand, if the project fails and doesn’t get funding, GoFundMe would help supporters get a refund. Both the product creator and supports have to trust GoFundMe.
Let me be clear, GoFundMe is not a smart contract. It’s a company that I believe will be automated by smart contracts in the future. With smart contracts, Computer Programmers can build a similar system that doesn’t require a third-party like GoFundMe.
We could program the smart contract so that it holds all the received funds until a certain goal is reached. The supporters of a project transfer their money to the smart contract. If the project gets fully funded, the contract automatically passes the money to the creator. And if the project fails to meet the goal, the money automatically goes back to the supporters, without needing to trust a third-party.
Instead, you’re trusting a computer program that’s literally designed to do it. And because smart contracts are stored on a blockchain, everything is completely distributed on an open ledger. With this technique, there’s no person in control of the money and no room for human error. But why should we trust a smart contract?
Since, smart contracts are stored on a blockchain, they inherit some interesting properties. They are immutable and distributed. Being immutable means that once a smart contract is created, it can never be changed again. No one can go behind your back and tamper with the code of your contract after it’s created.
Distribution means that the output of your contract is validated by everyone else using the network. A singular person can’t force the contract to release the funds because nodes, miners & other people on the network will see the attempt to change and recognize it as invalid, therefore deny it.
Tampering with smart contracts becomes almost impossible. The reason I’m so bullish on DeFi in general is because we’ve barely scratched the surface on smart contracts.
Smart contracts can be applied to many different things, not just on GoFundMe crowdfunding applications. In fact, we are already seeing many defi platforms offer Loans, which is possible through smart contracts. Yield Farming is earning interest on crypto assets utilizing smart contracts.
The future possibilities of smart contracts is almost unlimited. Everything nowadays that we see utilizing a contract can be automated. Banks can use it to offer automatic payments. Insurance companies could use it to process claims. UPS or Fedex could use it for payment on delivery,
So, how do we use smart contracts without any coding knowledge? Right now there are a handful of blockchains who support smart contracts. To list a few, Ethereum, Polygon, AVAX, BSC & Fantom.
It’s worth noting that Bitcoin also has support for smart contracts although it’s a lot more limited compared to the others that I mentioned. These blockchains were specifically created and designed to support smart contracts using a special programming language called Solidity. Solidity was specifically created for Blockchain Smart Contracts and uses a syntax that resembles Javascript. Hopefully now you have a better understanding of what smart contracts are and how they operate in the defi space!