Original title: " Web 3.0 architecture is not only decentralized, but also modular "
Original author: Xiang, W3.Hitchhiker
Web2.0 application Take the decentralized trading platform Binance as an example, Binance allows users to go to Trade various Tokens.
Binance is a Web 2.0 application, and the architecture sounds simple, but in reality it required a lot of work to develop.
The user needs to connect the device to the network through the network operator, then open the browser and enter Binance domain name, accessed through the http protocol Binance website.
Binance requires users to register and log in to the platform via mobile phone or email.
Then Binance I need a place to store basic data such as user registration information, transaction quota, transaction history, pending orders, etc. And these all need to build a database for storage, and it needs to be constantly updated.
Secondly, the back-end code language (like Node.js, Java, or Go) determines all the business logic of Binance. A logic is needed to build the server to deploy the backend and run the backend. For example, what happens when a new user registers, trades, or places a pending order?
Also, front-end code languages (JavaScript, HTML, and CSS ) determine Binance’s UI logic. An interactive logic is needed to build the server and deploy it to the front end to run the front end. For example, what does the website look like? What happens when the user interacts with each keystroke on the page?
When you write a transaction on Binance, all these things will be integrated and linked. You interact with its front end, the front end interacts with the back end, and the back end interacts with its database. All of these codes are hosted on a centralized server and fed back to users through an Internet browser, and all control of the centralized server is in the hands of Binance.
This is a simple summary of how most Web 2.0 applications work today, although the reality is more complex.
Web 3.0 applications take Uniswap as an example, Uniswap is going to The central trading platform allows free addition and trading of various Token .
Uniswap is a Web 3.0 application. The architecture sounds complicated, but the actual development and implementation is very simple.
First of all, users need to connect to the Internet through devices, and they need to go through network service providers, such as telecommunications and mobile. (Decentralized network service provider, Internet of Things: Helium)
Then, users access programs through browsers or operating systems (decentralized browsers or operating system: Brave)
The user access program needs to interact with the server through the browser, and this operation needs to be supported by the protocol (traditionally http, new It can be replaced by IPFS , through content addressing)
Uniswap requires users to log in through private keys and wallets (similar to plug-ins, wallets, etc.: Metamask, Tokenpocket , Math, Brave wallet), and a unified DID is also a direction in the future (similar to ENS, etc.)
The wallet needs to connect to the node of the blockchain, then it will It needs to be provided by the server of the node, which also needs the node corresponding to the blockchain, or by a professional node service provider such as Infura/Alchemy . (Decentralized node service providers are also a trend: Pocket)
What does the Uniswap website look like when users interact with each button on the page what happens? It is also front-end code languages such as JavaScript, HTML, and CSS that implement Uniswap’s UI logic.
But Web3 does not need to build its own server to deploy and run the interactive logic of the front end. These front-end data can be stored in a decentralized storage network. (Such as Filcoin, SWARM, AR , etc.)
The following is the official IPFS link of Uniswap. This solution does not need to build a front-end server, and users can also use it normally use.
ipfs://bafybeiagkgmmhux6fswdoedmwqqsvt5arjivl35wuk25jljb2yqgn7njgu/#/swap
The above link, you can see that it starts with ipfs://, so you need a browser that supports parsing ipfs to open it (Brave, Opera)
p>
And the link is not human-readable, so domain name service is needed to map the corresponding domain name to the link, such as uniswap.eth. (Decentralized domain name services: IPNS, ENS, etc.)
Of course, IPFS only supports Http-compatible gateways for access.

p>
When the website traffic is high, a more flexible bandwidth market is needed——CDN accelerated network. (CDN service, IPFS, Filecoin search market)
Uniswap is implemented through the blockchain smart contract language solidity, which determines all the business logic of Uniswap. Because it runs in the EVM environment, Uni does not need to build its own server to deploy back-end business logic (blockchains that support smart contracts, ETH, etc.).
However, what the trading platform needs to display is not only the business logic, but also the historical price curve of the currency price, the transaction amount, etc. These historical data cannot be obtained through smart contracts. Assuming that the project party needs to display, it still needs to build a server by itself, run a node, and filter out the data on the chain and save it to Uni’s own database. So Web3 needs a chain data index solution. (Chain data indexing platform Graph )
The Graph provides a chain data indexing solution, which can facilitate users to query data. In The Graph, you can define which smart contracts need to be indexed, which events and function calls need to be monitored, including the status when called and generated, and you can also specify how to convert incoming events into front-end logic that can be processed.
The data on the chain will be saved by a dedicated Graph index mining node, which will provide an API for the user to call on the page, and the project party does not need to build Server, only index nodes need to build servers to run index data mining nodes.
By indexing blockchain data, The Graph allows us to query on-chain data in application logic with almost no delay.
For example, the presentation of Uniswap transaction information is generated through The Graph.

p>
If Uniswap wants to present more and present the currency price data under the chain on the chain, then it is necessary to open up a bridge of data on the chain under the chain (decentralized Oracle: chainlink).
According to the above development logic, Uniswap is equivalent to releasing a Web 3.0 application, but the actual implementation cost is lower than the development Binance The cost of the trading platform is very low, because:
Uniswap does not require users to bind emails, bind mobile phones, and can log in directly through the wallet, and Uni itself does not need Saving Uniswap does not require building a front-end server, and users can access it through IPFS or AR storage front-end pages without building a back-end server. The back-end logic is to run on the smart contract without building a database. Historical data and database operations are realized through TheGraph
Professional people do professional things, Uniswap Just do a good job and design your own logic, and other logics are supported by the modular Web3 infrastructure.
In this way, Uniswap not only realizes complete decentralization, but also a simple application case of Web3 modularization.
The core of Web3 is to be able to de-trust interactive value, modular development can not only achieve de-trust, but also improve the efficiency of operation, modular Trends apply to all walks of life.
What I said above is that the modularization of the Web3 network architecture has improved the efficiency of Web3's production force, so how to improve the efficiency of Web3's production relationship (Web2's production relationship Mainly based on companies, the generation relationship of Web3 is DAO, and the modularization of DAO is also a future trend). DAO relies on the blockchain, and the blockchain itself is moving towards modularization, the same is true for metaverse, games, and so on.
The arrival of the modular era will bring higher efficiency and better service, W3Hitchhiker will continue to follow up the modularization of crypto.
Original Link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia