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

比特币区块链同步网络怎么设置,比特币区块链同步网络怎么弄

发布时间:2023-12-10-17:17:00 来源:网络 区块链知识 区块   网络

比特币区块链同步网络怎么设置,比特币区块链同步网络怎么弄

比特币区块链同步网络是一种分布式数据库,它可以实现全球范围内的数据同步。它是由一组网络节点组成,每个节点都可以存储和传输数据,从而实现数据的同步。下面我们就来讨论比特币区块链同步网络的三个关键词:P2P网络、挖矿和数据安全。

P2P网络是指点对点网络,它是一种分布式网络,每个节点都可以直接与其他节点进行通信,而无需中心服务器的介入。比特币区块链同步网络就是基于P2P网络技术构建的,它可以实现数据的快速同步和传输,从而确保数据的可靠性和安全性。

挖矿是指比特币区块链同步网络中的一种技术,它可以帮助网络节点完成数据同步的过程。挖矿是一种竞争性技术,网络节点之间会竞争完成数据同步,从而获取比特币的奖励。挖矿可以确保比特币区块链同步网络的安全性,同时也可以保证数据的可靠性。

数据安全是比特币区块链同步网络的一个重要特性,它可以确保数据的可靠性和安全性。比特币区块链同步网络采用分布式账本技术,可以将数据分布到每个节点,从而保证数据的安全性。此外,比特币区块链同步网络还采用了加密技术,可以有效防止数据被篡改。

总结起来,比特币区块链同步网络是一种分布式数据库,它可以实现全球范围内的数据同步。它的三个关键词是P2P网络、挖矿和数据安全。P2P网络可以实现数据的快速同步和传输,挖矿可以确保比特币区块链同步网络的安全性,而数据安全可以保证数据的可靠性。


请查看相关英文文档

『一』 Is blockchain a lie?

"Blockchain" is an important concept in the new era. It is essentially a centralized database. It is also the underlying technology such as digital currency. According to our popular explanation, the "blockchain" can be regarded as a ledger, and each bill is a block. However, this ledger is centralized, and it can be said that no company or team has jurisdiction over it. "Blockchain" technology is a unique informatization that is centralized and cannot cross-change information. Now in daily life, this technology has been applied to a series of applications such as electronic invoices and payment codes.
In today's life, many people use this guise to commit fraud. Direct sales disks, capital disks, technology disks and other names are used to lure people to make money and then run away. As a result, many people have lost their funds and have nowhere to defend their rights. In the end, I can only say that "blockchain" is a lie. There is no right or wrong in technology, it’s the people who are wrong.
With the progress of the times and the progress of society, the initial application of any technology will be subject to various positive and negative doubts. However, with the relative application and maturity of technology, coupled with the improvement of technology, various aspects around people have formed. This application will continue to improve, and I believe that these doubts will slowly dissipate in the near future.
The following is a summary of some blockchain scams that are often around you!
Trap 1: Blockchain is about issuing coins to make money
Trap 2: Conducting virtual currency transactions, promising low investment and high returns
Trap 3: Decentralization can solve all problems
Trap 4: With the extension of the blockchain, you can make money with a mining machine
Trap 5: Transactions on WeChat and Alipay to buy and sell virtual currencies
In short, the methods of scammers are also advancing with the times. Through our "eyes of wisdom", we can improve and enhance our adaptability, discover and alert ourselves, and prevent being deceived. Investors must be wary of various deceptive methods that offer low investment and high returns.

『二』Blockchain technology concept

Blockchain technology concept

Blockchain technology concept, nowadays, blockchain has become most It is an area that people are paying attention to. Many companies have already studied this technology in depth, but there are still people who don’t know much about it. Below I will share an article about the concept of blockchain technology.

Blockchain technology concept 1

Basic concepts and working principles of blockchain

1. Basic concepts

Blockchain is a distributed data storage, point-to-point New application models of computer technologies such as transmission, consensus mechanisms, and encryption algorithms. The so-called consensus mechanism is a mathematical algorithm that establishes trust and obtains rights and interests between different nodes in the blockchain system.

Blockchain is an important concept of Bitcoin. It is essentially a decentralized database and serves as the underlying technology of Bitcoin. Blockchain is a chain of related cryptographicEach data block contains the information of a Bitcoin network transaction, which is used to verify the validity and anti-counterfeiting of the information and generate the next block.

In a narrow sense, blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is cryptographically guaranteed to be non-tamperable and non-tamperable. Fake distributed ledger.

Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, and uses cryptography to ensure data transmission and access. It is a new distributed infrastructure and computing method that uses smart contracts composed of automated script codes to program and operate data securely.

2. Working principle

The blockchain system consists of data layer, network layer, consensus layer, incentive layer, contract layer and application layer. Among them, the data layer encapsulates the underlying data blocks and related basic data and algorithms such as data encryption and timestamps; the network layer includes distributed networking mechanisms, data dissemination mechanisms and data verification mechanisms; the consensus layer mainly encapsulates network nodes Various consensus algorithms; the incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; the contract layer mainly encapsulates various scripts, algorithms and smart contracts, and is the core of the blockchain The basis of programmable features; the application layer encapsulates various application scenarios and cases of the blockchain. In this model, the chain block structure based on timestamps, the consensus mechanism of distributed nodes, economic incentives based on consensus computing power, and flexible programmable smart contracts are the most representative innovations of blockchain technology.

Blockchain mainly solves the trust and security issues of transactions, so it proposes four technological innovations to address this issue:

1. Distributed The ledger means that transaction accounting is completed by multiple nodes distributed in different places, and each node records a complete account, so they can all participate in supervising the legality of the transaction and can also jointly testify for it.

Different from traditional distributed storage, the uniqueness of blockchain distributed storage is mainly reflected in two aspects: First, each node of the blockchain stores complete data according to the block chain structure. For data, traditional distributed storage generally divides the data into multiple parts for storage according to certain rules. Second, the storage of each node in the blockchain is independent and of equal status, relying on the consensus mechanism to ensure storage consistency, while traditional distributed storage generally synchronizes data to other backup nodes through the central node. [8]

No node can record ledger data independently, thus avoiding the possibility of a single bookkeeper being controlled or bribed to record false accounts. Also because there are enough accounting nodes, theoretically, unless all nodes are destroyed, the accounts will not be lost, thus ensuring the security of the accounting data.

2. NotWith symmetric encryption and authorization technology, transaction information stored on the blockchain is public, but account identity information is highly encrypted and can only be accessed with authorization from the data owner, thus ensuring data security and personal privacy. privacy.

3. The consensus mechanism is how all accounting nodes reach a consensus to determine the validity of a record. This is both a means of identification and a means of preventing tampering. Blockchain proposes four different consensus mechanisms, which are suitable for different application scenarios and strike a balance between efficiency and security.

The consensus mechanism of the blockchain has the characteristics of "the minority obeys the majority" and "everyone is equal". Among them, "the minority obeys the majority" does not entirely refer to the number of nodes, but can also be the computing power and the number of shares. Or other characteristic quantities that the computer can compare. "Everyone is equal" means that when a node meets the conditions, all nodes have the right to give priority to the consensus result, which will be directly recognized by other nodes and may eventually become the final consensus result. Taking Bitcoin as an example, it uses proof of work. Only when more than 51% of the accounting nodes in the entire network are controlled, it is possible to forge a non-existent record. When there are enough nodes joining the blockchain, this is basically impossible, thus eliminating the possibility of fraud.

4. Smart contracts. Smart contracts are based on these trustworthy and non-tamperable data. Some predefined rules and terms can be automatically executed. Take insurance as an example. If everyone's information, including medical information and risk occurrence information, is true and trustworthy, it will be easy to implement automated claims settlement in some standardized insurance products.

3. Others

The Internet exchanges information, and the blockchain exchanges value. Human history and the history of the Internet can be understood in eight words: if they are divided for a long time, they must be combined. For a long time, they must be combined. In the era of long-term separation, all network information is scattered on the Internet. It is very difficult for everyone to mine information. At this time, platforms such as Google and Facebook will appear. , the only thing it does is recombine all our information. In the Internet era, what the monopoly giants reorganize is information, rather than generating their own information. The information generated is entirely our own. Once the information is reorganized, a new monopoly giant will emerge, so it will be an era of long-lasting separation. Now, due to the emergence of blockchain technology, it has entered an era of long-term integration and inevitable division. It is a new multi-centralization. After the new multi-centralization, new value will be generated. These data will be in our own hands, and personal data will generate value. It belongs to oneself. This is the most exciting era of this era.

