为广大币圈朋友提供币圈基础入门专业知识!
当前位置首页 > 区块链知识> 正文

学习区块链入门

发布时间:2023-12-06-01:41:00 来源:网络 区块链知识 区块   入门

学习区块链入门

近年来,区块链技术在金融、分布式计算等领域发挥着重要作用,在众多行业中产生了深远影响。作为一种新兴技术,区块链正在以惊人的速度发展,它的应用范围也在不断扩大。那么,想要学习区块链,如何入门呢?本文将为您介绍如何学习区块链入门。

首先,要学习区块链,必须先了解区块链的基本概念。区块链是一种分布式数据库,它使用密码学技术来确保数据的安全性和完整性。区块链的主要特点是去中心化、不可篡改、透明和安全。

其次,学习区块链的最佳方式是通过实践。可以利用区块链技术开发的开源项目,比如比特币、以太坊等,了解区块链的应用。另外,还可以参加一些区块链技术的培训课程,学习区块链的基础知识和实际应用。

最后,要想学习区块链,还需要一定的编程能力。区块链技术是一种复杂的技术,需要掌握一些编程语言,比如C++、Java、Python等,才能更好地理解和应用区块链技术。

总之,学习区块链入门需要了解区块链的基本概念,通过实践和培训学习,并具备一定的编程能力。只有掌握了这些知识,才能更好地理解和应用区块链技术,为社会发展做出更大的贡献。


请查看相关英文文档

① How to get started with blockchain. This knowledge is not difficult to learn.

1. To learn blockchain knowledge, first learn the necessary concepts of blockchain knowledge.

2. [Blockchain]

The English name blockchain is the underlying technology of Bitcoin and a decentralized accounting method.

3. [Block and Chain]

Block refers to the information block that records transaction information. Each block contains three main factors: The ID of the block, the odd number of the transaction, and the ID of the previous block.

The Bitcoin system generates a block approximately every 10 minutes. Each block contains the ID of the previous block, making the blocks form a complete transaction chain. The longest one is The only master blockchain.

4. [Bitcoin]

Bitcoin is a practical application of blockchain technology. It is a peer-to-peer electronic cash payment system. It was first used as Virtual currency exists. Japan has recognized the legality of Bitcoin and can use Bitcoin for shopping.

5. [Satoshi Nakamoto]

The legendary founder of Bitcoin published a paper on a peer-to-peer electronic cash system in 2008, marking the The birth of Bitcoin.

6. [Digital Currency]

It is completely different from the Q coins and other virtual currencies we use to play games in real life. For example, in Japan, although Bitcoin is a digital currency , but it can already be used to purchase goods in real scenarios.

7. [PoW]

A type of consensus mechanism, also known as proof of work. Bitcoin currently uses this consensus mechanism. It is relatively simple and easy to reach consensus, but consumes huge amounts of energy and is prone to bifurcation.

8. [PoS]

A type of consensus mechanism, also known as proof of equity. People with greater equity have a greater probability of becoming bookkeepers, but bookkeeping Human ones are not necessarily professional, don’t consume much energy, and are prone to split ends.

9. [DpoS]

On the basis of PoS, the bookkeepers are changed from unprofessional to professionals, like the EOS we are familiar with. In this consensus method, holders jointly select 21 nodes and 100 reserve nodes to connect the EOS constitution to reach a consensus, and jointly incubate the ecology on EOS.

10. [Public key and private key]

In the world of blockchain, the public key is equivalent to the bank account number and the private key.It is equivalent to bank account number + withdrawal password. The private key is essentially an array of 32 bytes. The private key can generate the public key and address, but this behavior is irreversible, so it is crucial to keep the private key. Losing the private key is equivalent to losing money. And it can never be found back.

11. [Hash value]

It can be simply thought of as a set of data that is closely arranged together. No item in the data can be changed, otherwise The calculated consequences will be very different.

12. [Smart Contract]

It is a promise in digital form. Both parties involved can execute these promised agreements on the consumer network without artificial restrictions. .

13. [Credit Consensus]

Based on the characteristics of blockchain, it is a distributed accounting method that cannot be tampered with and is irreversible. A mechanism of trust that allows many people to form a trust based on digital algorithms.

14. [Public chain and private chain]

Public chain refers to a blockchain that can be participated in by people around the world and can be read, and is open to everyone , while the private chain is only in the hands of an organization and is only open to individuals or entities.

Blockchain is currently a hot topic. Many traditional large enterprises and venture capital are actively participating in the layout and investment of the blockchain industry. As the general public, we must master the necessary blockchain knowledge. , helps us judge and analyze real-world information and protect our investments.

② Getting started with blockchain technology, which programming languages ​​are involved

Go language

Go language (Golang) is a brand-new programming language launched by Google in 2009 Language that can reduce the complexity of code without sacrificing application performance. Rob Pike, chief software engineer at Google, said: "We developed Go because the difficulty of software development over the past 10 years or so has been frustrating."

In addition to Bitcoin being developed in C, At present, the clients of most mainstream workshops are developed with Go language, which is enough to show the status of Go language in the entire blockchain industry.

C

C further expands and improves the C language and is an object-oriented programming language. C runs on a variety of platforms, such as Windows, MAC operating systems, and various versions of UNIX. C is a very widely used computer programming language. It is a general programming language that supports multiple programming patterns, such as procedural programming, data abstraction, object-oriented programming, generic programming, and design patterns.

Most blockchain companies choose to use C to write the bottom layer of the blockchain.The famous ones include Bitcoin, Ripple, etc., which mainly reflect strong computational capabilities.

Java

Java is different from general compiled languages ​​or interpreted languages. It first compiles the source code into bytecode, and then relies on virtual machines on various platforms to interpret and execute the bytecode, thereby achieving the cross-platform feature of "write once, run anywhere". The development of blockchain projects has obvious dependence on Java.

Others include Python, system architecture, Ethereum, Linux, hyperledger, JavaScript, etc. will be covered.

③ 108 essential knowledge points for getting started with blockchain

Author: Kong Lin

61. Trapped

Expect the currency price to rise, but unexpectedly the currency price falls after buying; or expect the currency price to fall, but unexpectedly the currency price rises after selling

62. Unwinding

After buying Bitcoin, the currency price fell, causing a temporary book loss, but the currency price rebounded later and the loss turned into profit

63. Going short

After selling Bitcoin because of the bearish market outlook, However, the currency price continued to rise, and I failed to buy in time, so I failed to make profits

64. Overbought

The currency price continued to rise to a certain height, and the buyer's power was basically exhausted. The currency price is about to fall

65. Oversold

The currency price continues to fall to a certain low, the seller's power is basically exhausted, and the currency price is about to rise

66. Lure bulls

The currency price has been consolidating for a long time and is more likely to fall. Most short sellers have sold Bitcoin. Suddenly the short sellers pull up the currency price, inducing many parties to think that the currency price will rise and buy one after another. After the bulls bought Bitcoin, they deliberately suppressed the price of the currency, making the short sellers think that the price of the currency would fall. , were thrown out one after another, and ended up falling into the trap of bulls


68. What is NFT

The full name of NFT is "Non-Fungible Tokens", that is, To put it simply, non-fungible tokens are an indivisible copyright certificate on the blockchain. They are mainly used to confirm and transfer the rights of digital assets. The difference from digital currencies is that they are unique and indivisible. In essence, they are a a unique digital asset.

69. What is the Metaverse

The Metaverse is a collection of virtual time and space, consisting of a series of augmented reality (AR), virtual reality (VR) and the Internet (Internet) Composed of digital currency, which carries the function of value transfer in this world.

70. What is DeFi

DeFi, the full name is Decentralized Finance, which is "decentralized finance" or "distributed finance". "Decentralized finance", as opposed to traditional centralized finance, refers to various financial applications based on open decentralized networks. The goal is to establish a multi-level financial system based on blockchain technology and cryptocurrency. As a basis, re-create and improve the existing financial system

71. Who is Satoshi Nakamoto?

72. Bitcoin is different from Q Coin

Bitcoin is a decentralized digital asset with no issuing entity. Q Coin is an electronic currency issued by Tencent. It is similar to electronic points, but it is not actually a currency. Q Coin requires a centralized issuing institution. Q Coin can only be recognized and used because of the credit endorsement of Tencent. The scope of use is also limited to Tencent's games and services. The value of Q coins is entirely based on people's trust in Tencent.

Bitcoin is not issued through a centralized institution, but it is widely recognized around the world because Bitcoin can self-certify its trust. The issuance and circulation of Bitcoin are jointly accounted for by miners across the entire network, and are not A central authority is also needed to ensure that no one can tamper with the ledger.

73. What is a mining machine?

Taking Bitcoin as an example, a Bitcoin mining machine is a professional equipment that competes for accounting rights by running a large amount of calculations to obtain new Bitcoin rewards. It is generally composed of a mining chip, a heat sink and a fan, and only performs A single calculation program consumes a lot of power. Mining is actually a competition between miners for computing power. Miners with more computing power have a greater probability of mining Bitcoin. As the computing power of the entire network increases, it becomes increasingly difficult to mine bits with traditional equipment (CPU, GPU), and people have developed chips specifically for mining. The chip is the core part of the mining machine. The operation of the chip will generate a large amount of heat. In order to dissipate heat, Bitcoin mining machines are generally equipped with heat sinks and fans. Users download Bitcoin mining software on their computers, use the software to assign tasks to each mining machine, and then start mining. Each currency has a different algorithm and requires different mining machines.

74. What is quantitative trading?

Quantitative trading, sometimes also called automated trading, refers to the use of advanced mathematical models to replace human subjective judgments, which greatly reduces the impact of investor sentiment fluctuations and avoids extreme fanaticism or pessimism in the market. make irrational investment decisions. There are many types of quantitative trading, including cross-platform trading, trend trading, hedging, etc. Cross-platform trading means that when the price difference between different target platforms reaches a certain amount, sell on the platform with a higher price and buy on the platform with a lower price.

75. Blockchain asset over-the-counter trading

Over-the-counter trading is also called OTC trading. Users need to find their own counterparties and do not need to match the transaction. The transaction price is determined by the transaction pair.The two parties can fully communicate through face-to-face negotiation or telephone communication.

76. What is a timestamp?

The blockchain ensures that each block is connected sequentially through timestamps. Timestamps enable every piece of data on the blockchain to have a time stamp. Simply put, timestamps prove when something happened on the blockchain and cannot be tampered with by anyone.

77. What is a blockchain fork?

Upgrading software in a centralized system is very simple, just click "Upgrade" in the app store. However, in decentralized systems such as blockchain, "upgrading" is not that simple, and a disagreement may even cause a blockchain fork. Simply put, a fork refers to a disagreement when the blockchain is "upgraded", resulting in a fork in the blockchain. Because there is no centralized organization, every code upgrade of digital assets such as Bitcoin needs to be unanimously recognized by the Bitcoin community. If the Bitcoin community cannot reach an agreement, the blockchain is likely to form a fork.

78. Soft fork and hard fork

Hard fork means that when the Bitcoin code changes, the old nodes refuse to accept the blocks created by the new nodes. Blocks that do not comply with the original rules will be ignored, and miners will follow the original rules and create new blocks after the last block they verified. A soft fork means that old nodes are not aware of the changes to the Bitcoin code and continue to accept blocks created by new nodes. Miners may work on blocks they have no understanding of, or validation of. Both soft forks and hard forks are "backwards compatible" to ensure that new nodes can verify the blockchain from scratch. Backward compatibility means that new software accepts data or code generated by old software. For example, Windows 10 can run Windows XP applications. Soft forks can also be "forward compatible".

79. Classification and application of blockchain projects

Judging from the current mainstream blockchain projects, blockchain projects mainly fall into four categories: Category 1: Currency; The second category: platform category; the third category: application category; the fourth category: asset tokenization.

80. USDT against the US dollar

USDT is Tether USD, a token launched by Tether that is against the US dollar (USD). 1USDT=1 US dollar, users can use USDT and USD for 1:1 exchange at any time. Tether implements a 1:1 reserve guarantee system, that is, each USDT token will have a reserve guarantee of 1 US dollar, which supports the stability of the USDT price. The unit price of a certain digital asset is USDT, which is equivalent to its unit price in US dollars (USD).

81. Altcoins and altcoins

Altcoins refer to blockchain assets that use the Bitcoin code as a template and make some modifications to its underlying technology blockchain., those with technological innovations or improvements are also called alternative coins. Because the Bitcoin code is open source, the cost of plagiarism in Bitcoin is very low. You can even generate a brand new blockchain by simply copying the Bitcoin code and modifying some parameters.

82. Three major exchanges

Binance

Okex

Huobi

83. Market software

Mytoken

Non-small account

CMC

84. Information website

Babbitt

Golden Finance

Coin World News

85. Blockchain Browser

BTC

ETH

< p> BCH

LTC

ETC

86. Wallet

Imtoken

Bitpie

87. Decentralized exchange

uniswap


88. NFT exchange

Opensea< /p>

Super Rare

89. Ladder

Bring your own, buy a reliable ladder

90. Platform currency

The digital currency issued by the platform is used to deduct handling fees, transactions, etc.

91. Bull market, bear market

Bull market: rising market

Bear market: falling market< /p>

92. Blockchain 1.0

A currency trading system based on distributed ledgers, represented by Bitcoin

93. Blockchain 2.0

< p> The contract blockchain technology represented by Ethereum (smart contract) is 2.0

94. Blockchain 3.0

In the era of intelligent Internet of Things, it goes beyond the financial field and provides various The industry provides decentralized solutions

95. Smart Contract

Smart Contract is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. Simply put, an electronic contract is set up in advance, and once both parties confirm it, the contract will be automatically executed.

96. What is a token?

The token economy is an economic system with Token as the only reference standard, which is equivalent to a pass. You haveToken, if you have rights and interests, you have the right to speak.


Big data is the means of production, AI is the new productivity, and blockchain is the new production relationship. Big data refers to a collection of data that cannot be captured, managed and processed within a certain time range using conventional software tools. It is a massive, high-growth and high-volume data set that requires new processing models to have stronger decision-making power, insight discovery and process optimization capabilities. Diverse information assets. Simply understood, big data is massive data accumulated over a long period of time and cannot be obtained in the short term. Blockchain can be used as a way to obtain big data, but it cannot replace big data. Big data is only used as a medium running in the blockchain and has no absolute technical performance, so the two cannot be confused. (The simple understanding of production relations is the labor exchange and consumption relations, the core lies in productivity, and the core of productivity lies in production tools)

ICO, Initial Coin Offering, initial public token issuance, is the first step in the blockchain digital currency industry. Crowdfunding. It is the most popular topic and investment trend in 2017, and the country launched a regulatory plan on September 4. Speaking of ICO, people will think of IPO, and the two are fundamentally different.

99. Five characteristics of digital currency

The first characteristic: decentralization

The second characteristic: having open source code

The third feature: independent electronic wallet

The fourth feature: constant issuance

The fifth feature: global circulation

100. What is decentralization?

It has no issuer, does not belong to any institution or country, and is a publicly issued currency designed, developed and stored on the Internet by Internet network experts.

100. What is measurement (scarcity)?

Once the total amount of issuance is set, it is permanently fixed, cannot be changed, cannot be over-issued at will, and is subject to global Internet supervision. Because the difficulty of mining and mining changes over time, the longer the time, the greater the difficulty of mining, and the fewer coins are mined, so it is scarce.

101. What is open source code?

The alphanumeric code is stored on the Internet. Anyone can find out the source code of its design, everyone can participate, can mine it, and it is open to the world.

102. What is anonymous transaction? Private wallet private?

Everyone can register and download the wallet online without real-name authentication. It is completely composed of encrypted digital codes. It can be sent and traded globally in real-time point-to-point without resorting to banks or any institutions. It cannot be traced by anyone without my authorization. ,Inquire.


A contract transaction refers to an agreement between the buyer and the seller at a specified time in the future.An agreement to receive a certain amount of an asset at a fixed price for trading. The objects of contract trading are standardized contracts formulated by the exchange. The exchange stipulates standardized information such as commodity type, transaction time, quantity, etc. A contract represents the rights and obligations of the buyer and seller.


105. Digital Currency Industry Chain

Chip manufacturers, mining machine manufacturers, and mining machine agents mine and export to exchanges for retail investors to speculate in coins< /p>


106. Who is Kong Lin?

Kong Lin: Digital Currency Value Investor

Investment style: Steady




p>

107. Konglin Investment Strategy

Combining long-term and short-term, focusing on price investment, no contracts, no short-term play

Reasonable layout, scientific operation, steady and conservative, earning Cycle money


108. Konglin?

Welcome currency friends and seek common development

④ Introduction to blockchain (1) - Let’s keep accounts together

When I was a child, I was interested in many novel I am very curious about everything and full of desire to understand and learn. At that time, countless exclamation marks often appear in my brain. As I grow older and gain more experience, this kind of experience becomes less and less common, and I am not surprised by the new things that many people follow. When "blockchain" first appeared, I was completely attracted. After that, just like when I was a child, I was instinctively driven to learn and understand deeply, and found that "blockchain" is a new world that is about to come. s future.

The first time I heard the word "Blockchain" was in teacher Li Xiaolai's column "The Road to Financial Freedom", and I read it many times in the column after that. to the emergence of this term. Out of curiosity, I followed and read the articles on Lao Mao's public account "Cat Talk", and gradually gained a 0 to 1 understanding of the blockchain. block-block, chain-chain, blockchain-connect the blocks one by one into a chain, imagine the DNA extending infinitely in front of you...

This paragraph is about blocks on the network An explanation of the chain, to put it in simpler terms, the blockchain is an open, decentralized, trustless, and jointly maintained accounting system.

Let’s first look at the traditional centralized banking business model. When we do transactions, why do we need third-party centralized companies such as banks, Alibaba, and Tencent? Because there is no trust between people. A lends B 100 yuan today. If B does not recognize the loan tomorrow, what will A do? The bank helped solve this problem. EveryAn individual creates a real-name certified account in a bank. With the help of this centralized company, A lends 100 yuan to the bank (deposit), and B takes out 100 yuan from the bank (withdraw/borrow). Then the bank is responsible for recording this transaction. A's account will be 100 yuan more, while B's account will be 100 yuan less. This method of relying on third-party centralized companies for accounting can be seen everywhere in our lives: for online shopping, we need Alibaba's Taobao City and JD.com; for loans, we need to find reliable small loan companies; for new books, we need to go through a certain publishing house... …In the final analysis, it’s because people don’t trust each other, or the risks and costs of maintaining trust are too high, so we need such centralized and powerful third-party companies to endorse transactions and let them Taking these risks, of course, they also make us money. However, relying on third-party centralized business models has brought us inefficient services, cumbersome procedures and diversion of value, such as banks queuing up to handle business, the lending process of small loan companies, and Taobao and JD.com’s rent collection from merchants. , the publisher’s share of the author’s manuscript fee, etc. This is the centralized, third-party trust-based world we currently live in.

