On the Future of Web3 — Paving the Way to End-to-End Fully-Decentralized Web

Qi Zhou
7 min readFeb 13, 2022

--

Background

The recent growth of decentralized applications such as decentralized finance (DeFi), non-fungible token (NFT), GameFi has dramatically created attention to and discussion of the next-generation worldwide web, namely, Web3. Compared to the current Web2, which is controlled by a few centralized companies such as Facebook, Google, one key feature of Web3 is decentralized, which offers several unique benefits:

  • Censorship-resistant, where all the assets are held by the user’s non-custodian wallet and therefore are not able to be frozen/confiscated assets by others.
  • Transparency, where the users’ data are all on-chain so that everyone can access and use the data instead of monopolizing the user data by the centralized company in Web2.

To enjoy these benefits, the users have to access a Web3 infra, generally, a blockchain node, to read the data from or write the user data by signing a transaction and then submitting it to the blockchain P2P network. To lower the barrier of accessing the blockchain services for users without setting up a blockchain node, multiple wallets (such as MetaMask) and node service providers (NSPs, such as infura/quicknode) are created to provide blockchain services. To interact with the blockchain, the users can simply do the following steps (taking MetaMask as the wallet for example):

Typical Flow of Using a dApp
  1. The user downloads and runs MetaMask as a browser extension (one-time step)
  2. The user opens the website of a dApp (e.g., www.opensea.io or www.uniswap.org), and the website server will respond with the webpage of the dApp. To generate the webpage, the website server may connect to an NSP to query the data on-chain, where the NSP may further connect to a trusted blockchain node setup by the NSP to obtain the data.
  3. The browser receives the website response and then renders the data to the user. During rendering, the browser may also connect to an NSP to query the data needed to display
  4. When the user wants to submit a transaction during browsing, a confirmation will be promoted by MetaMask. After the confirmation, MetaMask will submit the transaction to an NSP that uses a trusted blockchain node to broadcast the transaction to the blockchain P2P network.

The Problem