What is the value of blockchain? A low-cost mechanism to establish trust, establish data rights, and resolve data property rights.

At present, blockchain technology continues to develop, including the current development of single chains to multi-chains, and the technology can be further expanded. I think there may still be disruptions in the future, especially in transactions and other aspects. , especially for existingThere are many disruptive scenarios in the industry.

The essence of blockchain is to establish trusted information exchange on untrustworthy networks.

One Belt, One Road + One Chain. The bigger thing about blockchain is not to create trust, but to allow trust to be transmitted losslessly, reducing the friction cost of society as a whole, thereby improving the overall efficiency.

Now the blockchain itself is still in its initial stage, so it includes the information transmission and encryption of the blockchain. Quantum encryption and other encryption appear in this process, which actually attacks the encryption algorithm used by the blockchain itself. This phenomenon also occurs from time to time. Including blockchain is also a recognition of assets, a recognition of digital assets, but now many of us use cryptographic algorithms, or as the key for us to decrypt, but if you forget the password, it is very likely that your current assets will be lost. If you lose them, you won't be able to get back your original assets. Therefore, there are still some hidden dangers in asset management, including information transmission and some security aspects. Of course, from a technical perspective, the processing speed of our blockchain itself, or its scalability, is because from the perspective of the working mechanism, the entire ledger must be copied to all participants, so in the blockchain Its operational efficiency and scalability are still relatively limited. We feel that these still need further development in terms of technology.

The underlying technologies of the blockchain platform also form blockchain wallets, blockchain browsers, node elections, mining machines, mining pools, development components, development modules, technical communities and project communities. and a series of ecosystems. The perfection of these ecosystems directly determines the efficiency and effectiveness of the underlying platform of the blockchain.

4. Mundell’s Impossible Triangle

It is impossible to achieve the ultimate in decentralization, efficiency, and security at the same time.

Blockchain technology concept 2

The essence of blockchain is a distributed accounting technology, as opposed to centralized accounting technology, which is widely used in our current lives. exist. Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.

Blockchain is an important concept of Bitcoin. It is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of related cryptographic methods. Each data block contains a batch of Bitcoin network transaction information, which is used to verify the validity and anti-counterfeiting of the information and generate the next block.

In a narrow sense, blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is cryptographically guaranteed to be non-tamperable and non-tamperable. Fake distributed ledger.

Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, and usesCryptography ensures the security of data transmission and access, and uses smart contracts composed of automated script codes to program and operate data. It is a new distributed infrastructure and computing method.

The popular understanding of blockchain technology is: connecting the front, back, left, and right blocks of "things" into a chain using one technology, but each block The original data of the block cannot be tampered with. It is a "linked module" technology in the field of Internet of Things that allows participants to trust. The application of blockchain technology is inseparable from the Internet and the Internet of Things. It is based on the integration and interaction of the two, but allows participants to remain independent, decentralized, and work together. With this set of value chain co-construction and sharing, technology.

Characteristics of blockchain: decentralization, openness, autonomy, information cannot be tampered with, and anonymity.

Blockchain is a network that can deliver value. The demand for a network that can deliver value is an important reason for the emergence of blockchain technology. Blockchain emerged driven by the need to protect information with ownership or other value. Through public and private key cryptography, distributed storage and other technical means, blockchain ensures on the one hand the efficient transmission of valuable information, and on the other hand ensures that this information will not be easily copied and tampered with during the transmission process.

Understand the connotation of blockchain from the inevitability of its birth. Blockchain is a distributed accounting technology that solves the shortcomings of centralized accounting and solves the problem of distributed consistency. It is also a The connected Internet is upgraded to a value network that ensures the safe and efficient transmission of valuable information.

Blockchain Technology Concept 3

Blockchain: Blockchain is like a globally unique account book, or database, which records the history of all transactions in the network.

Ethereum Virtual Machine (EVM): It allows you to write more powerful programs on Ethereum and script programs on Bitcoin. It is also sometimes used to refer to the Ethereum blockchain, which is responsible for executing smart contracts and everything.

Node: You can run a node to read and write to the Ethereum blockchain, that is, using the Ethereum Virtual Machine. Full nodes require downloading the entire blockchain. Light nodes are still under development.

Miner: Mining, that is, the node that processes blocks on the blockchain. You can see some of the currently active Ethereum miners on this page: stats.ethdev.com.

