web3 describes the operational relationship between Ethereum and the blockchain

Fortunately, through the previous two articles,
the concept of Web3.0
, web3 will take you to simply establish the concept of blockchain.
Everyone begins to understand that web3.0 is developed based on blockchain.

We talked about the blockchain and mentioned the Ethereum EVM many times, so what exactly is this thing?
As far as the current situation is concerned, it is too difficult to build a blockchain environment from zero to one

Therefore, Ethereum was indeed a cryptocurrency at the beginning
, and its current market value is the second highest cryptocurrency after Ethereum,
insert image description here
but at the same time, Ethereum is also a public blockchain platform.
We can base it on Ethereum. A platform for the blockchain to develop a smart contract for us

So you can think that Ethereum is a cryptocurrency, but at the same time it is a blockchain application platform. We can directly deploy applications on it without building other things. It has already built
a decentralized computer platform. We only need Just deploy the application on it


You can imagine that in the future, we will have no fraudulent process clearly visible, no complicated account operations, we only need an electronic ID card , and 10,000 applications can be operated through one identity
insert image description here
. A dapp of ours is deployed
, then each corresponding blockchain node will have a copy of our Dapp

So in the future, any dapp connected to our Ethereum
and all transaction records will also be recorded and backed up,
so all our business logic and transaction records are open and transparent

Not everyone can arbitrarily record transactions in Ethereum. The program requires a certain fee

For example, if A wants to transfer 10 yuan to B, then the computer will come up with a difficult problem. The person who solves this problem will become absenteeism. He needs to be rewarded for solving the problem. The cost of this resume will be borne by the transaction initiator, which means that A may have to pay 10.1 ETH
10 The remaining 0.1 in the hands of one party is the remuneration for absenteeism.
insert image description here
Simply put, Ethereum is a public blockchain platform. We can deploy our smart contract applications,
but whether it is deploying applications or transferring money to others, it requires (fuel) equivalent Tip
Mainly because the transaction records will be stored in the blockchain forever.
If everyone can save it, there will be problems. Some illegal and meaningless records will be uploaded.
In order to increase the difficulty of uploading
, the computer will generate a random The code random code calculates an extremely long information secret key through a hash function or hash algorithm.
At this time, absenteeism needs to use a super-capable computer to calculate the secret key for comparison, because this information cannot be reversed, so it can only continue to generate and guess. To compare,
if it is the same or very close, you will guess right
, then this transaction record will be recorded on the blockchain through the calculated absenteeism, so the absenteeism will get fuel, which is a tip, and
the fuel is borne by the initiator

So we must simulate this process locally. Otherwise, if your program has bugs all the time, you will have to send money all the time and it will be consumed all the time.
You can simulate it locally and give yourself tens of millions of Bitcoins to operate.

You can check how much one ether is, but this is actually not easy to operate,
insert image description here
so our program is not java, etc., but a smart contract program.
Smart contracts are not a word born of a star. Before Alipay, credit cards, etc., automatic repayments were used. This concept
, but if it is combined in this blockchain, it will establish an irreversible contract

It can only be added and it will be permanently reserved to prevent evil. A little evil record operation will be preserved.
Writing smart contracts is written in Solidity language

Here we look at a piece of code, we
insert image description here
can see that the declaration of the variable function is relatively close to JavaScript, but not exactly the same,
but it is faster for the front end to know js

In web3, there are many directly encapsulated functions that can directly write and read data to Ethereum

Guess you like

Origin blog.csdn.net/weixin_45966674/article/details/131240132