The blockchain world is a new world where no third party is needed, all transaction information is public, and everyone participates in bookkeeping! As the world's first proven and feasible blockchain application, Bitcoin subverts the traditional financial model by using automatic accounting and open accounting, information cannot be tampered with, and can be queried at any time, bypassing third-party centralization. Buyers and sellers conduct transactions directly. Such a transaction model must be efficient, low-cost, and open. Just imagine if blockchain technology becomes popular in the future, when you want to transfer a large amount of money to a friend abroad, you can skip the lengthy steps and get it instantly; if you write a book and publish it, you don’t have to worry about being pirated. There is no need for the publisher to earn your royalties; a peer-to-peer mutual insurance platform will be built directly between people, and the insurance company will become a consulting company, etc. (In fact, Bitcoin and Press.one are realizing such a subversion)

The Internet is currently booming. We have Didi taxis or shared bicycles for outside work, Ele.me for ordering food, and Ele.me for dining in restaurants. Dianping, convenient payment via WeChat and Alipay is everywhere. When we pay on the Internet, we need to rely on a third-party platform company trusted by both buyers and sellers to complete the transaction for us. These third-party companies have a large amount of transaction data and information on both parties to the transaction. If a hacker intrusion occurs and information is lost, we will bear the consequences for our "trust risk"; not to mention the delays caused by reviewing and clearing transaction data. The inconvenience, and the huge cost of managing such a huge amount of data.