Proof of Work: Miners are always competing to solve some mathematical problem. The first one to solve the problem (calculate the next block) will be rewarded with Ether coins. All nodes then update their own blockchain. All miners who want to figure out the next block have an incentive to stay in sync with other nodes and maintain the same blockchain, so the entire network can always reach consensus. (Note: Ethereum is planning to move to a proof-of-stake system (POS) without miners, but that is beyond the scope of this article.)

Ethereum: abbreviation ETH. A true digital currency that you can buy and use. Here is a chart from one of the exchanges where Ethereum can be traded. At the time of writing, 1 Ether is worth 65 cents.

Gas: Executing programs and saving data on Ethereum consumes a certain amount of Ethereum. Gas is converted from Ethereum. This mechanism is used to ensure efficiency.

DApp: The Ethereum community calls applications based on smart contracts decentralized applications (Decentralized App). The goal of DApp is (or should be) to have a friendly interface for your smart contracts, plus some extras, such as IPFS, a decentralized network that can store and read data, not from the Ethereum team but in a similar spirit ). DApp can run on a centralized server that can interact with Ethereum nodes, or it can run on any Ethereum equal node. (Take a minute to think about this: Unlike ordinary websites, DApps cannot run on ordinary servers. They need to submit transactions to the blockchain and read important data from the blockchain rather than a centralized database. Compared to typical users When logging into the system, the user may be represented as a wallet address and other user data is stored locally. Many things will be structured differently from current web applications.)

Ethereum client, smart contract language

p>

Writing and deploying smart contracts does not require you to run an Ethereum node. Browser-based IDEs and APIs are listed below. But if you are just learning, you should still run an Ethereum node to understand the basic components, and running a node is not difficult.

Clients available for running Ethereum nodes

Ethereum has many client implementations in different languages, that is, multiple methods of interacting with the Ethereum network, , including C++, Go, Python, Java, Haskell, etc. Why do we need so many implementations? Different implementations can meet different needs. For example, the goal of Haskell implementation is to be mathematically verifiable, to make Ethereum more secure, and to enrich the entire ecosystem.

At the time of writing this article, I am using the client geth (go-ethereum) implemented in the Go language. At other times, I also use a tool called testrpc, which uses the Python client pyethereum. Later examples will use these tools.

About mining: Mining is fun, a bit like caring for your houseplant, but also a way to learn about the entire system. Although the current price of Ethereum may not even cover the electricity bill, who knows in the future. People are creating many cool DApps that may make Ethereum more and more popular.

Interactive console: clientOnce it's running, you can synchronize the blockchain, create a wallet, and send and receive Ethereum. One way to use geth is through the Javascript console. In addition, you can use cURL-like commands to interact with the client through JSON RPC. The goal of this article is to take you through the process of DApp development, so I won’t go into details about this. But we should remember that these command line tools are useful for debugging, configuring nodes, and using wallets.

Running the node on the test network: If you run the geth client on the official network, it will take quite a while to download the entire blockchain and synchronize with the network. You can determine if synchronization has occurred by comparing the last block number printed in the node logs with the latest block listed on stats.ethdev.com. ) Another problem is that running smart contracts on the official network requires real Ethereum. Running the node on the test network does not have this problem. At this time, there is no need to synchronize the entire blockchain. Just create your own private chain, which saves time for development.

Testrpc: Use geth to create a test network. Another faster way to create a test network is to use testrpc. Testrpc can help you create a bunch of test accounts with funds at startup. It also runs faster and is therefore better suited for development and testing. You can start with testrpc, and then as the contract slowly takes shape, move to the test network created by geth - the startup method is very simple, you only need to specify a networkid: geth --networkid "12345". Here is the code repository for testrpc, we will talk about it again below.

Next, let’s talk about the available programming languages, and then we can start the real programming. Solidity is the programming language used to write smart contracts.

There are several languages ​​to choose from for writing smart contracts: Solidity, which is somewhat similar to Javascript, has a file extension of .sol. Serpent, which is similar to Python, has a file name ending in .se. There is also a Lisp-like LLL. Serpent has been popular for a while, but now the most popular and stable one is Solidity, so just use Solidity. I heard you like Python? Use Solidity.

