A Full Stack Guide to Web3

A Full Stack Guide to Web3

Web3 is a growing industry. For beginners and engineers interested in Web3 there are lucrative opportunities in Web3. Let's take a deep dive and discover what Web3 is all about.

What is Web3?

Web3 can be defined as a trustless, permissionless decentralized internet ecosystem. Web3 defining feature is ownership, it gives users full ownership over their content, data and assets through blockchain technology. Web1 was Web2 allowed users to both read and write on centralized mediums( Facebook, Instagram, Twitter, etc.). Web3 gives users the distinguishing feature of full ownership of their content, data and assets via blockchains. it enables users to read-write-own.

An application like Twitter owns your identity and data in Web2, in Web3 your identity is your own, therefore can move easily between platforms without it being captured and monetized by service providers.

With this in mind, Let's see how the Web3 stack looks like.

Web3 Stack Overview

web3-network-layer6.png

Network Layer

The foundations of Web3 technology stack is the blockchain network layer. Web3 applications are built on top of blockchain architectures for trustless and permissionless access. Web3 in context refers to decentralized apps that run on the blockchain. These are grouped into Ethereum Virtual Machine (EVM) and non EVM compatible blockchains.

web3-network-layer8.png

EVM Blockchains

Ethereum was launched in 2015 and is built on the innovation of Bitcoin with some major differences.

Both let you use digital money without payment providers or banks. But unlike Bitcoin, Ethereum is programmable which allows you to build and deploy decentralized applications on its network. The Ethereum protocol itself exists solely for the purpose of keeping the continuous, uninterrupted, and immutable operation of this special state machine; its the environment in which all Ethereum accounts and smart contracts live. At any given block in the chain, Ethereum has one and only on e 'canonical' state, and the EVM is what defines the rules for computing a new valid state from block to block.

EVM Blockchain Types
  • Ethereum : Layer 1 (L1) EVM smart contract blockchain.

  • Polygon: Layer 2 (L2) Ethereum sidechain.

  • Avalanche: L1 blockchain that achieves high throughput and offers compatibility with the Ethereum Virtual Machine.

  • Cronos: Layer 1 EVM compatible Blockchain.

  • Optimism: L2 modular blockchain using optimistic rollups and single round fraud proofs.

  • zkSync : L2 modular Ethereum blockchain that relies on math not validators. zkSync solves Ethereum scalability with zero security compromises. Users can withdraw assets to Layer 1 at any time.

  • Arbitrum: L2 modular Ethereum blockchain using optimistic rollups and multi round fraud proofs.

  • Starknet: L2 modular Ethereum blockchain permissionless decentralized zk rollup.

Modular Blockchains

EVM and non EVM Layer 1 blockchains are Monolithic in nature thereby making them restrictive, for example EVM blockchains have the limitation of having a shared blockchain that has to be used and hard forks that developers have to go along with.

In comparison, Modular blockchains are a shift from L1 blockchains. There is a move away from monolithic design where consensus, data availability, and execution are tightly coupled (e.g. today's Ethereum), to a modular future, where execution is separated from data availability and consensus (e.g. tomorrow's Eth2 or Celestia). This separation allows for specialization at the base layer, delivering significant increase in bandwidth capacity.

modular.jfif

Modular stacks was initially introduced with rollups. Rollups are scaling solutions in the form of Layer 2s —third party protocols that improve the speed and throughput of a blockchain network.

Rollups specialize in execution, off-loading settlement, consensus, and data availability to separate layers as shown in above diagram.

There are two kinds of rollups: Optimistic and Zero-Knowledge (ZK) rollups. When we study both models, we might think they are the same. However, while both technologies are very similar, they present different security models and benefits.

While initial implementations of modular stacks were first introduced with rollups, rather than scaling monolithic chains(e.g. Ethereum) an entirely new stack of purpose-built modular blockchains can be used to take advantage of this new paradigm.

One of such modular blockchain is Celestia. Celestia specializes in consensus and data availability, off-loading execution to separate chains, such as rollups.

celestia-diagram.png

Unlike previous blockchain designs, which had execution as a core functionality. Celestia design allows blockchains to be created for specific purposes, there is no need for execution because that can be a job of a separate chain. This addresses the delays affiliated with monolithic blockchains from the base layer: transaction execution and state bloat.

