This article is targeted to developers who know what Blockchain technology is and what it does (at least from far above) and want to make their first steps into development of Web3. When starting to learn Web3 it's hard to know which frameworks, libraries and infrastructure to invest in with your precious time.
Whatever is said in this article please take it with a grain of salt. Changes come into Web3 space quick and sometimes ideas are thrown out the next day.
There is over 100 layer 1 Blockchains and many more layer 2 Blockchains, including the development tools, many wallets and other things out there not included in this article.
The items in the above image are the ones with most GitHub starts and the ones I consider worthy of consideration when just starting your walk down the development path of Web3. I'm sure many will find themselves discovering other tools, chains and tech.
The Development Stack
As you've probably noticed a lot of items are missing in the image above. That's pretty much intentional since it's easier to focus on really popular tech instead of including all possibilities. For more comprehensive guide please check this out: 101Blochchains Traning Library.
Also known as the infrastructure layer. Here are my thought process when deciding which Layer 1 Blockchain infrastructure I should start investing my time in and learning it's ins and outs.
Easy guess: Ethereum. But there is a lot of buzz going around Solana in development world. I tend to stay away from Solana just for now due to a few incidents where either developers took it offline (for bug fixing) or due to the DDoS attacks.
The question I ask myself is, if the bug-fix was necessary how could developers take down and upgrade all servers? So it's controlled by a small group of developers (for now) which means it's centralized. Does that also mean that incentives are not favorably aligned for others to join mining network in Solana? (currently minimum system requirements to mine on Solana is about 128GB RAM, 12 core CPU, ... More info here).
Needless to say Solana is the new kid on the block here. But I'll be keeping my eye on the network since one of the most important aspects of the network is its popularity among developers, not only its capabilities.
Layer 2 - Sidechains
It's very obvious today that the Blockchain technology is moving towards multi-layer infrastructure. Currently Layer 2 Sidechain solutions help leverage the tapped capacity of transactions on the main chains. Among scaling they also offer other benefits, such as cheaper transaction fees.
One of the main features of Sidechains is interoperability with the main chain. The results of any transactions should be easily transferable to the main chain from the Sidechain (and vice-a-versa).
The question I ask my self is: When Ethereum implements its scaling solutions how much need would there still be for the Sidechains? For the purposes of this article that makes little to no difference. The development stack doesn't change.
Contract Development Languages - Smart Contracts
Smart contract is just a publicly readable piece of code that runs on a Blockchain Virtual Machine. Here is a few simple insights into what you can and cannot do with the Smart Contract:
- It can't make HTTP calls
- It can call other contracts.
- Its storage is mainly represented by locally defined map (dictionary) equivalents and arrays.
- It has functions that manipulate its internal state.
- Everything on a main Blockchain (Layer 1) is considered to be public - code included.
There is a Python alternative to Solidity called Vyper. There are few other languages for EVM but I'm sticking to Solidity for now since it's a de facto language for Ethereum and EVM compatible Sidechains.
Rust and C/C++ on Solana
Rust is the language of choice for developing on Solana. Solana also supports C and C++ programming languages.
Solidity Contract Development Tools
The three main contract development tools that stick their heads out from the crowd of many are:
- Brownie Python based with 1.7K stars
Useful contract extensions/Contract libraries
Majority of the contracts deal with some type of money (either in the form of Tokens, commonly knows as ERC-XX contracts or Coins such as ETH or BTC). Therefor the security of the code is very important. There have been many hacks targeting smart contracts with millions of $$ in loss.
Instead of making the same mistakes as other developers there are GitHub repositories and companies that helps you minimize risk by using battle-tested libraries of smart contracts for Ethereum and other blockchains.
- OpenZeppelin library for writing secure smart contracts
- dapp-bin/library: A small collection of utility libraries.
- Density: Alex Beregszaszi's collection of useful modifiers and methods
- Solidity Standard Library: This is a proof-of-concept standard library that is included with Solidity itself.
- standard-contracts: Andreas Olofsson's collection of libraries that handle bits, bytes, encoding, decoding, and crypto.
- stringutils: Nick Johnson's string & slice utility library
If you'd like to get familiar with the nature of those attacks check out this tool called damn-vulnerable-defi.
Smart contracts cannot access off-chain data (data that is outside of the network). Oracles enable a hybrid-smart-contract approach where the data from the outside world can be safely ingested into a smart contract.
It's not recommended to have centralized Oracles and because smart contracts cannot access off-chain data it's vitally important to have decentralized outside services to agree on a truth. Example: conversion rates between ETH and USD upon which your contract may require to pay out a yield. Imagine if your central server is compromised and rates change.
Examples of Oracles:
- Random Number Generation or VFRs (Verifiable Random Functions)
- Conversion rates
Web Clients Libraries
Those two libraries are primarily intended as libraries for interacting with the Ethereum Blockchain and its ecosystem, including wallets.
It seems like Ethers.js is about 5x smaller in compressed bundle size at the moment as Web3 but offering about the same functionality.
For React developers out there the react-web3 is gaining in popularity (3.2K stars) but it's currently still in beta. I've tried using it but I've received a mix of dependencies from 8.0.0-beta and 6x versions. So I'm avoiding it for now, but keeping an eye on it.
The main challenge for decentralized storage is how to incentivize miners to stay online. It has to be worth it for them otherwise your files are gone forever.
IPFS protocol has no built-in incentive mechanism for miners to keep the data for specific period of time. It's a decentralized peer-to-peer hypermedia protocol. . GitHub link. Has 20.5K stars. Filecoin is one of the solutions trying to solve inventivization problem.
Filecoin is built upon IPFS and its purpose is to incentivize miners. It's an open storage market meaning that you as a client is making deals with storage miners where storage miner is putting up a collateral.
Is a storage protocol where miners and economically incentivized to store your data "permanently". You fee goes into storing your data forever.
GitHub link . Has 591 stars.
The question I ask my self is: Without passing XY years we can't really know if either of those incentive systems work. So currently my best bet would be to run IPFS nodes myself and possibly use Pinata or Infura (IPFS at the time of writing still in Beta on Infura). as a secondary pinning service.
There are 2 main types of wallets:
If you know a little bit about Blockchains and decentralized Storage you might ask yourself: How do you find a contract on a Blockchain? How do you find a file on IPFS?
By default those services do not created indexes, as they shouldn't. Indexing is a case-by-case en-devour so it's practically impossible to generalize.
The Graph is an indexing protocol for querying networks like Ethereum and IPFS. Anyone can build and publish open APIs, called subgraphs, making data easily accessible. Once the subgraph is created (by anyone really) it can be queried (by anyone really).
From developers perspective how to test and debug our code is crucial. As for web development things are practically no different from web2, but when it comes to smart contract development, frameworks such as Hardhat and Brownie must have a good support built in. And they do. One thing I'm missing in the Brownie framework is support in VSCode.
What about running contracts locally?
Do we need to sync the complete blockchain in order to test? Luckily not. Ganache is a personal Ethereum blockchain which you can use to run tests, execute commands, and inspect state while controlling how the chain operates.
What if your contract if referring to other contracts on a Blockchain?
In theory a developer would always need a node to run their programs. That's how each and every transaction get proposed to be mined within a block. Currently Ethereum blockchain takes up to 1TB of disk space. The demand for resources is too high in development environment.
Services such as Alchemy and Infura are here to elevate those demands by offering API access to popular Blockchains and storage solutions by running a node for you. They also include nodes as a gateway to test networks, such as Rinkeby, Kovan, Polygon, Filecoin.
Learning Web3 is currently very hectic. It's a vast field crammed with the good and the bad.
To know what works and what doesn't for your specific case you must first learn how it works. At least to some degree.
It's hard if impossible to separate winning technologies from loosing ones. It's also very difficult to decide into which technologies to invest your time. What will work and what won't? Each one of the Web3 technologies worth looking into, even if they don't make it into the hall of fame at the end. Maybe we get a glimpse into why they haven't made it or simply learn from the failed ones mistakes.
I think this Smart Contract Course by Patrick Collins on YouTube is invaluable content when taking up a challenge of diving into Web3. I couldn't recommend it more.
The topics covered are really from 0 to hero in there.