Table of Contents
Internet
Web3.0
Introduction
Start
web3.js
Add web3
##Use
Tools
Build
Conclusion
Home Web Front-end Front-end Q&A Web3.0 is coming, is it front-end friendly?

Web3.0 is coming, is it front-end friendly?

Mar 15, 2023 pm 08:09 PM
front end web3 front-end framework

Recently, the calls for web3.0 are really getting louder and louder, and they are getting more and more crazy. For our front-end, what technology do we need? Is it front-end friendly? The following article will let you talk about it, I hope it will be helpful to you!

Web3.0 is coming, is it front-end friendly?

First let me introduce how web3.0 is derived

Internet

Let’s talk about what the web is. In 1989, a technical team led by Tim Berners-Lee at CERN (European Institute for Particle Physics) submitted a new protocol for the Internet and a document system using the protocol. This system Named World Wide Web, referred to as WWW (World Wide Web), it is what we now know as the "Internet". Its purpose is to enable scientists around the world to use the Internet to exchange their work documents. The technologies it uses are mainly HTML, URI, URL, HTTP, etc., and can display web content in a static way. That is our

Web1.0

Generally speaking, Web1.0 refers to the Internet in the 1990s and early 21st century. To put it bluntly, it is the Internet composed of blogs, message boards, and early portals such as AOL and CompuServe. The well-known websites in China such as Sina, Sohu, and NetEase were products of that time. On Web1.0, static web pages are basically read passively, and web page construction protocols use HTTP, FTP, etc. In the case of Web1.0, web page content is read-only and static, similar to a magazine. It can only be viewed but cannot be modified or interacted with. Under Web1.0, users are only consumers of information (web pages) and cannot interact with them. Web1.0 also uses dial-up Internet access, with an average bandwidth of 50k.

In general, Web1.0 is read-only and decentralized.

Web2.0

And Web2.0 probably became prominent around 2005. The general meaning of Web2.0 is that users can create and publish their own content on web pages, actively participate in the Internet, and no longer simply passively read web pages. The final funds and control of the entire web page are still occupied by the owner of the web page. Social media such as Facebook, Twitter and YouTube are also products of this era. Of course, the proliferation of user-generated content in this way also creates a natural monopoly, which will also lead to several problems: 1. User data is centralized; 2. User data is not portable; 3. User data is sold

In short, Web2.0 is the coexistence of reading and writing

Web3.0

Web3.0 is a decentralized network that integrates power and data centralized into the hands of users rather than exclusive to one company. Distribute data to the network with decentralized blockchain technology. Web3.0 is a term that has been around for years, but has only started to gain popularity in the past year. With Web3, the network is decentralized, so no authority controls it, and decentralized applications (dapps) built on top of the network are open. The open nature of a decentralized network means that no one party can control the data or restrict access. Anyone can build and connect different dapps without permission from a central company.

The main features of Web3.0 include the following:

  • Semantic Web - It is the key to Web3.0 and makes it easy for machines to process data.

  • AI - AI is one of the main key factors affecting the popularity of Web3.0 technology. It enables machines to become smarter through large amounts of web data to meet user needs.

  • 3D graphics - Web3.0 has surpassed the traditional Internet because of its three-dimensional technology, which provides a more realistic three-dimensional online world than 2D.

  • Ubiquity – The concept of being present or everywhere at the same time, the increasing rise of mobile devices has made it easier for many people to access the Internet anytime and anywhere.

  • Openness and interoperability, which refers to openness in terms of application programming interfaces, data formats, protocols and interoperability between devices and platforms.

  • Global data repository, the ability to access information across programs and networks.

In short: Web3.0 is everything about reading, writing, and owning the Internet.

Introduction

For us front-end developers, what technologies should we master or what should we know? Simply put, web3 developers create decentralized full-stack applications that live on and interact with the blockchain. Let’s talk about it briefly below.