EVM Web3 Development Frameworks

  1. Truffle: Truffle comprises of three JavaScript based development tools Truffle, Ganache, and Drizzle .

    • Truffle: A development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM).
    • Ganache: A personal blockchain for Ethereum development used to deploy contract, develop your applications, and run tests.
    • Drizzle: A collection of frontend libraries that make writing Decentralized Applications(Dapps) for the frontend easier and more predictable.
  2. Hardhat: A JavaScript development environment used to compile, test and debug Ethereum code.

  3. Embark: A JavaScript development environment, testing framework, and other tools.

  4. Brownie: A Python-based development environment and testing framework.

  5. Ape: A Python based smart contract development tool for python users, data scientists and security professionals.

  6. Web3j: A Java and Android library for developing blockchain application on the Java Virtual Machine(JVM).

Non EVM Blockchains

  • Bitcoin: Bitcoin is the first decentralized digital currency. The bitcoin network is a peer-to-peer payment network that operates on a cryptographic protocol. Users send and receive bitcoins, the units of currency, by broadcasting digitally signed messages to the network using bitcoin cryptocurrency wallet software. Transactions are recorded into a distributed, replicated public database known as the blockchain, with consensus achieved by a proof-of-work system called mining. While Bitcoin doesn't play a major role in Web3 today. It's the first digital asset someone can own through the use of public-private key cryptography.

  • Solana: Layer 1 Blockchain built to enable scalable, user-friendly apps written using low level programming languages like Rust or C and C++.

  • Near Protocol: Layer 1 developer friendly proof of stake public blockchain. Near Protocol compared to Ethereum has significantly lower gas fees thanks to a more efficient contract execution model and a progressive UX. It also uses Nightshade, a dynamic approach to sharding.

  • Terra: Layer 1 open-source blockchain hosting a vibrant ecosystem of decentralized applications (Dapps) and top-tier developer tools.

  • Flow: Layer 1 open source blockchain, ‍flow is a fast, decentralized, and developer-friendly blockchain, designed as the foundation for a new generation of games, apps, and the digital assets that power them. It is based on a unique, multi-role architecture, and designed to scale without sharding, allowing for massive improvements in speed and throughput while preserving a developer-friendly, ACID-compliant environment. Smart contracts on Flow are written in Cadence, an easier and safer programming language for crypto assets and apps.

Infrastructure and Category Primitives

This is a complex layer with projects building ranging from smart contract, communication protocols, data storage , data analytics, DAO governance tooling, financial applications, identity solutions and more.

webs-infra3.png

  • Security: OpenZeppelin provides security products to build, automate, and operate decentralized applications. it also protects leading organizations by performing security audits on their systems and products.

  • Decentralized Storage: Blockchains can be used as a moderate means decentralized state and storage system but when it comes to large amount of data like images, videos and GIFs, it is inefficient and costly. Due to this limitations a different chain or means to store large amounts of data in a decentralized way is required. There are platforms that are blockchain-based persistent like Ethereum and Arweave and other which are contract based persistent like Filecoin, Skynet, Storj and 0Chain.

    Other considerations like IPFS which is a distributed system for storing and accessing files, websites, applications and data. It doesn't have a built -in incentive scheme. bur can instead be used with any of the contract based incentive solutions for longer term persistence. There are other ways to persist data with IPFS which include using a pinning service which will "pin" data for the user. Example of IPFS pinning services are Pinata, Infura and Web3.storage.

  • Analyze: In order to make sense of data, analytics is of vital importance. Dune Analytics is the Ethereum-centric analytics platform that makes on-chain crypto data accessible and consumable.

  • Communicate: In order extend the blockchain with peer-to-peer storage and communication, an option is Swarm. Swarm is a decentralized storage and communication system for a sovereign digital society and it provides continuity of service and resilience against network outages or targeted denial of service attacks.

  • Govern: To manage crypto assets, a good option is Tally Capital. Tally Capital is digital asset management firm that invest in Blockchain tokens, protocols and companies yielding interest for investors globally. Better than a buy and hold strategy, Tally capital invests in crypto coins with great potentials at the early stage level utilizing a well calculated exit strategy to maximize returns.

  • Identify: A wallet address in Blockchain has a complex structure and is difficult to remember. ENS domain names can serve as a user’s identity in the world of Web3. The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum . Another option SpruceID is a open-source toolkit for developers, includes a cross-platform toolkit for decentralized identity, reusable verification workflows to tie public social media accounts to public keys, a tool to link system accounts to keys, and a mobile credential wallet.

  • Buy/Sell: In other to buy tokens for online metaverse video games like Axie Infinity and Decentraland which uses Ethereum-based cryptocurrencies. Users can use Uniswap. Uniswap's Universal Protocol facilitates peer-to-peer market making and swapping of ERC-20 tokens on the Ethereum blockchain. Users can swap ERC-20 token among themselves without a Centralized Exchange.

  • Borrow/Lend: For borrowing and lending a good option is Compound blockchain. The Compound blockchain is a solution that enables frictionless borrowing and lending of Ethereum tokens. AAVE is another lending system that allows users to lend, borrow, and earn interest on crypto assets. The platform is a decentralized money market protocol where users can participate as either borrowers or lenders. Here, borrowers can borrow cryptocurrencies by paying variable interest rates.

  • Stake: For staking there are many platforms one of them is Lido. Lido lets users stake their assets for daily staking rewards. User can stake any amount of tokens - no minimum. Lido lets you use your staked assets to gain yield on top of yield. Use your tokens (which earn daily staking rewards) as collateral, for lending, yield farming and more.

  • Insure: For crypto insurance, an example is Risk Harbor, which is a risk management marketplace for decentralized finance (DeFi) that utilizes a completely automated, transparent, and impartial invariant detection mechanism to secure liquidity providers and stakers against smart contract risks, hacks, and attacks.

  • Market Makers: For market making, Wintermute is a leading global algorithmic market maker in digital assets, creates liquid and efficient markets on centralized and decentralized trading platforms and off-exchange. There are others like Uniswap which allows crypto users to deposit their assets into a shared pool, thereby enabling them to earn trading fees from the pool.