solc compiler: After writing the smart contract with Solidity, you need to use solc to compile it. It is a component from a C++ client implementation. Again, different implementations complement each other. Here is how to install it. If you don't want to install solc, you can also use a browser-based compiler, such as Solidity real-time compiler or Cosmo. The programming sections below will assume that you have s installed.olc.

web3.js API. After the Solidity contract is compiled and sent to the network, you can use Ethereum's web3.js JavaScript API to call it and build web applications that can interact with it.

『三』What is the relationship between blockchain technology and Bitcoin

Blockchain technology is the underlying technology of Bitcoin. Bitcoin has always been operated and managed without any centralized organization. Later, Bitcoin technology was abstracted and called blockchain technology, or distributed ledger technology.

Bitcoin is the first application of blockchain and will be expanded to more and more industries in the future.

Blockchain technology is called distributed ledger technology. It is an Internet database technology that is characterized by decentralization, openness and transparency, allowing everyone to participate in database records.

While Bitcoin is not issued by a specific monetary institution, the Bitcoin economy uses a distributed database composed of many nodes in the entire P2P network to confirm and record all transaction behaviors, and uses cryptographic design to ensure A currency that provides security in all aspects of currency circulation.

(3) Bitcoin blockchain synchronization network extended reading:

Bitcoin currency characteristics:

Decentralization: Bitcoin is the first distributed virtual currency. The entire network is composed of users and there is no central bank. Decentralization is the guarantee of Bitcoin’s security and freedom.

Worldwide circulation: Bitcoin can be managed on any computer connected to the Internet. Anyone can mine, buy, sell or receive Bitcoin regardless of location.

Exclusive ownership: Manipulating Bitcoin requires a private key, which can be isolated and stored on any storage medium. No one can obtain it except the user himself.

Low transaction fees: It is free to remit Bitcoin, but there will ultimately be a transaction fee of approximately 1 bit cent per transaction to ensure faster transaction execution.

No hidden costs: As a means of payment from A to B, Bitcoin has no cumbersome limits and procedures. You can make the payment by knowing the other party's Bitcoin address.

Cross-platform mining: Users can explore the computing capabilities of different hardware on many platforms.

Reference materials: Network-Blockchain Network-Bitcoin

『四』 The operating mechanism of Bitcoin and its connection with the blockchain

Anonymous< br />
Every Bitcoin transaction will be recorded by the nodes in the blockchain network to enhance the credibility of the transaction and protect the interests of both parties to the transaction. However, if all nodes participate in recording, it is easy to cause inconsistency in ledger information due to factors such as network delays, and it is difficult to avoid the bookkeeper from tampering with transaction information.

Therefore, Bitcoin adopts the Proof of Work consensus mechanism to allow all nodes toParticipate in the competition by solving the workload proof problem. The node that succeeds in the competition has the accounting rights of the new block and can broadcast the recorded information. After receiving it, other nodes will perform data synchronization based on this message to ensure that the ledger is consistent. This process of competing for accounting rights is called mining, and the nodes participating in mining are called miners. After successfully mining, the miner can obtain the block reward, which is a certain amount of Bitcoin, and can also charge transaction fees on the block. Driven by interests, nodes will actively participate in mining and maintain the authenticity and validity of transaction records.

There is only one way to issue Bitcoin, which is block reward, which means that Bitcoin is generated through mining. However, Bitcoin cannot be generated infinitely through mining. Its algorithm stipulates that every time 210,100 blocks are generated (about four years), the Bitcoin blockchain reward will be halved. Since the total issuance of Bitcoin is constant at 21 million, it is expected to be mined out in 2140. This regulation ensures that Bitcoin will not suffer severe inflation due to artificial issuance and can protect the value of Bitcoin.

The operation of Bitcoin relies on blockchain technology, and Bitcoin and blockchain have an inseparable relationship. Bitcoin is an asset, and blockchain is the underlying technology that sets operating rules for this asset to ensure that every transaction proceeds smoothly. This is like the relationship between a video file and a player. Video playback must be processed by the underlying technology of the player. The birth of blockchain technology originated from the concept of Bitcoin. It can be said that blockchain technology is a product catalyzed by Bitcoin. Currently, blockchain technology is not only used in cryptocurrencies such as Bitcoin, but is widely used in various fields. However, Bitcoin is still the earliest and most successful application of blockchain technology.

『Wu』What is the connection between blockchain and Bitcoin?

Blockchain is the technology used by Bitcoin and is a database technology.

