Web 3.0 and its architecture

Web 3.0 and its architecture

Web3 or Web 3.0 is a newer version of the internet where we are provided with decentralized protocols. Web3 aims to reduce the dependencies on huge centralized companies like Youtube, Amazon, and Netflix.

Before diving into Web3, let us learn about the web and why this latest version was needed.

In the 1990s, web 1 arrived where the internet consist of a bunch of links and homepages. The homepages were static and users can only read data by them.

Later, web 2 came into the picture. This version of the internet can be called the Read-Write phase. Now, using this version of the internet, users were able to read as well as write over the internet. Not only they could consume information from it but also were able to create their own websites and publish them.

Then, social media platforms like Twitter, Facebook gained a huge amount of users' attention. People started investing their time and privacy on the internet. Breaching personal data was considered a huge cost to pay. Even, Facebook was fined $5 Billion in 2019 for the same reason.

This was the reason Web3 took place and grabbed people's attention.

Web 3 is the 'Read-Write-Own' Phase of the internet. Rather than just reading and writing on the internet, now people are able to become participants and shareholders.

How Web2 application works?

Web2 consist of the 3 layers:

  • Database - stores the names of the users and all their data.
  • Backend - defines the logic of the application, if someone hits a button so what's next?
  • Frontend - defines the UI which is how the users see the applications and their functionalities.

What makes Web3 different from it?

Web3 removes the middleman i.e. the centralized database from the picture that stores the application states.

Web3 uses blockchain to build applications on a decentralized network. This network is maintained by thousand of nodes connected to each other in a peer-to-peer manner.

Blockchain is state machines that are instantiated with some initial / genesis state and some very strict rules ( aka consensus ) that define how that state can be transited.

Everyone all together maintains the network, instead of any individual entity.

Backend of Web3

In Web3, we are allowed to write smart contracts which provide the logic to the application and can deploy them on the decentralized blockchain.

Anyone can write and deploy their dApp on the blockchain network.

Terminologies

  1. Blockchain: The Ethereum blockchain is used globally and is managed by nodes in a peer-to-peer manner. State changes are instructed by the consensus rules that are followed by the nodes. Data written on the blockchain is immutable i.e. you can never update the existing data on the network.
  2. Smart Contract: As told earlier, smart contracts provide logic to our dApp. These smart contracts are written in high-level languages like Solidity and Vyper. But these languages are not understood by the EVM.
  3. EVM (Ethereum Virtual Machine): EVM is used to execute the logic written in the smart contracts. But since EVM cannot decode languages like Solidity, thus the smart contract is first compiled into bytecode which is then executed by the EVM.
  4. Frontend: Frontend communicates with the application's logic defined in smart contracts. But it's quite a process which we'll discuss in detail.

Communication of Frontend and the Smart Contract

Understand the fact that every node keeps a copy of all states on the Ethereum blockchain, including all the data and code associated with it.

So, if we wish to interact with the data and code on the blockchain, we need to communicate with one of these nodes. Why only one node can play the role?

Since the nodes are connected in a peer-to-peer manner thus if we write something over one node, it is then transferred to the other nodes with the help of the miner node.

There are 2 approaches to Broadcast a new transition

  • Set up your own node i.e. running your own node
  • Using node provided by third-party services like Alchemy, Infura

Using a third-party provider discards all the headaches included with running own node. Setting up own node will at least takes days to install completely with all the cost included with bandwidth and disk space.

The nodes that you connect with when you need to interact with the blockchain are called Providers.

Every provider (client) implements a JSON-RPC specification.

JSON-RPC is a light-weighted remote procedure call protocol that defines several data structures and rules for processing.

Once you connect to your provider, you can easily read data from the blockchain. But if you are willing to write over the blockchain, there's one more thing you need to do, i.e. sign the transition using your private key.

You need to sign the transition, else the nodes would not accept the transition.

This is where Metamask comes in. Metamask makes it easy for applications to handle key management and transition signing. Metamask stores users' private keys and provides it whenever is required by the frontend.

Storage on Blockchain

Building applications on Ethereum is quite expensive. Users pay every time they add new data to the blockchain.

Asking users to pay extra for your dApp isn't the best option.

One way to deal with it is to use decentralized storage solutions like IPFS.

IPFS is a decentralized file system for storing and accessing data. Because of its peer-to-peer quality, it makes it easy to retrieve information.


Conclusion

Most people spend months figuring out how the tooling chain works, so if you’re a new DApp developer, I hope this article saved you some time. It’s time to get building!

Follow for more.

UV LABS


Harsh Pal

Empowering bharat with design @Kaagaz (YC'22) | 3x SIH Winner | Product Designer | Prev @LaikaAI , @Gharsetu , @Crework

3y

Awesome....finally some worthy content to read 🔥 🔥 🔥

Like
Reply
Prakhar Sharma

Blockchain Developer || 2x SIH Winner🥇|| Freelancer || Mentor

3y

Finally found an article where I got all i wanted to read about this domain. Thankyou 👍

To view or add a comment, sign in

Others also viewed

Explore topics