Use Case Layer

On top the Network and Infrastructure layers you will find the use case layer. Apps like Uniswap can be used to swap ETH for the tokens needed to play games like Axie Infinity.

web3-use-case-layer5.png

Similarly, decentralized blogging platform Mirror uses the storage protocol Arweave to store data. Meanwhile, it leverages Ethereum to let publishers get paid in crypto, often by directing tokens to their ENS address.

Access Layer

This layer serves as the entry point for all Web3 activities. Want to buy an NFT from Opensea all you 'll need is a wallet.

web3-access-layer2.png

Exchanges like Binance help users to trade their fiat money for crypto in order to get started. Metamask is a wallet for Ethereum Blockchain based tokens. Trust and Brave Wallets are multi-chain crypto wallets. Phantom is a Solana Blockchain wallet.

Frontend Frameworks

Now we have discussed about the blockchain environment and tools, now let's concentrate on the user interface which is the frontend. Remember that frontend is technically part of Web2. Building the frontend is still a Web2 skill. Developers like to use the following popular libraries and frameworks these are the pros and cons.

  • React.js: it's a UI library that makes it painless to create interactive user interfaces for web and mobile. React.js is more widely used but it takes time to learn how to use.

  • Next.js: Next.js is a React based framework that gives you building blocks to create fast web applications.

  • Vue.js: A Progressive JavaScript Framework which is performant and versatile. From developer experience compared to react.js it is easier to understand and use.

  • Svelte.js: Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React.js and Vue.js do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.

Exciting Web3 Stacks to Consider

Web3 is a little fragmented. Here are a list of exciting projects you can check out:

  • Graphprotocol: 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.
  • LensProtocol: is a composable and decentralized social graph, ready for you to build on. so you can focus on creating a great experience, not scaling your users.
  • OptimismPBC: is a low-cost and lightning-fast Ethereum L2 blockchain.
  • FuelLabs: is the world's fastest modular execution layer.
  • LivePeer: is a decentralized video streaming network built on the Ethereum blockchain.
  • Nomadxyz: is an optimistic interoperability protocol that enables secure cross-chain communication.
  • LitProtocol: is an open source, decentralized utility that uses encryption to provide blockchain users access to digital and real world experiences.
  • Radicle: is a decentralized code collaboration network built on open protocols. It enables developers to collaborate on code without relying on trusted intermediaries. Radicle was designed to provide similar functionality to centralized code collaboration platforms — or "forges" — while retaining Git’s peer-to-peer nature, building on what made distributed version control so powerful in the first place.
  • Ceramic network: is a decentralized data network that brings unlimited data composability to Web3 applications.
  • Anchorlang: is a framework for Solana Sea-level runtime providing several convenient developer tools for writing smart contracts.
  • Cairolang: A language for scaling Dapps using STARKs. A Turing-complete language making it possible for all blockchain developers to harness the power of STARKs
  • Chainlink: Chainlink decentralized oracle networks provide tamper-proof inputs, outputs, and computations to support advanced smart contracts on any blockchain.

To enhances your knowledge of Web3, here are some resources:

Grant Programs

Grant programs are available for developers that are interested in building for Web3 chains and projects. It's an opportunity for developers and engineers who are interested in furthering their careers.

Join Web3 Communities

Communities are extremely important when starting out in the tech world and the web3 community is one of the most inclusive communities out there. These are few that are quite helpful:

Web3 Jobs

Interested in Web3 jobs? here are some links:

Hope you found this article useful. To connect for more on Web3 here are my handles: Twitter | LinkedIn | Github

See you in my next article. Take care!!!