Bitcoin is an application of blockchain and a digital currency.

Blockchain technology was born with the birth of Bitcoin, but blockchain technology is not limited to Bitcoin, or even digital currency, but has a very wide range of applications.

In 2008, Satoshi Nakamoto published a paper on Bitcoin, commonly known as the Bitcoin white paper. Among them, the concept of blockchain was proposed in Satoshi Nakamoto’s white paper. Blockchain is a series of data blocks (called "blocks") generated using cryptographic correlations. Newly added data blocks can always be linked to the previous block, which is the end of the entire blockchain. Bitcoin’s peer-to-peer network stores all transaction history in the “blockchain.”

Since the advent of Bitcoin, more and more digital cryptocurrencies using blockchain technology have been launched, and now there are nearly 3,000 types.

See: All Digital Currencies

But in addition to the field of cryptocurrency, blockchain technology has been widely used in finance, the Internet of ThingsInternet, logistics, insurance, digital copyright and other fields.

『Lu』Blockchain and Bitcoin (1)

Blockchain is a kind of technology that has been proposed by academic circles for a long time but has only been brought by Bitcoin in recent years. A concept of fire. Bitcoin is an implementation based on blockchain technology. Bitcoin is a cryptocurrency, or a digital currency. Let’s start with Bitcoin and talk about how Bitcoin uses blockchain technology.

Suppose that during the 2006 World Cup finals, two football fans who did not know each other met. Italy was playing France. The French fans said that France will definitely beat Italy with Zidane. The Italian fans were unconvinced and said that we Italy is invincible. If you don't believe it, let's bet 100 euros. In the real world, what should we do?

I have said before that we who work on computers spend more than 90% of our time dealing with abnormal situations. If humans were very trustworthy, the world might not be what it is now. The 600 miles that Qin promised King Huai of Chu were no longer 6 miles. Maybe it would be Chu who unified China. If you hand over the money to a third party, what if the third party also runs away? He stole the money. Therefore, in the real strange world, relying solely on a kind heart is unreliable. There must be means to firmly guarantee this commitment, legal contract, etc. Nowadays, a very common approach is for the third party to find an authoritative institution, such as the government, a bank, etc., or to find a reputable person or organization. In the final analysis, it is still to find an institution or person with credibility. But under normal circumstances, this third party will definitely "pluck out hair" and charge a certain percentage of handling fees.

So is there any way to solve this problem? This is one of the original intentions of Bitcoin's original design, to solve the trust problem between two strangers.

Encryption algorithm + multi-person accounting

Let’s talk about the encryption algorithm first. Here we need the asymmetric encryption I mentioned before, that is, the public key and private key. Everyone can have one or more pairs of public and private keys, but a public key can only have a corresponding private key, and vice versa. The principle is that two very large prime numbers (p and q) are multiplied to get a number (n). If you want to crack the private key based on the public key, you must theoretically crack it violently and figure out which two large prime numbers the number is multiplied by. Got it. Currently, there is no published private key in the world that can crack more than 1024 bits, so it is very safe to use a private key of 1024 or 2048 or even longer.

Then with the public key and private key, I as an individual can encrypt with the private key and then publish the public key. Anyone can use my public key to decrypt to determine that this is what I published. . In the same way, when someone transfers money to me, I can also use his or her public key to decrypt it, thereby determining that this is someone's identity. This is also called a digital signature. The principles are the same, they are all encryption algorithms, obtained by using mathematical Euler's formula, prime number multiplication and other principles. This is a veryThe great algorithm, called RSA, was proposed by three mathematicians. As long as we ordinary people understand the concept and use of public keys and private keys.

In the previous traditional model, banks or government agencies had their own separate ledgers. For example, if Zhang San transferred 100 yuan to Li Si, how would it be recorded in the ledger? 100 is deducted from Zhang San’s account and 100 is added to Li Si’s account, right?

The same is true for multi-person ledgers, except that the previous centralized institution has become a distributed, decentralized multiple institutions and even individuals. For example, Li Bai transferred 100 taels of silver to Du Fu. In the past, the Ministry of Finance kept accounts. In the blockchain, Tang Taizong, Yang Yuhuan, Zhang Xiaojing, He Zhizhang and many other people kept accounts together. It was recorded that Li Taibai transferred 100 taels of silver to Du Zimei. , as evidence, with Li Bai's seal attached at the back. In this way, with multiple ledgers, it would be extremely difficult to tamper with it. Li Bai could safely transfer it to Du Fu without worrying that he would tamper with the amount or deny it.