Let’s first understand what the professional terms are:

  • Web3: It is the connection between the Ethereum blockchain and your smart contracts Smart Contracts.
  • Ethereum Ethereum: A decentralized open source blockchain blockchain that allows users to interact with the network by creating smart contracts. Its native cryptocurrency is Ethereum. Ethereum is the second most valuable cryptocurrency in terms of market capitalization after Bitcoin. It was created in 2013 by Vitalik Buterin.
  • Smart Contracts Smart Contracts: They are computer programs stored on the blockchain that run when predetermined conditions are met. Smart contracts are written in Solidity language.
  • Decentralized: Data status is not collected by a central entity, platform platform or individual individual
  • Blockchain: A blockchain network is a point-to-point connection in which information is stored in multiple Shared between devices, almost impossible to hack. It is a system of recording information in a way that makes it difficult or impossible to change the information saved on the network.
  • Solidity: An object-oriented programming language for writing smart contracts. It is used to implement smart contracts on various blockchain platforms, most notably Ethereum. Solidity's syntax is similar to javascript. To understand Solidity, it is best to have a background in a programming language such as javascript. Jumping directly into Solidity is a bad idea
  • Dapp: stands for Decentralized App. They are applications that run their backend code (smart contracts primarily written in Solidity) on a decentralized network or blockchain. Dapps can be built using front-end frameworks such as react, vue, or Angular.
  • Bitcoin Bitcoin: The world’s first widely used cryptocurrency.
  • Crypto: Also known as Cryptocurrency, cryptocurrency, a decentralized digital currency.
  • NFT: Non-Fungible Token, a digital asset with ownership recorded on the chain.
  • DAO: Decentralized Autonomous Organization, decentralized autonomous organization.
  • Metaverse: a concept of a virtual world created by technological means.
  • DeFi Decentralized Finance: Decentralized financial system.
  • Token Token: It can be understood as the collective name for digital assets such as cryptocurrency and NFT.
  • GameFi: Game DeFi, Chinese version of blockchain game, the financial system in the game can be mapped to reality through cryptocurrencies and NFTs.

After introducing the above, let’s talk about the classification of blockchain for developers. Mainly core blockchain development (core blockchain engineers are responsible for the architecture and security protocols of the blockchain system) and blockchain software development (these blockchain developers create Dapps using the design architecture provided by core blockchain developers ).

Start

Let’s get down to something practical. For our front-end development, we want to develop decentralized applications that reside and interact with the blockchain. You must use the web3.js and Ethers.js libraries.

web3.js

web3.js is a JavaScript API library. To make a DApp run on Ethereum, we can use the web3 objects provided by the web3.js library. web3.js communicates with local nodes through RPC calls, and it can be used with any Ethereum node that exposes the RPC layer. web3 contains the eth object - web3.eth (specifically for interacting with the Ethereum blockchain) and the shh object - web3.shh (for interacting with Whisper)

Add web3

Introducing web3 into your project is basically the same as our existing reference method

  • npm: npm install web3
  • bower: bower install web3
  • metor: meteor add ethereum:web3
  • vanilla: dist./web3.min.js

##Use

Then you need to create an instance of web3 and set up a provider. In order to ensure that you do not overwrite an existing provider, such as one built-in when using Mist, you need to first check whether the web3 instance already exists

if (!web3) {
  web3 = new Web3(web3.currentProvider);
} else {
  web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}
Copy after login

Since this API is designed to interact with local RPC nodes, all The function uses synchronous HTTP requests by default. If you want to make an asynchronous request. Most functions allow passing an optional callback function following the parameter list to support asynchronous

web3.eth.getBlock(48, function(error, result){
  if(!error)
      console.log(result)
  else
      console.error(error);
})
Copy after login

The specific directory of the API can be

clicked to view

Ethers .js

Provides a small but complete JavaScript API library for the Ethereum blockchain and its ecosystem. It was originally used with ethers.io and has now been expanded into a more general library. The function is basically similar to web3.js.

Features are as follows:

  • Keep the private key on the client, safe and trustworthy
  • Supports imported and exported JSON wallet files (Geth, Parity and crowdsale)
  • Create from any contract ABI JavaScript metaclass objects, including ABIv2 and human-readable ABI
  • support connecting to Ethereum nodes via JSON-RPC, INFURA, Etherscan or MetaMask.
  • The library is very small (compressed ~88kb; uncompressed 284kb)

Tools

Of course, in addition to the above, we will also use it Many tools to improve our development

  • Truffle: Provides a development environment for compiling and testing smart contracts using the Ethereum Virtual Machine, used as build dependencies in the project
  • Remix IDE: The perfect environment for writing and using smart contracts, we can use it to create, modify and execute smart contracts directly from the browser. It's more like an editor
  • MetaMask: A Chrome extension that allows you to connect to the Ethereum blockchain network from your browser
  • Ganache: Provides a local blockchain environment To test your smart contract

Build

We want to build a full stackDapp If you want to add a user interface to your project, react.js, vue.js or angular.js are good javascript front-end frameworks as they can be easily integrated with blockchain networks using ethers.js or web3.js. There are various platforms that allow you to create complete Dapps without writing code such as: Bunz, Dapp builder, Atra io, Bubble io

Conclusion

In general, Web3.0 is not a technology, but a concept. We front-end developers don’t need to panic. No matter how the technology develops, we will always use the front-end. We can use our react.js, vue.js or angular.js to build our own platform for our own developed Dapp applications, or we can use nodejs to complete it by using web3.js, the toolkit provided by Ethereum. The entire process of contract compilation, release, and contract method invocation.

