Web3 - knowledge of basic concepts

Simply talk about web1, web2 and web3:

  • Web1 refers to the non-permissioned open source web with fixed content.
  • Web2 refers to a permissioned network with dynamic content, where all your logic and protocols run on centralized servers that control your information.
  • Web3 is a point of view that refers to the next-generation web based on blockchain and smart contracts. Back to the non-permissioned network, but hosting dynamic content.

The main contents of WEB3 are: blockchain, smart contract, solidity

The blockchain may include value storage and smart contract platforms.
Decentralized applications are usually composed of multiple smart contracts.
Smart contracts allow you to create contracts and logic that do not need to be audited.
Users own the protocol they use, also called owner economy.

blockchain

Bitcoin is the first to use the blockchain.
The Bitcoin white paper describes how Bitcoin conducts P2P transactions in a decentralized network. This network is based on cryptographic algorithms and allows people to use it in a decentralized manner. Unauthorized behavior occurs.

Ethereum

Technology in Bitcoin + Decentralized Contract Smart Contract
Smart contract is to execute a series of instructions in a decentralized way. In the execution of these instructions, no centralization or third-party intermediary is required.

  • The blockchain or Ethereum implements the concept of smart contracts.
  • The biggest difference between Ethereum and Bitcoin is the smart contract

Oracle

Smart contracts can obtain all information that occurs on the blockchain, but if they want to be used as daily contracts, they need external data and external calculations, and these are the functions of oracles.
An oracle is a device that can input data to the blockchain or perform off-chain calculations .

Combining the decentralized logic on the chain with the decentralized data and computing on the chain, this is calledHybrid Smart Contract. Hybrid smart contracts will use chainlink .
Chainlink is a componentized, decentralized oracle network. Chainlink can not only provide external data to smart contracts, but also provide off-chain calculations.
Chainlink allows hybrid smart contracts to be decentralized both on-chain and off-chain. It provides a wealth of functions, allowing smart contracts to be used like daily contracts. Chainlink allows us to obtain data, automatically execute contracts, and random
numbers , to customize your smart contract in any meaningful way.

smart contract

**Smart contracts create a trust-minimized protocol. It's easier to put it this way: smart contracts create promises that cannot be broken. **In addition, it also improves performance, transparency and many other aspects, deploying a contract or a set of instructions on a decentralized blockchain. Once this contract or this set of instructions is deployed, it cannot be changed. It will do it automatically. Everyone can see the contract terms. The understanding at the regeneration level is that these codes will be executed in a decentralized manner.
In smart contracts, web3 and blockchain, contracts can no longer be changed like before. Especially when smart contracts are deployed on a decentralized blockchain. At the same time combined with another decentralized oracle network. Get real-world assets and information. Combining smart contracts with Chainlink's VRF. Get a verifiable random number.

Compared with traditional finance, the advantages of smart contracts

1. Decentralized, and there is no centralized intermediary . A blockchain is run by different participants called node operators. Thousands of node operators run the same software. Running these algorithms and running smart contracts makes the network decentralized.
2. Transparency and flexibility . In these decentralized networks, because all node operators run this software, everyone can see anything that happens on the chain. This means that there is no insider trading, everyone gets the same information, and collaborates under uniform rules, and the blockchain is anonymous. It means that you don't have to bind your identity in real life. Blockchain is also optimized for speed and efficiency. Blockchain also has security and immutable properties. Immutable means that once a smart contract is deployed, it cannot be changed. It is decentralized, and in order to aggregate the blockchain, one must control half of the nodes. On the contrary, in a centralized world, only one needs to be controlled.

Defi stands for Decentralized Finance
DAOs Decentralized Autonomous Organizations
NFTs: NFT stands for Non-Fungible Tokens

gas introduction

Different nodes run the blockchain because they can earn income through transactions on the blockchain. When a transaction is created, there will be a node, or miner and validator, who will be paid a small amount of ether square. Native tokens of Polygon or other blockchains. Obviously, these revenues incentivize people to run nodes. The income is determined by the amount of gas used, and gas is a unit of calculation. To use more computing resources, you need to pay more gas.

Blockchain principles (hashing, blocks, signatures)

The SHA256 hash algorithm,
in the block, divides the data into three parts: block height, Nonce and Data, and inputs the combination of the three parts into the hash algorithm.
Prey points to the hash of the previous block. So changing it will cause the following blocks to be invalid. The blockchain is actually run through the Solidity code, instead of placing random values ​​in the Data area here, the Solidity code defines how different blocks and protocols on the chain interact. The unique hash of this block can be created from these data. Of course, there may be different information for different implementations of the blockchain, but they are all based on these. The blockchain is decentralized or distributed because many different users run the blockchain software. They will check and compare with each other, those are honest nodes and those are malicious nodes. The state of the blockchain is determined by the majority of nodes, and Nonce is the number used to get the hash value

Signing Transactions Signing Transactions

Public key and private key
Through the public key, anyone can verify that this is your signature.
The public key is obtained by using a signature algorithm on the private key. Be sure to keep your private key private, because you will use the private key to sign the transaction . You are the only one who can sign transactions with your private key. However, with your public key, anyone can easily verify it. The transactions you sign are indeed signed by you.
The private key generates the public key, and the public key generates the address.

Gas(2) block reward & EIP559

The more people a chain uses, the more expensive it is to send transactions.
In the blockchain, the space that a block can store transactions is limited. In order for your transaction to be written in a certain block, you need to pay a handling fee, which will vary according to demand

Blockchain conceptual knowledge

Blockchains run on the web. The network is run by multiple independent nodes, and when we use the word node, we mean a single instance in a decentralized network. The network that connects these nodes forms the entire blockchain. Everyone can join the network, which is decentralization.
In the traditional world, apps are operated by a single entity. If this entity becomes expensive, is bribed maliciously, or wants to shut down the website, they can do it because they control everything. In contrast, blockchains do not have this problem. If a node, or a principal running multiple nodes, goes down, nothing happens because there are many others running nodes. As long as there is one node running, the blockchain will continue to run.
In fact, we can regard the blockchain as a decentralized database, and another feature of Ethereum is that it can perform some calculations in a decentralized manner.

Guess you like

Origin blog.csdn.net/weixin_43506403/article/details/127892951