This can solve the problem of fans betting mentioned at the beginning, but there is another question, why should others help us keep accounts?

The answer is to be paid, which is in line with human nature. Otherwise, who would be willing to help keep an account that has nothing to do with them?

But there is only one person who can ultimately keep accounts, otherwise everything will be in chaos.

On the premise that it is beneficial, how to ensure who will keep the accounts? There is a mathematical knowledge involved here. Everyone who wants to keep accounts, in fact, the so-called miners, must solve a mathematical problem when keeping money. There is no trick to this mathematical problem. The only way is to put the numbers into the formula. In hard calculation, the algorithm is a Hash algorithm, which is similar to calculating a series of numbers. Miners can only guess, but there is no other way. Moreover, the current probability of guessing in Bitcoin is one in a trillion. It would take an ordinary computer to guess this number continuously for about a year.

But there are thousands of computers in the world, and if they are calculated together, the speed will be much faster, because from a probability point of view, one computer will definitely calculate it, and this is indeed the case. Let’s look at a real-life example of Bitcoin.

In addition, you can also see who the Miner is and how many transactions (Number of Transactions) are included in this block.

What if this miner is an individual with ulterior motives, and after calculating the calculation, he tampered with the transfer record and amount privately?

A. Tampering with transaction records/amount

Earlier we introduced the public and private key encryption technology. The miners themselves theoreticallyThere is no private key of the sender or payee, so the transaction record that he has tampered with will make errors when decrypted with the correct public key, and will eventually be deemed illegal (the author is not sure at what point in time) identification, but make sure the record can be falsified).

B. Delete transaction records

Assume a scenario where Zhang San wants to buy a two-bedroom, one-living house in Beijing’s 4th Ring Road, but Zhang San doesn’t want to pay for it. Occupying the house for free, I thought of a sneaky way to tamper with the transaction records. Theoretically, after Zhang San paid, this record was generated but not confirmed. The record needs to wait until a miner solves the puzzle. Assuming that the miner is one of his own, he asked the miner to erase the record. There is no problem. . But there are several ways to do it:

As we all know, Bitcoin mining takes a long time because of the troublesome math problems. The current cycle is about 10 minutes. This is based on the world Under the premise that hundreds of thousands of mining machines are working at full capacity at the same time. That is to say, tens of thousands of transactions will be uniformly confirmed and put into an immutable block every ten minutes, and these hundreds of thousands of mining machines will update their local records at the same time.

2.1 If the transaction is just generated and the landlord sees it, and then transfers the property rights to Zhang San the next second, then if Zhang San wants to tamper with the payment record, he must meet several conditions:

The difficulty of success depends on how many confirmed blocks follow the tampered record. If there is only one, it is too simple, because the blockchain algorithm defaults to miners using the first received longer block when publishing a new block. So after this modification, it will be done once and for all, because all the ledgers will be synchronized, but there is also a problem, that is, this synchronization will be recorded. If the landlord cannot check the account, Zhang San will eventually be arrested. If there are many, for example, after Zhang San transfers the money, the landlord only transfers the property rights 1 hour after confirming the transfer, then Zhang San must tamper with the previous block information of about 6 blocks, which is very troublesome, because every block All will point to the previous block, and each block will have a digest (Hash), which is a summary of all transaction records in the current block. So if you try to modify a block that was written a long time ago, the digests of subsequent blocks will be changed. This is the hash tree (MerkleTree). Other nodes can report information that the blockchain has been tampered with. This involves the most important point. The 51% computing power that is often mentioned means that if Zhang San owns more than 50% of the ledgers and acknowledges this modification, then other nodes will also acknowledge this modification according to the algorithm design. . However, let’s not talk about the fact that almost no one in the world can do the above two things at the same time. Even if you can do it, if someone has questions about this, you can still force the system to be repaired. Similar problems have occurred in Ethereum before, and the outcome is Ethereum Entire blocks were tampered with and stolen property was recovered. Ethereum forkevent .

The above is only a superficial introduction to the characteristics of Bitcoin implemented by applying blockchain technology. It can achieve openness, fairness, neutrality and equality. Any two strangers in the world can rely on Bitcoin or other blockchain technologies to trust each other.

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