Chapter 8. What Is Web3?

Web3 is a collection of JS libraries that lets you interact with an Ethereum node remotely or locally. Simply, it provides us with an API to use so we can easily work with the blockchain. Web3 works as a wrapper for JSON RPC to connect to a remote or local Ethereum node with either a HTTP or IPC connection. Web3 is basically a connection between the Ethereum blockchain and your smart contract.

Behind the scenes, Web3 uses JSON RPC. RPC is used in many different types of programming languages. You can learn more about JSON RPC here. This chapter focuses on Web3 because Web3 makes connecting to an Ethereum node less complicated and much easier to understand than RPC.

The Frontend, Web3, and the Blockchain

In a traditional web 2.0 application, your user will interact with the frontend of an application such as React or Ember to make a request to the backend that will have databases, APIs, and models, which will then return a response from the backend. The frontend will serve up the data from the backend to the frontend, and the frontend will display it to your user.

The flow of a web 2.0 application is illustrated in Figure 8-1.

Connection between Traditional Frontend and Backend
Figure 8-1. Connection between a traditional frontend and backend

If you have experience in traditional web development, Web3 is similar to an API request that is getting or adding data to the backend. But with Web3, you’ll be reading ...

Get Hands-On Smart Contract Development with Solidity and Ethereum now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.