So how is blockchain technology implemented? For example, if there is an army that wants to seize the enemy's fortress, and each soldier wears a special helmet with a red button, each soldier wears a special helmet with a red button.Capture a fortress and the army headquarters will reward you with a medal. First, there is a soldier A who takes the lead in occupying the first fortress 1. He announces to other comrades through his helmet that he has occupied fortress 1. At this time, the helmet will record the coordinate information of fortress 1 and pass it to other soldiers along with A's shouting. All soldiers and others heard A's shouting through the helmet and pressed the red button to indicate that the message had been recorded simultaneously. Then everyone knows that fortress 1 has been occupied by A, and A is rewarded with a medal. Then others will immediately capture other fortresses and broadcast their achievements in the same way. In this way, the information that different fortresses were captured by different soldiers in this battle is all stored in everyone's helmet. Here, the helmet is the public ledger (strictly speaking, the helmet's program), and everyone participates in accounting; each capture information constitutes a block, and all information arranged in a certain order forms a blockchain; In addition to keeping accounts (pressing the red button), participants also scramble to grab the right to package new data (capture the fortress).

So let’s take a look at the advantages of this joint accounting method. 1. Decentralization. The ledger is jointly recorded and maintained by everyone. It doesn’t matter who records it first, because if there is an incentive (medal), someone will do it, and there is no need for a third party to intervene (no need for the command of a general or combat department, reducing military expenses and commanders) risk of sacrifice). 2. Data cannot be tampered with. If you want to modify the accounted data, you must modify more than 51% of the node information to succeed. Just imagine, if this army has one million people (actually the number of blockchain nodes is much larger than this number), it would be an almost impossible task to modify the helmets of more than half of the army. 3. Information is open and transparent. Everyone can check this transaction information in their own ledger (all fortress capture information has been recorded in everyone's helmet).

This is the first article I started writing. The last time I wrote so many words was probably in the college entrance examination. The first article was about a new field that I had never touched before. The text was a bit confusing and mediocre, and I didn’t know whether the analogy I made was correct or not, but I finally started to do it. Writing is indeed a skill that everyone should have, and it is a skill that can be improved through deliberate practice and urge yourself to maintain it.

⑤ How to learn blockchain-related technologies

One of the best ways to learn blockchain technology is to start with practice. You can establish a simple area. Blockchain projects use relevant technologies to solve practical problems. Then you can learn related technologies, such as Bitcoin, Ethereum, Hyperledger, consensus-based Hu Zhong distributed system, etc. Additionally, more advanced concepts can be learned such as smart contracts, distributed application development, and more. The future prospects of learning blockchain technology are very broad, and many industries are trying to use blockchain technology, such as finance, logistics, procurement, customs, etc.

⑥ Tutorial for getting started with blockchain


However, there are few simple and easy-to-understand introductory articles. What exactly blockchain is and what makes it special is rarely explained.
Next, I will try to write a best-understood blockchain tutorial. After all, it is not difficult. The core concept is very simple and can be explained clearly in a few sentences. I hope that after reading this article, you will not only understand the blockchain, but also understand what mining is, why mining is getting more and more difficult, and other issues.
It should be noted that I am not an expert in this area. Although I have been paying attention to it for a long time, my detailed understanding of blockchain started at the beginning of this year. You are welcome to correct any errors or inaccuracies in the article.
1. The essence of blockchain
What is blockchain? In a word, it is a special distributed database.
First of all, the main function of blockchain is to store information. Any information that needs to be saved can be written to the blockchain and read from it, so it is a database.
Secondly, anyone can set up a server, join the blockchain network, and become a node. In the world of blockchain, there is no central node. Every node is equal and stores the entire database. You can write/read data to any node, because all nodes will eventually be synchronized to ensure that the blockchain is consistent.
2. The biggest features of blockchain
Distributed databases are not a new invention, and there have been such products on the market for a long time. However, blockchain has a revolutionary feature.
Blockchain has no administrator, it is completely centerless. Other databases have administrators, but blockchain does not. If one wanted to add auditing to the blockchain, it would not be possible because it is designed to prevent the emergence of a central authority.
It is precisely because it is unmanageable that blockchain can be uncontrollable. Otherwise, once big companies and large groups control the management, they will control the entire platform, and other users will have to take orders from them.
However, without an administrator, everyone can write data into it. How can we ensure that the data is trustworthy? What if it is modified by a bad person? Please read on, this is the wonderful thing about blockchain place.
3. Block
Blockchain is composed of blocks. Blocks are much like database records. Every time data is written, a block is created.
Each block contains two parts.
Head: records the characteristic values ​​of the current block
Body: actual data
The block header contains multiple characteristic values ​​of the current block.
Generation time
Hash of the actual data (i.e. block body)
Hash of the previous block
...
Here, you need to understand what a hash is , which is necessary to understand blockchain.
The so-called hashing means that the computer can calculate a characteristic value of the same length for any content. The hash length of the blockchain is 256 bits, which means that no matter what the original content is, a 256-bit binary will be calculated in the endnumber. And it can be guaranteed that as long as the original content is different, the corresponding hash must be different.
For example, the hash of the string 123 is (hexadecimal), which is 256 bits when converted to binary, and only 123 can get this hash. (Theoretically, it is possible for other strings to get this hash, but the probability is extremely low and can be approximated as impossible.)
Therefore, there are two important inferences.
Corollary 1: The hash of each block is different, and the block can be identified by the hash.
Corollary 2: If the content of the block changes, its hash will definitely change.
4. The non-modifiable nature of Hash
Blocks and hashes have a one-to-one correspondence, and the hash of each block is calculated based on the block header (Head). That is to say, the characteristic values ​​​​of the block header are connected together in order to form a very long string, and then the hash is calculated on this string.
Hash = SHA256 (block header)
The above is the calculation formula of block hash. SHA256 is the hash algorithm of the blockchain. Note that this formula only contains the block header and not the block body. In other words, the hash is uniquely determined by the block header.
As mentioned before, the block header contains a lot of content, including the hash of the current block body. , and the hash of the previous block. This means that if the content of the current block body changes, or the hash of the previous block changes, it will definitely cause the hash of the current block to change.
This point has great significance for blockchain. If someone modifies a block, the hash of the block changes. In order for subsequent blocks to still be connected to it (because the next block contains the hash of the previous block), the person must modify all subsequent blocks in sequence, otherwise the modified block will be removed from the blockchain . Due to the reasons mentioned later, hash calculation is very time-consuming, and it is almost impossible to modify multiple blocks in a short period of time, unless someone controls more than 51% of the computing power of the entire network.
It is through this linkage mechanism that the blockchain ensures its own reliability. Once the data is written, it cannot be tampered with. This is just like history, what happened happened, and it can’t be changed from now on.
Each block is connected to the previous block, which is where the name blockchain comes from.
5. Mining
Since synchronization between nodes must be ensured, the adding speed of new blocks cannot be too fast. Just imagine, you have just synchronized a block and are preparing to generate the next block based on it, but at this time, another node generates a new block, and you have to give up half of the calculations and synchronize again. Because each block can only be followed by one block, you can only generate the next block after the latest block. So, you have no choice but to sync as soon as you hear the signal.
So, the inventor of the blockchain, Satoshi Nakamoto (this is a pseudonym, and his true identity is still unknown) deliberately made it difficult to add new blocks. His design is that on average every 10 minutes, the entire network can generate a new zone.Blocks, only six an hour.
This output speed is not achieved through commands, but by deliberately setting up massive calculations. In other words, only through an extremely large amount of calculations can the effective hash of the current block be obtained and the new block added to the blockchain. Because the amount of calculation is too large, it cannot be done quickly.
This process is called mining, because the difficulty of calculating a valid hash is like finding a grain of sand that meets the conditions among the sand in the world. The machine that calculates hashes is called a mining machine, and the person who operates the mining machine is called a miner.
6. Difficulty coefficient
After reading this, you may have a question. People say that mining is difficult, but isn’t mining just about using a computer to calculate a hash? This is the strength of computers. How could it be? It becomes very difficult, why can’t it be calculated?
It turns out that not just any hash can be used, only hashes that meet the conditions will be accepted by the blockchain. This condition is particularly harsh, causing most hashes to fail to meet the requirements and must be recalculated.
It turns out that the block header contains a difficulty coefficient (difficulty), which determines the difficulty of calculating the hash. For example, the difficulty coefficient of the 100,000th block is 14484.16236122.
The blockchain protocol stipulates that the target value (target) can be obtained by dividing the difficulty coefficient by a constant. Obviously, the greater the difficulty coefficient, the smaller the target value.
The validity of the hash is closely related to the target value. Only hashes smaller than the target value are valid, otherwise the hash is invalid and must be recalculated. Since the target value is very small, the chance that the hash is smaller than this value is extremely slim, and it may be calculated 1 billion times before it is considered a hit. This is the fundamental reason why mining is so slow.
As mentioned earlier, the hash of the current block is uniquely determined by the block header. If the hash of the same block needs to be calculated repeatedly, it means that the block header must keep changing, otherwise it is impossible to calculate different hashes. All feature values ​​in the block header are fixed. In order to make the block header change, Satoshi Nakamoto deliberately added a random item called Nonce.
Nonce is a random value. The role of the miner is actually to guess the value of Nonce so that the hash of the block header can be smaller than the target value so that it can be written to the blockchain. Nonce is very difficult to guess. At present, we can only use trial and error one by one through exhaustive methods. According to the protocol, Nonce is a 32-bit binary value, which can reach a maximum of 2.147 billion. The Nonce value of the 100,000th block is 274148111. It can be understood that the miner started from 0 and calculated 274 million times before obtaining a valid Nonce value so that the calculated hash can meet the conditions.
If you are lucky, you may find Nonce in a while. If you are unlucky, you may have calculated it 2.147 billion times without finding the Nonce, that is, it is impossible to calculate a hash that meets the conditions for the current block body. At this time, the protocol allows minersChange the block body and start a new calculation.
7. Dynamic adjustment of difficulty coefficient
As mentioned in the previous section, mining is random, and there is no guarantee that a block will be produced in exactly ten minutes. Sometimes it can be calculated in one minute, and sometimes it may take several hours. No result. Overall, with the improvement of hardware equipment and the increase in the number of mining machines, the computing speed will definitely become faster and faster.
In order to keep the output rate constant at ten minutes, Satoshi Nakamoto also designed a dynamic adjustment mechanism for the difficulty coefficient. He stipulated that the difficulty factor should be adjusted every two weeks (2016 blocks). If the average block generation speed in these two weeks is 9 minutes, it means that it is 10% faster than the legal speed, so the next difficulty factor will be increased by 10%; if the average block generation speed is 11 minutes, it means It is 10% slower than the legal speed, so the difficulty factor of the next step must be lowered by 10%.
The difficulty coefficient is adjusted higher and higher (the target value is getting smaller and smaller), which makes mining more and more difficult.
8. Forks of the blockchain
Even if the blockchain is reliable, there is still an unresolved problem: if two people write data to the blockchain at the same time, that is to say, two people write data to the blockchain at the same time. Blocks join because they are connected to the previous block, forming a fork. Which block should be adopted at this time?
The current rule is that new nodes always adopt the longest blockchain. If there is a fork in the blockchain, it will look at which branch is behind the fork to reach 6 new blocks first (called six confirmations). Based on a block calculation of 10 minutes, it can be confirmed in one hour.
Since the generation speed of new blocks is determined by computing power, this rule means that the branch with the most computing power is the authentic blockchain.
9. Summary
Blockchain, as an unmanaged distributed database, has been running for 8 years since 2009 without major problems. This proves it works.
However, in order to ensure the reliability of data, blockchain also has its own price. The first is efficiency. You have to wait at least ten minutes to write data to the blockchain. All nodes synchronize the data, which requires more time. The second is energy consumption. The generation of blocks requires miners to perform countless meaningless calculations. This is Very energy consuming.
Therefore, the applicable scenarios of blockchain are actually very limited.
There is no management authority that all members trust
The written data does not require real-time use
The benefits of mining can make up for its own costs
If the above conditions cannot be met, then the traditional database is Better solution.
Currently, the largest application scenario (and possibly the only application scenario) of blockchain is the cryptocurrency represented by Bitcoin.

⑦ What is the basic knowledge of blockchain

Blockchain allows every node scattered in the network (you and I can be nodes) to use a certain The determined consensus jointly participates in the management of the database to achieve decentralized distributed storage of data information. Without the need for nodes to trust each other, Blockchain can ensure the integrity and security of data records within the system. Compared with the centralized world of the past, the first thing blockchain has to overcome is their opacity, eliminating black-box operations.

You can think of the blockchain as a public "running account" ledger. Each node has the same ledger, and everyone participates in accounting. When a transaction occurs, the transaction details need to be broadcast to keep all parties involved. Synchronous update of node ledger data. If the blockchain is a ledger, then each "block" is each page in the ledger.

Blockchain Precautions

The important factor that distinguishes blockchain from ordinary databases is that blockchain has special conditions for inputting data into the database. That is, the new data entered cannot conflict with the data that already exists in it (data consistency), and the data cannot be changed. The data itself is locked with the user, which is replicable and valid. Finally, without centralized personal control, everyone reaches a consensus about what is happening in the database.

The last point is the core of the blockchain. Decentralization is attractive because it means there is no single point of failure. That is, no agency can take away your assets or alter records to suit their needs. This immutability eliminates the need to trust anyone, which is beneficial to any blockchain member, but comes at a significant cost.

⑧ Getting Started with Blockchain What You Need to Know!


What is a blockchain?
Literally: a blockchain is a chain composed of small blocks that record various information, similar to what we will Bricks are stacked one after another, and they cannot be removed after being stacked. Each brick also has various information written on it, including: who stacked it, when it was stacked, what material the brick was made of, etc. You can use this information There is no way to modify it.
From a computer perspective: Blockchain is a relatively special distributed database. A distributed database stores data information on each computer separately, and the stored information is consistent. If one or two computers in Taiwan are broken, the information will not be lost, and you can still view it on other computers.
Blockchain is distributed, so it has no central point. Information is stored in all nodes that join the blockchain network, and the data of the nodes is synchronized. A node can be a server, laptop, mobile phone, etc.
What you need to know is that the data stored in these nodes are exactly the same.
Blockchain Features
Decentralization: Because it is distributed storage, there is no central point. It can also be said that each node is a central point. Applications in life do not require a third-party system (bank , Alipay, real estate agencies, etc. are all third parties).
Openness: The system data of the blockchain is open and transparent, and everyone can participate. For example, when renting a house, you can know the previous rental information of the house and whether there have been any problems. Of course, some individuals here Private information is encrypted.
Autonomy: The blockchain adopts consensus-based specifications and protocols (such as a set of open and transparent algorithms), and then each node operates according to this specification, so that everything is done by machines and there is no human touch. Element. This changes trust in people to trust in machines, and any human intervention has no effect.
Information cannot be tampered with: If the information is stored in the blockchain, it will be saved permanently and there is no way to change it. As for the 51% attack, it is basically impossible to achieve.
Anonymity: There is no personal information on the blockchain, because it is all encrypted and is a string of letters and numbers, so your ID card information and phone number will not be resold. Phenomenon.
Block structure
A block contains two parts:
1. Block header (Head): records meta-information of the current block
2. Block body (Body): actual data
>Contains data as shown below:
How blockchain works
Let’s take transfer as an example:
Currently our transfers are centralized, and the bank is a centralized ledger. For example, there is 400 in account A There are 100 yuan in account B.
When A wants to transfer 100 yuan to B, A needs to submit a transfer application through the bank. After the bank verification is passed, 100 yuan will be deducted from A's account and 100 yuan will be added to B's account.
After calculation, the balance of account A after deducting 100 is 300 yuan, and the balance of account B after adding 100 is 200 yuan.
The steps for transferring money on the blockchain are: A wants to transfer 100 yuan to B. A will tell everyone about the transfer on the Internet, and everyone will check whether there is enough money in A's account. To complete the transfer, if the verification is passed, everyone will record this information in the blockchain on their computers, and the information recorded by everyone will be synchronized and consistent, so that A will successfully transfer 100 yuan to on B’s account. You can see that there is no bank involved.
Related questions
What is the relationship between blockchain and Bitcoin?
Bitcoin was proposed by Satoshi Nakamoto in 2009, and then the blockchain technology was refined with reference to the implementation of Bitcoin.
If Bitcoin is noodles, then blockchain is flour. Later, everyone discovered that flour can be used to make steamed buns and steamed buns in addition to noodles.
Why do I need to help you store block information?
I don’t have time to do it without profit. To put it simply, you help me store information and I will give you corresponding rewards.
Key technical points that need to be understood in blockchain?
Use Hash and asymmetric encryption to ensure that data cannot be tampered with:
Hash: y = hash(x), perform a hash operation on x to obtain y , the original information x can be hidden, because you cannot calculate x through y, thus achieving anonymity.
Asymmetric encryption: public key and private key areA pair, if the data is encrypted with a public key, it can only be decrypted with the corresponding private key; if the data is encrypted with a private key, it can only be decrypted with the corresponding public key.
Consensus algorithm: Ensure data consistency between nodes.
Is there a sentence or two that can explain the blockchain?
Yes.
Mahjong is a traditional Chinese blockchain project. A group of four miners work together. The miner who first collides with the correct hash value of 13 numbers can obtain the accounting rights and be rewarded.

博客主人唯心底涂
男,单身,无聊上班族,闲着没事喜欢研究股票,无时无刻分享股票入门基础知识,资深技术宅。
  • 35475 文章总数
  • 3637265访问次数
  • 3078建站天数