Defining the web3 stack
What is web3?
Before defining the web3 stack, it’s best to define web3.
In short: web3 is the stack of protocols that enable fully decentralized applications.
With this decentralized tech stack, we can build decentralized applications which have their own implications and characteristics.
Some characteristics enabled by web3 are:
- Decentralized web infrastructure
- Ownership (of data, content, and platform)
- Native digital payments
- Self-sovereign identity
- Distributed, trust-less, & robust infrastructure
- Open, public, composable back ends
While some applications built on decentralized tech stacks will replace their predecessors, a new paradigm of apps have also been made possible through blockchain technology. Native digital payments and public back-end infrastructure – like machine learning, mobile devices, virtual reality, and other primitives – enable entirely new types of applications.
Does this mean that everything is going to be replaced by web3? Not necessarily. While building on a decentralized tech stack is a better choice for certain types of applications, it depends upon what someone is building.
Let’s start by breaking web3 into categories:
- Blockchain
- Blockchain development environment
- File storage
- Off chain data protocols
- API (indexing & querying)
- Identity
- Oracles
- Other protocols
Blockchain
There are countless blockchains that you can use. There is no single "best" option, instead one should consider the various tradeoffs between them.
Below is a primer on some of the most prominent blockchains:
- Ethereum - original smart contract platform
- ZK rollups: ZKSync, Starknet, Hermez - High throughput Ethereum Layer-2s (L2s)
- Optimistic rollups: Arbitrum & Optimism - Ethereum L2s
- Polygon - Ethereum sidechain
- Solana - Non-EVM compatible Layer 1 (L1), high throughput, inexpensive transactions, fast block times, written in Rust
- NEAR - Non-EVM blockchain with smart contracts in Rust or Assemblyscript
- Cosmos - an ecosystem of interoperate blockchains
- Polkadot - Enables blockchains built on top of it, an internet of blockchains
- Aurora - EVM compatible chain running on NEAR protocol
Fantom - EVM compatible L1
Avalanche - EVM compatible L1
Celo - EVM compatible L1, designed to make it easy for anyone with a smartphone to send, receive, and store crypto - Tezos - Non EVM compatible L1
Blockchain Development Environments
For EVM development, there are a few good development environments available:
- Hardhat (JavaScript) is a newer option, but one that is gaining popularity.
- Truffle (JavaScript) is a suite of tools for building and developing applications on the EVM.
- Foundry is a new Solidity development environment from Paradigm.
- Brownie is a Python-based development and testing framework for smart contracts for Solidity / EVM development.
File Storage
Where do we store images, videos, and other files in web3? Storing anything that large on-chain is usually expensive, so we likely don’t want to store them there. Instead, we can use one of a handful of file storage protocols:
- IPFS - a reliable peer-to-peer file system, though data can be lost if not pinned.
- Arweave - allows you to store data permanently, paying a single transaction fee.
- Filecoin - from Protocol Labs, the team that created IPFS. It is a protocol designed to provide a system of persistent data storage.
Off chain data protocols
In addition to on-chain file storage, there are also ways to store data off-chain. These solutions function similarly to how you might use a database in a traditional tech stack, but instead they are replicated across a number of nodes on a decentralized network, and therefore are more reliable (at least in theory).
A few options are:
- Ceramic Network - a decentralized, open-source platform for creating, hosting, and sharing data.
- Textile ThreadDB - a multi-party database built on IPFS and Libp2p.
- GunDB - a decentralized, peer-to-peer database.
Some challenges for this vertical are real-time data, conflict detection and conflict resolution, write authorization, documentation, and general developer experience. Integrating off-chain data solutions with blockchain protocols is one of the last big hurdles we need to cross before we have a fully decentralized protocol stack capable of supporting any kind of application.
API (indexing & querying)
There are a lot of differences in the ways we interact with blockchains versus databases in the traditional tech stack. With blockchains, data isn’t stored in a format that can efficiently or easily be consumed directly from other applications or front ends.
Blockchains are optimized for write operations. You often hear about innovation centered around transactions per second, block time, and transaction cost. Blockchain data is written in blocks over the course of time, making anything other than basic read operations impossible.
In most applications, one needs features like relational data, sorting, filtering, full text search, pagination and many other types of querying capabilities. In order to do this, data needs to be indexed/organized for efficient retrieval.
Traditionally, that’s what databases do in the centralized tech stack, but that indexing layer was missing in the web3 stack.
The Graph is a protocol for indexing and querying blockchain data that makes this process much easier and offers a decentralized solution for doing so. Anyone can build and publish open GraphQL APIs, called subgraphs, making blockchain data easily queryable.
To learn more about The Graph, check out the docs here or a tutorial here.
Identity
Identity is a completely different paradigm in web3. In web2, authentication is almost always based on a user’s personal information. This information is usually gathered either via a form or OAuth provider that asks the user to hand over in exchange for access to the application.
In web3, identity revolves around the idea of wallets and public key cryptography. While the name “wallet” serves its purpose, people new to web3 might find the terminology confusing as it relates to authentication and identity. I hope that in the future we can figure out another way to convey what a wallet is, as it combines aspects of finance but also identity and reputation.
Oracles
Oracles allow developers access to read real-world data & external systems from within a smart contract.
Chainlink is an Oracle that enables access to real-world data and off-chain computation while maintaining the security/reliability ‘;inherent to blockchain technology. Flux is a cross-chain oracle that provides smart contracts with access to economically secure data feeds.
Other protocols
Radicle is a decentralized code collaboration protocol built on Git. It could be thought of as a decentralized version of GitHub.
Livepeer is a decentralized video streaming network. It is mature and widely used with over 70,000 GPUs.
Wrapping up
We are excited about what this space is doing for the world. While the infrastructure is still evolving, the vision of building truly decentralized protocols and applications that allow people to coordinate without having to give power/control to large companies is an important one and we’re close to making this vision a reality.
Abouth the Author
Authored by Kyle Rojas, Head of Business Development & Partnerships at Edge & Node, The Graph,
This article was adapted from a blog post by Nader Dabit on Dec 22, 2021