When 99% of the users follow the above steps to interact with the blockchain, one critical problem shows up: the dApp servers / NSPs are centralized! This means that the benefits of the decentralized blockchain can be easily broken:

  • The dApp servers / NSPs have all read access information of dApp, which are unavailable to others, i.e., similar to Web2, they could use the data for their own benefits (perhaps analyze and sell them?)!
  • The dApp servers / NSPs can still censor the content of blockchain! E.g., Uniswap delists 100 tokens on their website last year (See https://www.coindesk.com/podcasts/mapping-out-eth-2-0/3-reasons-why-uniswaps-token-delisting-sparked-controversy/). Another recent example is that the author Signal, a privacy IM, wrote a story about his first impression of Web3, where the NFT he created was delisted by OpenSea (and then delisted on MetaMask) although he has no idea which user term he violates!
  • The dApp servers / NSPs may even provide malicious content! Since they are running on centralized servers, they can be hacked and provide wrongful information to users without notice! E.g., recently Klayswap website was hacked by replacing the protocol’s address with the hacker’s address. As the result, the users may unconsciously approve (allow someone to use) their assets to the hacker, who laters stole them!

So one may ask why not the users run their own blockchain nodes and interact with the blockchain in a fully trustless way? As summarized by Moxie, there are a couple of root causes that we may never circumvent:

  • Users or even dApp projects will not run their own blockchain nodes. Maintaining the servers can be costly and time-consuming even for nerds or organizations, and also requires some levels of expertise that most users lack. The node may stop working if it runs out of memory or storage. It can further halt if the node software is not correct or outdated (as each time Ehtereum forks). This results in the popularity of cloud services, wallets, and NSPs
  • The development behind the centralized servers is much faster than developing a decentralized platform. The success key of Web2 companies such as Google / Facebook is to faster iterate the product behind servers, while it takes years to build a smart contract platform (Ethereum) or decentralized storage (IPFS/AR).

The Solution

We expect that as more and more users and developers face the current problems of Web3 (or Web2.5 more precisely?), we need a solution so that we could fully harvest the benefits of blockchain. That is why we believe the future of Web3 should be

End-to-End Fully Trustless Decentralized Web

This means that any components in our Web2 from the user side and server side must be decentralized in Web3.

  • We can still rely on TCP/IP protocol, which is already decentralized and used by the blockchain P2P network.
  • We should not rely on the DNS protocol as it could still censor a translation of a domain. Instead, we could use blockchain-based name services such as ENS.
  • We should not use the current client/webserver model, where the webserver itself is centralized. Instead, we could use a blockchain network where the blockchain P2P network itself can serve as a webserver!
  • We do not want to change current users’ web experience, especially the HTTP protocol. This can be done by designing the blockchain network support HTTP protocol in a decentralized way (decentralized HTTP?)!

Achieving all these seem to be extremely challenging. The following graph illustrates one solution, where

  1. The user installs a verified extension (like downloading geth from github), which serves as a light client to the blockchain P2P network.
  2. When the user types a web3 URL (e.g., web3://xxxxx), the extension will parse the URL and translate it to a blockchain message (e.g., calling a smart contract). Then the extension will deliver the message to the P2P network and query the result. For any result returned from the network, the extension fully verified that the result is trusted.
  3. The trusted result is returned to the web browser. The result will be mostly like an HTML document that may contain more web3 URLs.
Fully Decentralized Web Solution

In the following, let me illustrate several examples of what it looks like from the user’s perspective.

Example 1: Fully decentralized exchange

Suppose a user wants to use a fully decentralized exchange in Web3, the user can do the following steps:

  1. The user types a web3 address: web3://uniswap.eth in a web browser
  2. The light client extension finds the contract address of uniswap.eth in ENS (suppose the result is 0xaabbccddee…)
  3. The light client extension calls the contract 0xaabbccddee… (without parameters)
  4. The EVM in the blockchain network responds with the content of the webpage in “<HTML> … </HTML>” with cryptographic proofs
  5. The light client verifies the result and then displays it on the web browser

Example 2: Fully decentralized social network

Suppose a user receives a link to a tweet, the user can read the tweet as follows.

  1. The user types a web3 address: web3://twitter.eth/view/1125236289743
  2. The light client extension finds the contract address of twitter.eth in ENS (suppose the result is 0x1122334455…)
  3. The light client extension calls the contract 0x1122334455… with MethodID=”view” and Argument=uint256(1125236289743)
  4. The EVM in the blockchain network responds with the content of the webpage in “<HTML> … </HTML>” with cryptographic proofs
  5. The light client verifies the result and then displays it on the web browser.

Teaser / Live Demo

You can now experience the future of Web3 via the following link:

http://testnet.web3q.io/qizhou.w3q

where the website of the link is completed hosted by a blockchain (we call it Web3Q blockchain). Note that to simplify the demo, we use a Web2 website as the “mock” of the extension.

The source code and the contract address can be found here: https://github.com/web3q/evm-large-storage. It is built on top of Web3Q testnet with several dedicated features for the fully-decentralized web

  • supporting binary large-object storage up to 500KB in EVM
  • high-performance consensus based on top of TendermintX — an enhanced Tendermint with greater security
  • very efficient world state DB that supports 1000+ TPS benchmarked with Ethereum mainnet data
  • browser extension friendly P2P network and super-light client design

We will release the testnet information shortly. The testnet bounty will be also released soon!

Future Work

There will be a lot of work to be done to achieve a fully decentralized web3. This ranges blockchain infrastructure, tools, libraries, applications. I name a few of the directions that should be done and need your help!

Tools / Libraries

  • FileSystem contracts that support ls/read/write/remove/subdirectory (we have a simple one with read/write/remove support!)
  • Backend contracts/libraries that help resolve URL and dynamic bytes in solidity more efficiently
  • Synchronizer (w3synce) that could upload a simple website / an NFT project (with real image on-chain!) / gitbook / npm js repo
  • Integration with more name services

Fully Decentralized Applications

  • Name service: ENS, W3NS
  • NFT: ERC721 and image on-chain
  • NFT marketplace
  • DeFi Websites: Uniswap, AAVE, Compound, Curve, ChainLink, etc
  • Personal website
  • Decentralized social network

Wanna join the brave new world of web3? Feel free to contact me at TG: kkk202. Looking forward to seeing you here!

--

--