Analysis: Do you really understand blockchain and Ethereum smart contracts?

If you mention blockchain and Ethereum smart contracts, I believe everyone will be very happy to say that I have heard of them! But do you really understand its origin and operating principle? Today, the editor will answer for everyone.

Block chain, Bitcoin , Ethernet Square, intelligent contractual relationship between these four are:

It is recognized that blockchain was born after the release of Bitcoin White Paper, that is, most of the ideas in blockchain technology are derived from Bitcoin.

So Bitcoin technology is the beginning of blockchain technology, and the true identity of Satoshi Nakamoto , who designed this amazing developer, is still a mystery.

In the early stage of the development of blockchain technology, there were only a few currencies in blockchain technology and basically only one attribute—virtual currency. This greatly limits the development of blockchain technology.

The emergence of Ethereum has brought smart contracts. Since smart contracts, people have the tools to create on the blockchain, and they can develop their own Dapp, develop games, develop DeFi, and so on.

Therefore, Ethereum is a product of the further development of blockchain technology, and smart contracts are an advanced tool that enables people to create a convenient and fast creation in the blockchain world for the first time.

Let’s take another look at how the blockchain works. The modern blockchain came from Bitcoin, so if you understand the basic principles of Bitcoin, you can get a glimpse of the basic principles of the blockchain.

As early as 2008, a person who claimed to be Satoshi Nakamoto published the article “bitcoin: a peer-to-peer electronic cash system” on the Internet, which marked the official birth of Bit.

The original intention of Bitcoin design and the problem it solves is to solve the trust problem between people through a series of means such as asymmetric encryption, hash function, and signature in a mutually distrustful and anonymous network environment.

The existing blockchain platforms can be divided into three types of platforms according to different access standards:

Public chain: that is, anyone can join this blockchain without any restrictions and get all the data in it.

Consortium chain: limited opening for certain groups, and all permissions are different after joining, there are special accounting nodes and ordinary nodes inside.

Private chain: The local blockchain of an individual or minority group.

Among the representatives in the public chain, Bitcoin and Ethereum are the most widely used.

We use a process of Bitcoin transactions to explain the operating principle of the blockchain as shown in the figure.

Analysis: Do you really understand blockchain and Ethereum smart contracts?

 How Bitcoin Works

When A who is on the Bitcoin network sends a transaction request, he will broadcast it to the entire network, allowing computers or mining machines around the world to compete for the accounting rights of the transaction, that is, a new block is formed Of course, there is often more than one transaction in a block.

So how are transactions packaged and accounted for and recorded in new blocks? Before that, we must first understand what parts a block consists of.

As shown in Figure 2, a block is mainly composed of a block header and a transaction list.

Analysis: Do you really understand blockchain and Ethereum smart contracts?

The composition of the block

First, A will report to the entire network that there is a block that needs to be packaged. At this time, the transaction information and data are repackaged through a specific algorithm (SHA256) and an important hash value-the hash value of the Merkle tree root is obtained. .

Regarding the Merkle tree root hash value, it can be used to verify that transaction information and data has not been tampered with, and is an important parameter in the block.

Any two transaction information or data components can be expressed as a hash value. At this time, we regard these two hash values ​​as two leaves on a tree.

The connected part of the two leaves is called the leaf root. At this time, the leaf root can also be expressed as a hash value. This hash value is obviously determined by the hash value of the information and data of the two transactions, and the Merkle tree root It is visually understood that multiple transactions form a hash value in pairs, with many leaves like a tree.

However, there is only one tree root, that is, the hash value of transaction information and data corresponds to the leaf, and the hash value of the Merkle tree root corresponds to the root of the tree.

And the hash value of the Merkle tree root has another feature: any transaction information and data changes will cause a huge change in the Merkle tree root hash value, as long as there is a leaf, that is, a transaction information and data are tampered with, then the Merkle tree root The hash value is bound to change.

So after a series of packaging and packaging, the transaction information has been packaged into blocks, waiting to be recorded in a new block of the blockchain.

At this time, for the miners, grabbing the bookkeeping rights to obtain the block reward for the first packaged block on the chain is the main incentive for them.

Analysis: Do you really understand blockchain and Ethereum smart contracts?

Because the first transaction information in the block is this address or node, because the first to find a random number, the system gives it a certain amount of Bitcoin, which is the reward you get after packing the block, which is what we commonly call Mining .

The Bitcoin network determines who has the right to keep accounts by letting all the miners participate in the calculation of a random number, as shown in the figure.

Analysis: Do you really understand blockchain and Ethereum smart contracts?

Random number calculation

That is, the miner needs to find a random number nonce to combine it with the Merkle hash value and other necessary block information to perform a hash calculation to obtain a hash value that meets the difficulty requirements.

Because the SHA256 algorithm is non-linear, only the exhaustive method is used, that is, the random number is continuously selected for calculation until the calculated hash value meets the difficulty requirement.

And whoever first calculates a random number nonce and is verified by other miners, who has the right to bookkeeping and can get block rewards, which requires huge computing power, which is what we often call proof of work.

Alchemy researcher summary

The simple working principle of blockchain technology is to use distributed ledger, asymmetric encryption, SHA256 and other cryptographic technologies to package and reorganize various information and transactions that exist in reality.

Through proof methods such as POW or POS, the miner or bookkeeper can record the information on the only blockchain, so that the information has a consensus mechanism that cannot be tampered with and has the entire network, that is, all participants believe that the transaction is true Trustworthy and cannot be tampered with.

Therefore, blockchain technology is also called a decentralized technological revolution, because there is no need for any authoritative organization or individual on the blockchain, everything is determined and confirmed by consensus or proof.

Posted by:CoinYuppie,Reprinted with attribution to:https://coinyuppie.com/analysis-do-you-really-understand-blockchain-and-ethereum-smart-contracts/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Leave a Reply