(Learning video sharing: Web front-end introduction, Basic programming video)

The above is the detailed content of Web3.0 is coming, is it front-end friendly?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP and Vue: a perfect pairing of front-end development tools PHP and Vue: a perfect pairing of front-end development tools Mar 16, 2024 pm 12:09 PM

PHP and Vue: a perfect pairing of front-end development tools. In today's era of rapid development of the Internet, front-end development has become increasingly important. As users have higher and higher requirements for the experience of websites and applications, front-end developers need to use more efficient and flexible tools to create responsive and interactive interfaces. As two important technologies in the field of front-end development, PHP and Vue.js can be regarded as perfect tools when paired together. This article will explore the combination of PHP and Vue, as well as detailed code examples to help readers better understand and apply these two

What does WEB3 mean? What does WEB3 mean? Mar 12, 2024 pm 02:18 PM

Web3.0 refers to the third generation of the Internet, the protocol Internet. The core is: user creation, user ownership, user control, and agreement distribution of benefits. It uses the technology of blockchain protocol creation and automatic execution, that is, rights and value through smart contracts. The distribution agreement can be executed efficiently, accurately, and reliably without using a third party, and the entire process can be audited.

Questions frequently asked by front-end interviewers Questions frequently asked by front-end interviewers Mar 19, 2024 pm 02:24 PM

In front-end development interviews, common questions cover a wide range of topics, including HTML/CSS basics, JavaScript basics, frameworks and libraries, project experience, algorithms and data structures, performance optimization, cross-domain requests, front-end engineering, design patterns, and new technologies and trends. . Interviewer questions are designed to assess the candidate's technical skills, project experience, and understanding of industry trends. Therefore, candidates should be fully prepared in these areas to demonstrate their abilities and expertise.

Is Django front-end or back-end? check it out! Is Django front-end or back-end? check it out! Jan 19, 2024 am 08:37 AM

Django is a web application framework written in Python that emphasizes rapid development and clean methods. Although Django is a web framework, to answer the question whether Django is a front-end or a back-end, you need to have a deep understanding of the concepts of front-end and back-end. The front end refers to the interface that users directly interact with, and the back end refers to server-side programs. They interact with data through the HTTP protocol. When the front-end and back-end are separated, the front-end and back-end programs can be developed independently to implement business logic and interactive effects respectively, and data exchange.

Exploring Go language front-end technology: a new vision for front-end development Exploring Go language front-end technology: a new vision for front-end development Mar 28, 2024 pm 01:06 PM

As a fast and efficient programming language, Go language is widely popular in the field of back-end development. However, few people associate Go language with front-end development. In fact, using Go language for front-end development can not only improve efficiency, but also bring new horizons to developers. This article will explore the possibility of using the Go language for front-end development and provide specific code examples to help readers better understand this area. In traditional front-end development, JavaScript, HTML, and CSS are often used to build user interfaces

Django: A magical framework that can handle both front-end and back-end development! Django: A magical framework that can handle both front-end and back-end development! Jan 19, 2024 am 08:52 AM

Django: A magical framework that can handle both front-end and back-end development! Django is an efficient and scalable web application framework. It is able to support multiple web development models, including MVC and MTV, and can easily develop high-quality web applications. Django not only supports back-end development, but can also quickly build front-end interfaces and achieve flexible view display through template language. Django combines front-end development and back-end development into a seamless integration, so developers don’t have to specialize in learning

Combination of Golang and front-end technology: explore how Golang plays a role in the front-end field Combination of Golang and front-end technology: explore how Golang plays a role in the front-end field Mar 19, 2024 pm 06:15 PM

Combination of Golang and front-end technology: To explore how Golang plays a role in the front-end field, specific code examples are needed. With the rapid development of the Internet and mobile applications, front-end technology has become increasingly important. In this field, Golang, as a powerful back-end programming language, can also play an important role. This article will explore how Golang is combined with front-end technology and demonstrate its potential in the front-end field through specific code examples. The role of Golang in the front-end field is as an efficient, concise and easy-to-learn

What is a front-end modular ESM? What is a front-end modular ESM? Feb 25, 2024 am 11:48 AM

What is front-end ESM? Specific code examples are required. In front-end development, ESM refers to ECMAScriptModules, a modular development method based on the ECMAScript specification. ESM brings many benefits, such as better code organization, isolation between modules, and reusability. This article will introduce the basic concepts and usage of ESM and provide some specific code examples. The basic concept of ESM In ESM, we can divide the code into multiple modules, and each module exposes some interfaces for other modules to

See all articles