How to Use Web3.js to Interact With the Ethereum Virtual Machine in Remix
Walking through the evolution of Web 1.0, Web 2.0, Web 3.0, Web3, and working with web3.js. Is JavaScript ready for blockchain?

Web 1.0
The term, Web 1.0, was coined by Tim Berners-Lee in 1989. It is treated as the first generation of the World Wide Web, which exists from the time period of 1991 — 2004.
During this time period, most websites were static web pages, and the vast majority of users were consumers, not producers, of content. Pages were built with Server Side Includes or Common Gateway Interface (CGI). Frames and tables were used to position and align the elements on a page.
Web 2.0
The term, Web 2.0, was coined by Darcy DiNucci in 1999, and later popularized by Tim O’Reilly and Dale Dougherty at the first O’Reilly Media Web 2.0 Conference in October 2004.
Web 2.0 refers to the worldwide websites that highlight user-generated content, usability, and interoperability for end users. It centers on user-created content uploaded to forums, social media and networking services, blogs, and wikis. Web 2.0 starts from 2004, and continues to the current day. The web browser technologies are widely adopted, which includes AJAX and JavaScript frameworks. Data is typically formatted in XML or JSON.
Web 3.0
In 2006, the semantic web was described as a component of Web 3.0. The term was coined by Tim Berners-Lee. It is an efficient way to represent data on the web, or as a database that is globally linked to the content of documents on the Web, in a manner understandable by machines.
Web3
Web3, also known as Web 3.0, or web3, commonly refers to a new iteration of the World Wide Web that is based on blockchain technology, which covers the shared ledger systems used by cryptocurrencies like Bitcoin and Ethereum.
The term, Web3, was coined by Polkadot founder and Ethereum co-founder Gavin Wood in 2014. It is a new internet service that incorporates concepts such as decentralization and token-based economics. The idea gained interest in 2021 from cryptocurrency enthusiasts, large technology companies, and venture capital firms.
Chris Dixon defined that Web3 is the internet owned by the builders and users, orchestrated with tokens.
Web 1.0 and Web 2.0 are built on top of centralized-platforms. Web3 enables peer-to-peer transfer of digital assets without any intermediaries, and is predicted to be just as impactful as the Internet.
Blockchain
A blockchain is a public database that is updated and shared across many computers in a network. Block refers to data and state being stored in consecutive groups. Chain refers to the fact that each block cryptographically references its parent. i.e. blocks get chained together.
In the Ethereum universe, there is a single, canonical computer (i.e. Ethereum Virtual Machine, or EVM), whose state is agreed by everyone on the Ethereum network. Mainnet is the primary public Ethereum production blockchain.
Nodes are the real-life machines that are storing the EVM state. They ensure that everyone interacting with the blockchain has the same data. To accomplish this distributed agreement, blockchains need a consensus mechanism.
Anyone who wants to add a new block to the chain must solve a difficult puzzle that requires a lot of computing power, which is known as mining. Mining is typically brute force trial and error, but successfully adding a block is rewarded in ETH, the native cryptocurrency of Ethereum.
Smart contract is a program that is published into the EVM state, and executed by the network users with a fee paid to the network. Smart contracts are apps and services, such as marketplaces, financial instruments, games, etc. They are often called Decentralized Apps (dapps).
A dapp has its backend code running on a decentralized peer-to-peer network. It can have frontend code/user interfaces written in any language to make calls to the backend.

Infura
Infura provides the tools and infrastructure that allow developers to easily take their blockchain apps from testing to scaled deployment. Its EVM equivalence is now live on the optimistic Ethereum mainnet.

Infura offers free access to the Ethereum APIs and allows up to 3 projects. We create our first project with Ethereum, among the choices of Ethereum, ETH2, IPFS, and Filecoin.

Name the project, jennifer-web3.

After the submission, we get the project ID. Based on the project ID, we have two endpoints for mainnet, one for HTTPS (Hypertext Transfer Protocol Secure) and one for WSS (WebSocket Secure). The two addresses are named in the format of <network>.infura.io/v3/<PROJECT-ID>.

Infura is a service provider for building decentralized applications. It does not require syncing, which usually takes long time for a decentralized peer-to-peer network. The Ethereum node setup is also simple. Therefore, it is a great infrastructure recommended for developing dapps.
web3.js
web3.js is a collection of JavaScript libraries to interact with a local or remote Ethereum node using HTTP, IPC or WebSocket. It is developed and maintained by the Ethereum Foundation, and it serves well for the dapp backend.

Remix is a full-stack React framework that has the frontend user interface, along with the backend server. We have written an article on how Remix works and how the client/server folders and files are structured. Here, we use Remix as working environment to explore web3.js.
Create a Remix project:
% npx create-remix my-remix-app
% cd my-remix-appSet up web3, along with two JSON packages:
npm i web3 json-stringify-safe react-json-prettyThese packages become part of dependencies in package.json:


