Exploring Smart Contracts

(image from Raimond Klavins)

Smart Contracts allow you to build apps that support new ways of funding projects, building economies, governing organizations, gaming, creating unique digital experiences with your favorite creators, or building those experiences for your own creations.

For example, Axie Infinity is a "play to earn" game that uses the digital economy to generate real wealth for players. It's not just a traditional in-game virtual economy, it's a real $3 billion economy owned by players. In the Philippines it's replacing low paying work. This interview with the game founders is fascinating in the scale of what's been accomplished and the roadmap ahead.

A few definitions

Blockchain
A system of recording information in a way that makes it difficult or impossible to change, hack, or cheat the system. A blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. (Euromoney)
Smart Contract
A self-executing contract with the terms of the agreement between buyer and seller being directly written into lines of code. The code and the agreements contained therein exist across a distributed, decentralized blockchain network. (Investopedia)
Ethereum Virtual Machine (EVM)
The role of EVM is to execute and deploy smart contract which are written in programming languages like Solidity.

Which blockchain to use?

The blockchain you pick for your Smart Contract application depends on several factors:

There are also real-world energy usage differences between older and newer systems.

For example, high-end collectibles are often built on Ethereum 1.0 due to the popularity of the Ethereum ecosystem which was the first blockchain to offer Smart Contracts. On the downside, it has high transaction costs and is relatively slow. It's also very energy intensive since it's based on the Proof of Work consensus system.

What if you're building a high-transaction system that needs very low transaction costs? There are a range of blockchains that support these types of scenarios. These systems tend to use the newer Proof of Stake consensus model which uses much less energy and adds scalability. Ethereum 2.0 will be based on Proof of Stake to gain these benefits as well.

Go deeper: What is Proof of Work or Proof of Stake?

Developing Smart Contracts

Contracts are software programs used to manage valuables like currency or organizational governance so it's critical to understanding best practices around development, testing and security.

There are many Smart Contract systems now. Here I'll focus on contracts that run on the Ethereum Virtual Machine (EVM).

There are many popular blockchains that support EVM-based contracts.

Best Practices

I recommend getting started with OpenZeppelin's learning materials and their ecosystem of existing well-tested contracts.

I created an open source template for starting OpenZeppelin-based projects. It's based on their tutorial plus then I added some additional features:

Learning Solidity

You will also want to study Solidity and learn how to build some popular contracts from scratch.

I enjoyed the Master Ethereum & Solidity Programming From Scratch in 2022 Udemy course which teaches Solidity and walks through building useful contracts such as Token, Initial Coin Offering, Lottery, Auction, Crowdfunding.

Build a full-stack application

You'll also want to understand how to build a full-stack application.

I enjoyed the Build An NFT Marketplace From Scratch - Blockchain DApp Udemy course which focused on creating a full-stack marketplace application minting non-fungible tokens, building the UI, and connecting the UI with the blockchain. Tools include NextJS and Ether.js for the front-end, and OpenZeppelin contracts and Hardhat for the Solidity environment.

Podcasts

There is a lot to explore in cryptocurrency and Web3, such as tokenomics, developer ecosystems, and popular projects. Learn through a growing number of podcasts and online learning resources.

Here are some podcast episodes I really enjoyed:

... and am working my way through episodes in these podcasts:

In Conclusion

It's challenging to get started building distributed apps with Smart Contracts mainly due to all the options, new technologies and fast growing ecosystem.

Though once you dive in, you'll be intrigued by the possibilities.