Please ensure Javascript is enabled for purposes of website accessibility

What Are Smart Contracts?

By Zhiyuan Sun – Oct 7, 2021 at 7:36AM

Key Points

  • By enforcing trust through code, smart contracts enable complex peer-to-peer transactions. 
  • Applications include crypto borrowing, lending, staking, non-fungible tokens trading, coin swaps, and more. 

You’re reading a free article with opinions that may differ from The Motley Fool’s Premium Investing Services. Become a Motley Fool member today to get instant access to our top analyst recommendations, in-depth research, investing resources, and more. Learn More

This blockchain innovation is finally gaining traction with the rise of decentralized finance services.

The rise of blockchain technology, especially the type used by Ethereum (ETH -0.45%), has caused smart contracts to skyrocket in popularity. For the uninitiated, smart contracts are programmable agreements, or protocols, that self-execute and enforce without the aid of any intermediaries. Other than the fact that they do not require a middleman (like a lawyer), they are not so different from regular contracts. 

Long story short, smart contracts are at the heart of the $200 billion decentralized finance (DeFi) industry. Let's take a look at how they work, and how they can enrich investors' blockchain portfolios.

A series of connected cogs. One is labeled "smart contract" and it is connected to several cogs with digital icons.

Image source: Getty Images.

Smart contracts in action 

It's pretty hard to utilize financial services without smart contracts. Specifically, peer-to-peer cryptocurrency transactions without them is rife with fraud. 

 Let's say a lender, Ellen, wants to earn 4% interest per year on her $10,000 worth of Bitcoin (BTC 0.01%) by lending it out to a borrower named John. To establish trust, both participants would first need to get to know each other better and sign an agreement. Afterward, Ellen sends 0.25 bitcoins to John's wallet address in anticipation that John will send her collateral for the loan. But let's say he never does, simply grabbing Ellen's bitcoins and making a run for it. This is why, for a long time, we could never have peer-to-peer transacctions in financial services. 

But what if Ellen and John used a smart contract? To do this, Ellen would convert her bitcoins into a token that's based on the Ethereum (ER-20) blockchain, called Wrapped Bitcoin (WBTC -0.05%). She can do this either through her wallet, or on most major exchanges. The smart contract guarantees that she will be receiving WBTC from BTC on a 1-to-1 ratio before fees. 

Subsequently, all she has to do is log onto a DeFi platform like Aave, connect her wallet, and deposit WBTC into one of its lending services. And the interest would start rolling in.

This works with very little risk because her WBTC is automatically sent to a lending address governed by a protocol. Likewise, interest is automatically collected and sent to all beneficiary wallet addresses within the protocol. What's more, when borrowers such as John takes out a loan, smart contracts automatically place their collateral in escrow. So, if they default, it would trigger a clause in the smart contract for automatic liquidation and lenders like Ellen would get their money back.

For those who don't like lending money, fear not. One could also deposit their cryptocurrency into dedicated addresses, using smart contracts to validate transactions on a blockchain (this is called staking). For example, one can earn over 6% interest per year gross by staking Cardano's ADA (ADA 0.94%) coins, the third-largest cryptocurrency globally. 

Furthermore, smart contracts power the buying and selling of ownership certificates of digital art, music, videos, and other digital items, also known as non-fungible tokens, or NFTs. Investors can be confident when they deposit their funds into making a bid or buyout on marketplaces like OpenSea.io that they are getting the NFTs they are paying for. Programmers write the code for buying and selling NFTs and ensure that they work as intended, similar to online casinos. Like physical art, NFTs have incredible tax benefits when donated to charities.

The next step 

I'd recommend investors either try out decentralized finance services to earn a fixed income or invest in smart contract coins or tokens. The advancement of smart contracts is far from over. Right now, there are innovative networks like Chainlink (LINK -2.56%) that can link smart contract execution to real-world data like price feeds, weather patterns, election results, and economic metrics. Now's truly the golden era of development for smart contracts. 

Zhiyuan Sun owns shares of Bitcoin, Cardano, Chainlink, and Ethereum. The Motley Fool owns shares of and recommends Bitcoin and Ethereum. The Motley Fool has a disclosure policy.

Stocks Mentioned

Ethereum Stock Quote
Ethereum
ETH
$1,272.46 (-0.45%) $-5.78
Bitcoin Stock Quote
Bitcoin
BTC
$16,971.71 (0.01%) $1.52
Cardano Stock Quote
Cardano
ADA
$0.32 (0.94%) $0.00
ChainLink Stock Quote
ChainLink
LINK
$7.41 (-2.56%) $0.20
Wrapped Bitcoin Stock Quote
Wrapped Bitcoin
WBTC
$16,924.07 (-0.05%) $-9.14

*Average returns of all recommendations since inception. Cost basis and return based on previous market day close.

Related Articles

Premium Investing Services

Invest better with The Motley Fool. Get stock recommendations, portfolio guidance, and more from The Motley Fool's premium services.