实现区块链的完整技术
随着区块链技术的发展,越来越多的公司正在寻求实现区块链的完整技术。这些技术可以帮助公司提高运营效率,改善安全性,提高用户体验,并实现更高的数据保密性。本文将介绍区块链实现的完整技术,以及它们如何帮助公司实现更好的业务效果。
区块链技术
区块链技术是一种分布式数据库技术,它使用一种叫做“分块”的方式来存储数据。每个分块都包含一组数据,并且每个分块都有一个唯一的哈希值,用于标识它们。这种分块技术使得区块链数据库更加安全,因为每个分块都受到其他分块的保护,并且改变任何分块都需要更改整个数据库。
智能合约
智能合约是一种可以自动执行的代码,它可以在区块链上运行,并且可以按照指定的条件执行操作。智能合约可以被用来实现更高级的业务流程,例如资金管理,合同执行,数据流程管理等。智能合约可以帮助公司更有效地实现业务流程,并且可以确保所有参与方都能够按照规定执行。
去中心化应用程序
去中心化应用程序(dApps)是一种基于区块链技术的应用程序,它可以在区块链上运行,并且不受任何中心化机构的控制。 dApps可以用来实现各种功能,例如支付,投票,资产管理等。去中心化应用程序可以帮助公司提高运营效率,提高安全性,提高用户体验,并实现更高的数据保密性。
结论
区块链技术可以帮助公司实现更好的业务效果。它可以帮助公司提高运营效率,改善安全性,提高用户体验,并实现更高的数据保密性。区块链技术包括分块技术,智能合约,以及去中心化应用程序,它们可以帮助公司更有效地实现业务流程,并确保所有参与方都能够按照规定执行。
请查看相关英文文档
『一』What are the blockchain technologies?
The concept of blockchain can be said to be very popular. At the Internet Finance Summit, no one said that blockchain technology is out. What is blockchain technology?
Blockchain technology can be either a public classification (anyone can see it) or a permissioned network (only permissioned people can see it), solving supply chain challenges. Because it is An immutable record, so it is shared among network participants and updated in real time.
Blockchain technology - data layer: Designing the data structure of the account book
Core technology 1. Block_ _;Chain:
Technically, a block is a data structure that records transactions, reflecting the capital flow of the transaction. The transaction blocks that have been reached in the system are connected to form the main chain, and all nodes participating in the calculation are It records the main chain or a part of the main chain.
Each block is composed of a block header and a block body. The block body is only responsible for recording all transaction information in the previous period, mainly including transaction quantity and transaction details. The block header includes The current version number, the previous block address, the timestamp (recording the time when the block was generated, accurate to the second), the random number (recording the answer value to the mathematical question related to decrypting the block), the target hash value of the current block, and the Merkle number Information such as the root value of the source mill. From a structural point of view, most functions of the blockchain are implemented by the block header.
Core technology 2. Hash function:
.
The hash function can convert data of any length from the Hash algorithm to a fixed-length code. The principle is a one-way hash function based on cryptography. This function is easy to verify, but difficult to interpret. The industry usually uses y =hash(x) means that this hash function realizes the hash value y of computing x.
Commonly used hash algorithms include MD5, SHA-1, SHA-256, SHA-384, SHA-512, etc. Taking the SHA256 algorithm as an example, input any data into SHA256 and you will get a 256-bit Hash value (hash value). Its characteristics: the same data input will get the same result. The input data changes a little (for example, 1 becomes 0) will get completely different results. The result is that the forward calculation (the Hash value corresponding to the data calculation) is very simple. The reverse calculation is extremely difficult and is considered impossible under the current scientific and technological conditions.
Core technology 3. Merkle tree:
Merkle tree is a hash binary tree that can quickly verify the integrity of large-scale data. In the blockchain network, Merkle_黄髂jumimiofuzhenglu The weapon is the gray boy's side_the Zhang is inciting the firewood boy's bank⒌The resistance is still V's burden and the oar is fishy Wei is the gray boy's bank⒌The plan is to seek out the Ji's plan_erkle Trees.
Core technology 4. Asymmetric encryption algorithm:
Asymmetric encryption algorithm is a key confidentiality method that requires a key and a key. The public key and the private key are a pair. If you use the public key to encrypt data, you can only use the corresponding private key. Decrypt and obtain the corresponding datavalue. If you use a private key to sign data, you can only use the corresponding public key to verify the signature. The sender of the verification information is the owner of the private key.
Since encryption and decryption use two different keys, The algorithm is called an asymmetric encryption algorithm, while symmetric encryption uses the same key in the encryption and decryption process.
Blockchain mitigation technology - network layer: achieving centralization of charging nodes
Core technology 5, P2P network:
P2P network (peer-to-peer network), also known as point-to-point technology, is an Internet system without a central server and user groups exchanging information. It is different from a central network with a central server The systems are different. Each client in the peer-to-peer network is a node and also has the function of a server. Domestic Xunlei software uses P2P technology. The P2P network has the characteristics of centralization and reinforcement.
Blockchain technology-consensus layer :Deploying the task load of charging nodes
『二』What is the core technology of blockchain
First of all, we can take a look at the official website explanation of blockchain technology. In a narrow sense, blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is a cryptographically guaranteed distributed ledger that cannot be tampered with or forged.
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 the security of data transmission and access. A new distributed infrastructure and computing paradigm that uses smart contracts composed of automated script code to program and manipulate data.
As everyone may know, blockchain technology is an underlying architecture independent of the Bitcoin system. From an architectural model perspective, it is a set of distributed ledgers. The so-called ledger is naturally used to record Account.
In blockchain technology, in order to generate accounting records, there must be transactions and flows of funds. Therefore, the initial blockchain technology has the cryptocurrency corresponding to its main network as a circulating item. , the circulation transaction records of cryptocurrency between various accounts on the blockchain main network will be recorded on the main network.
Different from other transaction record databases, transaction records on the blockchain technology mainnet will be recorded on all block nodes (i.e. all data blocks) in the mainnet. This is The so-called decentralization principle means that in blockchain technology, there is no central database to save all records. Each block on the chain has transaction data for the entire chain, that is, every data block , are all centers.
Another characteristic of blockchain technology is that it cannot be tampered with, because every transaction on the blockchain will be recorded in all blocks on the chain, so no single data block can be changed. Record, even if you change it, the real data will be recorded in all other data blocks, and each set of data can be traced back to when it first appeared.
Because of these characteristics of blockchain technology, after the advent of Bitcoin, blockchain has also received a lot of attention, and many people have begun to want to use blockchain technology to create uncentered, traceable, and unchangeable data to ensure the credibility of the data. Spend.
However, blockchain technology also faces many problems, such as a single application scenario, native erroneous data that cannot be modified, and currencies stolen by hackers that cannot be recovered.
『三』What is blockchain technology? What exactly is blockchain?
In a narrow sense, blockchain is a way to store data in a chronological order. A chained data structure composed of blocks connected in sequence, and a cryptographically guaranteed distributed ledger that cannot be tampered with or forged.
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.
[Infrastructure]
Generally speaking, the blockchain system consists of data layer, network layer, consensus layer, incentive layer, contract layer and application layer composition. Among them, the data layer encapsulates the underlying data blocks and related basic data and basic 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.
Extended information:
[Blockchain core technology]
Blockchain mainly solves the trust and security issues of transactions, so it addresses this issue Four technological innovations:
1. Distributed ledger means that transaction accounting is completed by multiple nodes distributed in different places, and each node records a complete account, so they all Can participate in supervising the legality of transactions and can also jointly testify for them.
The uniqueness of blockchain's distributed storage is mainly reflected in two aspects: First, each node of the blockchain stores complete data according to the block chain structure. Traditional distributed storage generally stores The data is divided into multiple parts for storage according to certain rules. Second, the storage of each node in the blockchain is independent and has equal status, relying on the consensus mechanism to ensure the consistency of storage, while traditional distributed storage generally synchronizes data to other backup nodes through the central node.
No node can record accounts independentlyThis data avoids the possibility of a single bookkeeper being controlled or bribed to keep false accounts. Also because there are enough accounting nodes, theoretically speaking, the accounts will not be lost unless all nodes are destroyed, thereby ensuring the security of the accounting data.
2. Asymmetric 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.
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". "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.
4. Smart contracts. Smart contracts are based on these trustworthy and non-tamperable data and can automatically execute some predefined rules and terms. 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 automate claims settlement in some standardized insurance products.
In the daily business of insurance companies, although transactions are not as frequent as those in the banking and securities industries, the reliance on trusted data continues unabated. Therefore, the author believes that using blockchain technology from the perspective of data management can effectively help insurance companies improve their risk management capabilities. Specifically speaking, it is mainly divided into risk management of policyholders and risk supervision of insurance companies.
Blockchain-Network
『四』 What is blockchain technology? What are the core components of blockchain technology
What is blockchain technology? What are the core components of blockchain technology? What is blockchain technology:
Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. 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. The blockchain is a series of data blocks generated using cryptographic methods. Each data block contains information about a Bitcoin network transaction and is used to verify the validity of its information (anti-counterfeiting) and generate the next block.
The core components of blockchain technology:
Blockchain mainly solves the trust and security issues of transactions, so it proposes four technological innovations to address this issue:
The first is called distributed ledger, which means that transaction accounting is performed by multiple accounts distributed in different places. nodes complete it together, 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. Traditional distributed storage generally divides data into multiple parts for storage according to certain rules. Second, the storage of each node in the blockchain is independent and has equal status, relying on the consensus mechanism to ensure the consistency of storage, 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 speaking, the accounts will not be lost unless all nodes are destroyed, thereby ensuring the security of the accounting data.
The second one is called asymmetric encryption and authorization technology. The transaction information stored on the blockchain is public, but the account identity information is highly encrypted and can only be accessed with the authorization of the data owner. This ensures data security and personal privacy.
The third one is called the consensus mechanism, which 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". "The minority obeys the majority" does not entirely refer to the number of nodes, but can also be computing power, the number of shares, or other factors. A characteristic quantity that a 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. [8]
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.
The last technical feature is called smart contracts. Smart contracts are based on these trustworthy and non-tamperable data and can automatically execute some predefined rules and terms. 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 automate claims settlement in some standardized insurance products.
Daily life in an insurance companyIn business, although transactions are not as frequent as those in the banking and securities industries, the reliance on trusted data continues unabated. Therefore, the author believes that using blockchain technology from the perspective of data management can effectively help insurance companies improve their risk management capabilities. Specifically speaking, it is mainly divided into risk management of policyholders and risk supervision of insurance companies.
Chongqing Jinwowo Analysis: The consensus mechanism is the core of blockchain technology. The consensus mechanism largely determines the degree of mutual trust between nodes in the entire blockchain system, and also determines other users’ views on the blockchain. The degree of trust in online data
What is the core component of blockchain technology? Analysis by Chongqing Jinwowo: Blockchain technology consists of three core technologies: consensus mechanism, common defense mechanism, and distributed storage.
The three core technologies are supported by machine trust, that is, through the support of network technology, breakthroughs in difficult problems such as point-to-point transaction, decentralization, non-tampering of recorded information, irreversible transactions, and information encryption are achieved through network technology support.
The development of blockchain technology is becoming more and more prosperous with the continuous expansion of applications. This powerful development force coming from the needs of various industries has caused rapid changes in blockchain technology, allowing various industries to achieve great results. The results are attracting more and more attention, and professional technologies and resources are constantly concentrated in this industry, thus bringing the development of blockchain technology to a new stage, and the impact of this development of blockchain technology has also much attention.
When talking about blockchain technology, Bitcoin has to be mentioned. Many people know that the electronic currency Bitcoin does not rely on the issuance of a specific monetary institution, but is generated through a large number of calculations by a specific algorithm. In fact, the core that truly supports Bitcoin is blockchain technology.
How does the invisible and intangible Bitcoin operate through blockchain technology? The interpretation circulated in the industry is that blockchain can be regarded as a technical solution for collectively maintaining reliable databases through "decentralization" and "trustlessness". In layman’s terms, this technology can be understood as a technology in which everyone participates in accounting. In the past, people used centralized servers to keep accounts, but in the blockchain technology system, everyone can participate in accounting and jointly identify Authenticity of records.
"Through this technology, even if there is no neutral third-party organization, two parties that do not trust each other can achieve cooperation. In short, the blockchain is like a 'machine that creates trust.'" Bubi Company It is a leading blockchain service provider in China and has made many breakthroughs in the blockchain technology platform. It can meet scenarios with tens of millions of users and has the ability to quickly build upper-layer application businesses.
The blockchain technology used by all parties involved in recording and storing information adopts a decentralized distributed structure, which saves a lot of intermediary costs and can better ensure data security; at the same time, it has a time stamp that cannot be tampered with. It can effectively solve problems such as data tracking and information anti-counterfeiting.
Will it become the next trend of Internet finance?
Although blockchain emerged with Bitcoin, the derived value of this technology has transcended digital currency. Bubi Blockchain focuses on the innovation of blockchain technology and products. It already possesses a number of core technologies and has developed its own blockchain service platform. With decentralized trust as the core, we are committed to building an open value circulation network to allow digital assets to flow freely. What Bubi wants to do is to create a new technology and product - to realize real value circulation and bring the Internet to a new level. With the application of this technology, there will be no central organization when transferring assets, and direct transfer of assets between us can be achieved.
In the current international financial market, the U.S. Central Bank, Swiss Bank, and some insurance and futures companies are all competing to develop blockchain technology. Fang Liang introduced that in the Internet financial industry, blockchain technology will first affect financial infrastructure such as payment systems, securities settlement systems, and transaction databases; later, the technology will also expand to general financial services, such as credit systems and "anti-money laundering" "wait.
"The payment and clearing system in the financial field will evolve towards decentralization. The electronic ledger supported by blockchain technology is a reliable system that is error-free and cannot be tampered with. It has various functions for payment, clearing, transaction, confirmation of rights, etc. A profound impact," Li Yan said.
Therefore, industry insiders believe that blockchain technology may be the next trend in the Internet financial industry. As the interconnection of all things deepens, Yang Tao, assistant director of the Institute of Finance, Chinese Academy of Social Sciences, also said that blockchain will make it possible for all individuals to become important nodes in the allocation of financial resources, and will also promote the improvement of existing financial system rules. Build a shared and win-win financial development ecosystem.
Blockchain technology will affect many industries
"Blockchain technology has been widely used in the era of big data." Li Yan said frankly that in addition to the Internet financial field, blockchain technology has been used in many industries. It has been applied in many fields and has shown great prospects.
For example, the healthcare industry has benefited greatly from blockchain technology. In reality, patient private information leaks often occur, and centralized database or file cabinet management in medical departments is no longer the optimal choice. Medical institutions are using blockchain technology to keep patients' private information confidential.
In addition, blockchain technology also has important legal implications. In some civil fields, it is often necessary to provide evidence to determine blame, and blockchain technology can record every step and help judicial authorities identify the specific responsible person.
"Especially in the field of assets, whether it is physical assets such as real estate and cars, or intangible assets such as health and reputation, this technology can be used to complete registration, transactions, and tracking. It can be said that any production and life that lacks trust In all fields, blockchain technology will have its place.”
The development of blockchain technology has also brought about changes in the operational concepts of various industries. New technologies and new concepts have promoted new developments in various industries.development, this driving force has a huge impact on society and the promotion of economic activities. Many new industry phenomena will occur one after another, and the public is also waiting and watching, looking forward to this brand-new technology being used by various industries to better benefit everyone. industry.
The so-called blockchain technology, also known as distributed ledger technology, is an Internet database technology that is characterized by decentralization. , open and transparent, allowing everyone to participate in database records.
Explained in layman’s terms: If the database is assumed to be a ledger, reading and writing the database can be regarded as a bookkeeping behavior. The principle of blockchain technology is to find out the fastest and best bookkeeping within a period of time. This person will keep accounts, and then send this page of information to everyone else in the entire system. This is equivalent to changing all the records in the database and sending them to every other node in the entire network, so blockchain technology is also called a distributed ledger.
What is the core technology of Jinwowo blockchain technology?
Chongqing Jinwowo analyzes the core technologies of blockchain technology as follows:
Distributed ledger technology, asymmetric encryption technology and smart contracts.
The core of the blockchain is that it stores all information in an independent personal computer network, making it a decentralized and distributed structure.
This means that the system is not owned by a controlling company or person, but that everyone can use and run the system.
I specifically checked the information to answer your question! Renren blockchain service allows users to quickly build their own IT infrastructure and blockchain services on a flexible and open cloud platform. Using BaaS can greatly reduce the cost of implementing the underlying technology of the blockchain, simplify the construction and operation and maintenance of the blockchain, and at the same time, face the scenarios in various industry fields, meet the personalized needs of users, and quickly deliver customized BaaS in one stop. Hope to adopt
What is blockchain technology?Blockchain has been hyped up like crazy, but you know nothing about it!
Blockchain is a distributed database system participated by different nodes and an open ledger system.
It consists of a series of data blocks or data packets generated according to cryptographic methods, that is, blocks. Each block of data information is automatically timestamped, thus Calculate a data encryption value, that is, a hash value (hash).
Blockchain technology is essentially a distributed accounting technology. It allows everyone to have an instantly synchronized ledger in their hands. Every transaction that occurs in the entire network will have thousands of backups and synchronous records. The perpetrator attempted to tamper with the ledgerData must change the ledger in the hands of most people to achieve its purpose.
『Wu』What is the core technology of blockchain
To put it simply, blockchain is a distributed database that provides Byzantine fault tolerance and ensures ultimate consistency; From the data structure point of view, it is a chained data block structure based on time series; from the node topology point of view, all its nodes are redundant backups of each other; from the operation point of view, it provides a public and private key management system based on cryptography to manage the account.
Perhaps the above concept is too abstract, let me give you an example so that you can understand it easier.
You can imagine that there are 100 computers distributed around the world. The network between these 100 machines is a wide area network, and the owners of these 100 machines do not trust each other.
So, what kind of algorithm (consensus mechanism) do we use to provide it with a trustworthy environment and make:
The data exchange process between nodes cannot be tampered with, and the generated historical records It cannot be tampered with;
The data of each node will be synchronized to the latest data, and the validity of the latest data will be verified;
Based on the principle of the minority obeying the majority, the data maintained by the overall node can objectively reflect the exchange history.
Blockchain is a technical solution created to solve the above problems.
2. The core technology components of blockchain
Whether it is a public chain or a consortium chain, it requires at least four modules: P2P network protocol, distributed consistency algorithm (consensus mechanism), encryption signature algorithm, Account and storage model.
1. P2P network protocol
P2P network protocol is the lowest module of all blockchains and is responsible for network transmission and broadcast of transaction data, node discovery and maintenance.
Usually what we use is the Bitcoin P2P network protocol module, which follows certain interaction principles. For example: when connecting to other nodes for the first time, you will be required to confirm the status according to the handshake protocol. After the handshake, you will start to request the address data and block data of the Peer node.
This P2P interactive protocol also has its own set of instructions, which are reflected in the command field of the Message Header. These commands provide the upper layer with node discovery, node acquisition, block header acquisition, Block acquisition and other functions, these functions are very low-level and very basic functions. If you want to learn more, you can refer to the Peer Discovery chapter in the Bitcoin Developer Guide.
2. Distributed consensus algorithm
In the field of classic distributed computing, we have non-Byzantine fault-tolerant algorithms represented by the Raft and Paxos algorithm families, as well as the PBFT consensus algorithm with Byzantine fault-tolerant characteristics.
If we look at it from the perspective of technological evolution, we can draw a diagram in which blockchain technology transforms the originalDistributed algorithms have been expanded in economics.
In the picture, we can see that computer applications were mostly single-point applications at the beginning, and cold disaster recovery was used for high availability and convenience. Later, they developed into multi-active in different places. These multi-active in different places may use load balancing. and routing technology. With the development of distributed system technology, we have transitioned to distributed systems based on Paxos and Raft.
In the field of blockchain, PoW workload proof algorithm, PoS equity proof algorithm, and DPoS proxy equity proof algorithm are mostly used. The above three are the mainstream consensus algorithms in the industry. These algorithms are similar to the classic distributed consensus algorithm. The difference is that they incorporate the concept of economic games. Below I will briefly introduce these three consensus algorithms respectively.
PoW: Usually refers to solving a mathematical problem of specific difficulty under given constraints. Whoever solves it faster can obtain the right to bookkeeping (block production). This solution process is often converted into a calculation problem, so when competing for speed, it becomes who has a better calculation method and whose equipment has better performance.
PoS: This is a proof-of-stake mechanism. Its basic concept is that the difficulty of generating a block should be proportional to your stake (ownership ratio) in the network. The core idea of its implementation is: Use the coin age (CoinAge) of your locked tokens and a small proof of work to calculate a target value. When the target value is met, you will be able to obtain accounting rights.
DPoS: A simple understanding is to convert the bookkeepers in the PoS consensus algorithm into a small circle composed of a specified number of nodes, instead of everyone can participate in bookkeeping. This circle may have 21 nodes or 101 nodes, depending on the design. Only nodes in this circle can obtain accounting rights. This will greatly improve the throughput of the system, because fewer nodes means that the network and nodes are controllable.
3. Encrypted signature algorithm
In the field of blockchain, the most commonly used hash algorithm is the hash algorithm. The hash algorithm has the characteristics of collision resistance, irreversibility of the original image, and problem friendliness.
Among them, problem friendliness is the basis for the existence of many PoW currencies. In Bitcoin, the SHA256 algorithm is used as the calculation method for proof of work, which is what we call the mining algorithm.
In Litecoin, we will also see the Scrypt algorithm, which is different from SHA256 in that it requires large memory support. In some other currencies, we can also see mining algorithms based on the SHA3 algorithm. Ethereum uses an improved version of the Dagger-Hashimoto algorithm, named Ethash, which is an IO-intractable algorithm.
Of course, in addition to the mining algorithm, we will also use the RIPEMD160 algorithm, which is mainly used to generate addresses. Numerous Bitcoin derivativesMost of the code adopts Bitcoin address design.
In addition to addresses, we will also use the core and the cornerstone of the blockchain Token system: public and private key cryptographic algorithms.
In the Bitcoin code, ECDSA is basically used. ECDSA is a combination of ECC and DSA. The entire signature process is similar to DSA. The difference is that the algorithm used in the signature is ECC (Elliptic Curve Function).
Technically, we start by generating a private key, then generate a public key from the private key, and finally generate an address from the public key. Each of the above steps is an irreversible process, which means that the public key cannot be derived from the address. , derived from the public key to the private key.
4. Account and transaction model
From the initial definition, we know that blockchain can be considered a distributed database from a technical perspective only. So, what type of database do most blockchains use? What about the database?
When I designed the Metaverse blockchain, I referred to a variety of databases, including NoSQL’s BerkeleyDB and LevelDB, and some currencies use SQL-based SQLite. As the underlying storage facilities, most of them are lightweight embedded databases. Since they do not involve the ledger characteristics of the blockchain, these storage technologies are no different from those used in other situations.
The ledger characteristics of blockchain are usually divided into UTXO structure and ledger structure based on Accout-Balance structure, which we also call the ledger model. UTXO is the abbreviation of "unspent transaction input/output", which translated means "unspent transaction input/output".
This is an accounting mode for Token transfer in the blockchain. Each transfer appears in the form of input and output; in the Balance structure, there is no such mode.
『Lu』 Six core algorithms of blockchain technology
Six core algorithms of blockchain technology
Blockchain core algorithm one: Byzantine Agreement
The story of Byzantium probably goes like this: The Byzantine Empire has huge wealth, and its 10 neighboring countries have been around for a long time. However, Byzantium’s high walls are towering and impregnable, and no single neighbor can successfully invade. Any invasion by a single neighbor will fail, and it is also possible that it will be invaded by 9 other neighbors. The Byzantine Empire's defensive capabilities were so strong that at least half of its ten neighbors had to attack at the same time to be able to break through. However, if one or several of the neighbors agree to attack together, but betrayal occurs during the actual process, then the invaders may all be annihilated. So each party acted cautiously and did not dare to trust its neighbors easily. This is the Byzantine Generals Problem.
In this distributed network: each general has a message ledger that is synchronized with other generals in real time. There is every one in the ledgerThe general's signature can be used to verify identity. If any messages are inconsistent, you can know which generals the messages are inconsistent with. Even if there is inconsistent information, as long as more than half agree to attack, the minority obeys the majority, and a consensus is reached.
Thus, in a distributed system, although there are bad guys, bad guys can do anything (not restricted by the protocol), such as not responding, sending error messages, sending different decisions to different nodes, and combining different wrong nodes. Get up and do bad things, etc. However, as long as most people are good people, it is entirely possible to achieve consensus in a decentralized manner
Blockchain Core Algorithm 2: Asymmetric Encryption Technology
In the above Byzantine Agreement, if one of the 10 generals Several messages initiated at the same time will inevitably cause chaos in the system, causing each to have its own attack time plan, making it difficult to act in a consistent manner. Anyone can initiate offensive information, but who will send it? In fact, this only requires adding a cost, that is: only one node can spread the information within a period of time. When a node sends a unified attack message, each node must sign and stamp the message from the initiator to confirm their identity.
It seems today that asymmetric encryption technology can completely solve this signature problem. The asymmetric encryption algorithm uses two different keys for encryption and decryption. These two keys are the "public key" and "private key" that we often hear. Public keys and private keys generally appear in pairs. If a message is encrypted with a public key, the private key corresponding to the public key is required to decrypt it; similarly, if a message is encrypted with a private key, the public key corresponding to the private key is required to decrypt it.
Blockchain Core Algorithm Three: Fault Tolerance Issue
We assume that in this network, messages may be lost, damaged, delayed, sent repeatedly, and the order received is inconsistent with the order sent. In addition, the behavior of nodes can be arbitrary: they can join and exit the network at any time, they can discard messages, forge messages, stop working, etc. Various human or non-human failures may also occur. Our algorithm provides excellent fault tolerance for a consensus system composed of consensus nodes. This fault tolerance includes both security and availability, and is applicable to any network environment.
Blockchain core algorithm 4: Paxos algorithm (consensus algorithm)
The problem solved by the Paxos algorithm is how a distributed system can reach agreement on a certain value (resolution). A typical scenario is that in a distributed database system, if the initial state of each node is consistent and each node performs the same sequence of operations, then they can finally obtain a consistent state. In order to ensure that each node executes the same command sequence, a "consistency algorithm" needs to be executed on each instruction to ensure that the instructions seen by each node are consistent. A general consensus algorithm can be applied in many scenarios and is an important issue in distributed computing. There are two models for node communication: shared memory and message passing. The Paxos algorithm is a consensus algorithm based on the message passing model.
BlockChain Core Algorithm Five: Consensus Mechanism
The blockchain consensus algorithm is mainly proof of work and proof of equity. Taking Bitcoin as an example, in fact, from a technical point of view, PoW can be regarded as reused Hashcash. Generating proof of work is a random process in terms of probability. To mine a new confidential currency, when generating a block, all participants must agree, and the miner must obtain PoW proof of work for all data in the block. At the same time, miners must constantly observe and adjust the difficulty of this work, because the network requirement is to generate a block every 10 minutes on average.
Blockchain Core Algorithm 6: Distributed Storage
Distributed storage is a data storage technology that uses the disk space on each machine through the network and combines these dispersed storage resources into a virtual Storage devices, data are stored dispersedly in every corner of the network. Therefore, distributed storage technology does not store complete data on each computer, but splits the data and stores it in different computers. It's like storing 100 eggs, not in the same basket, but in different places. The total sum is 100.
『撒』 What is the core technology of blockchain
Introduction to the 7 core technologies of blockchain operation
2018-01-15
1. Blockchain links
As the name suggests, blockchain is a chain composed of blocks. Each block is divided into two parts: block header and block body (including transaction data). The block header includes the hash (PrevHash) value (also called hash value) of the previous block used to implement block linking and the random number (nonce) used to calculate the mining difficulty. The hash value of the previous block is actually the hash value of the header of the previous block, and the rules for calculating random numbers determine which miner can obtain the power to record the block.
2. Consensus Mechanism
Blockchain was born with Bitcoin and is the basic technical architecture of Bitcoin. Blockchain can be understood as a decentralized accounting system based on the Internet. A decentralized digital currency system like Bitcoin requires blockchain to ensure the consistency of accounting by each honest node without a central node. Therefore, the core of blockchain technology is a consensus mechanism that reaches a consensus on the legality of transactions among individuals who have no basis for trust in each other without central control.
There are currently four main categories of blockchain consensus mechanisms: PoW, PoS, DPoS, and distributed consensus algorithms.
3. Unlocking script
Script is an important technology for automatic verification and automatic execution of contracts on the blockchain. Each output of each transaction does not strictly point to an address, but to a script. A script is like a set of rules that govern how the recipient can spend the assets locked on this output.
The legality verification of transactions also relies on scripts. Currently it relies on two types of scripts: locking scripts and unlocking scripts. The lock script is inThe conditions added to the output transaction are implemented through a script language and are located at the output of the transaction. The unlocking script corresponds to the locking script. Only if the conditions required by the locking script are met, the corresponding assets on this script can be spent, which is located at the input of the transaction. Many flexible conditions can be expressed through scripting languages. The interpretation script is similar to a "virtual machine" in our programming field, which is distributed and runs on every node in the blockchain network.
4. Transaction Rules
Blockchain transactions are the basic units that constitute blocks, and are also the actual effective content that the blockchain is responsible for recording. A blockchain transaction can be a transfer or other transactions such as the deployment of smart contracts.
In the case of Bitcoin, a transaction refers to a payment transfer. The transaction rules are as follows:
1) The input and output of the transaction cannot be empty.
2) For each input of the transaction, if its corresponding UTXO output can be found in the current transaction pool, the transaction will be rejected. Because the current transaction pool is a transaction that has not been recorded in the blockchain, and each input of the transaction should come from a confirmed UTXO. If found in the current transaction pool, it is a double spend transaction.
3) For each input in the transaction, its corresponding output must be UTXO.
4) Each input unlocking script (unlocking
) must work with the corresponding output locking script (locking
) to verify the compliance of the transaction.
5. Transaction priority
The priority of blockchain transactions is determined by the blockchain protocol rules. For Bitcoin, the priority of a transaction being included in a block is determined by the time it takes for the transaction to be broadcast to the network and the size of the transaction. As the time it takes for a transaction to be broadcast to the network increases and the chain age of the transaction increases, the priority of the transaction is increased and will eventually be included in the block. For Ethereum, the priority of a transaction is also related to the transaction fee that the publisher of the transaction is willing to pay. The higher the transaction fee that the publisher is willing to pay, the higher the priority of the transaction being included in the block.
6.Merkle proof
The original application of Merkle proof is the Bitcoin system (Bitcoin), which was described and created by Satoshi
Nakamoto in 2009. The Bitcoin blockchain uses Merkle proofs in order to store transactions in every block. This makes the transaction unable to be tampered with and makes it easy to verify whether the transaction is included in a specific block.
7.RLP
RLP (Recursive
Length
Prefix, recursive length prefix encoding) is a main encoding method for object serialization in Ethereum. Its purpose is to encode any nested A sequence of binary data is encoded.
『8』 What are the core blockchain technologies of blockchain technology?
The most popular interaction at the momentYou don’t need to tell me what the topic of networking is. It’s blockchain technology. However, many friends have only heard of this technology and don’t have much in-depth understanding of it. So what are the blockchain technologies? Below we will bring you an introduction to the core technology of blockchain for your reference.
What are the core elements of blockchain technology?
Blockchain technology can be a public ledger (visible by anyone) or a permissioned network (visible only by those authorized), which solves supply chain challenges , because it is an immutable record that is shared among network participants and updated in real time.
Blockchain technology----data layer: designing the data structure of the ledger
Core technology 1. Block + chain:
Technically speaking, block is a data structure that records transactions. Reflects the flow of funds for a transaction. The blocks of transactions that have been reached in the system are connected together to form a main chain, and all nodes participating in the calculation record the main chain or part of the main chain.
Each block consists of a block header and a block body. The block body is only responsible for recording all transaction information in the previous period, mainly including the number of transactions and transaction details; the block header encapsulates the current version number, previous A block address, timestamp (recording the time when the block was generated, accurate to seconds), random number (recording the value of decrypting the answer to the math question related to the block), target hash value of the current block, and Merkle number Root value and other information. From a structural point of view, most functions of the blockchain are implemented by the block header.
Core technology 2. Hash function:
The hash function can convert data of any length into a set of fixed-length codes through the Hash algorithm. The principle is based on a cryptographic one-way hash function. This kind of function is easy to verify, but difficult to crack. Usually, the industry uses y=hash(x) to represent it. This hash function implements operations on x to calculate a hash value y.
Commonly used hash algorithms include MD5, SHA-1, SHA-256, SHA-384 and SHA-512, etc. Taking the SHA256 algorithm as an example, inputting any string of data into SHA256 will result in a 256-bit Hash value (hash value). Its characteristics: the same data input will get the same result. As long as the input data changes slightly (for example, a 1 becomes a 0), a completely different result will be obtained, and the result cannot be predicted in advance. Forward calculation (calculating the corresponding Hash value from the data) is very easy. Reverse calculation (cracking) is extremely difficult and is considered impossible under current technological conditions.
Core technology 3. Merkle tree:
Merkle tree is a hash binary tree, which can be used to quickly verify the integrity of large-scale data. In the blockchain network, the Merkle tree is used to summarize all transaction information in a block, and ultimately generates a unified hash value of all transaction information in the block. Any change in transaction information in the block will cause Merkle tree modificationChange.
Core technology 4. Asymmetric encryption algorithm:
Asymmetric encryption algorithm is a key secret method that requires two keys: public key and private key. The public key and the private key are a pair. If the public key is used to encrypt the data, only the corresponding private key can be used to decrypt it, thereby obtaining the corresponding data value; if the private key is used to sign the data, then only the corresponding public key can be used to sign the data. In order to verify the signature, the sender of the verification information is the holder of the private key.
Because encryption and decryption use two different keys, this algorithm is called an asymmetric encryption algorithm, while symmetric encryption uses the same key in the encryption and decryption processes.
Blockchain technology----network layer: realize the decentralization of accounting nodes
Core technology 5. P2P network:
P2P network (peer-to-peer network), also known as point-to-point technology, is no Central server, Internet system that relies on user groups to exchange information. Unlike a centralized network system with a central server, each client in a peer-to-peer network acts as both a node and a server. Domestic Xunlei software uses P2P technology. The P2P network has the characteristics of decentralization and robustness.
Blockchain technology----Consensus layer: allocate the task load of accounting nodes
Core technology 6. Consensus mechanism:
Consensus mechanism is how to reach consensus among all accounting nodes to identify The validity of a record is both a means of identification and a means of preventing tampering. There are currently four main types of consensus mechanisms: PoW, PoS, DPoS and distributed consensus algorithms.
PoW (Proof of Work, proof of work): PoW mechanism, which is like Bitcoin’s mining mechanism, miners package existing transactions that have not been recorded by the network into a block, and then continue to traverse and try to find a random number , so that the hash value of the new block plus the random number meets certain difficulty conditions. Finding a random number that meets the conditions is equivalent to determining the latest block of the blockchain, and is also equivalent to obtaining the current round of accounting rights of the blockchain. Miners broadcast blocks that meet the mining difficulty conditions in the Yuanfu network. After verifying that the block meets the mining difficulty conditions and that the transaction data in the block meets the protocol specifications, other nodes in the entire network will each Blocks are linked to their own version of the blockchain, thereby forming a network-wide consensus on the current network state.
PoS (ProofofStake, Proof of Stake): PoS mechanism requires nodes to provide proof of a certain number of tokens to obtain a distributed consensus mechanism for competing for blockchain accounting rights. If you rely solely on the token balance to determine the bookkeeper, you will inevitably make the rich win, which will lead to the centralization of bookkeeping rights and reduce the fairness of the consensus. Therefore, different PoS mechanisms use different methods to increase the amount of money based on the proof of equity. The randomness of accounting rights avoids centralization. For example, in the PeerCoin PoS mechanism, the Bitcoin with the longest chain age has a greater chance of obtaining accounting rights. NXT and Blackcoin uses a formula to predict the next accounting node. The more tokens you own, the greater the probability of being selected as an accounting node. In the future, Ethereum will also switch from the current PoW mechanism to a PoS mechanism. Judging from the information currently available, Ethereum's PoS mechanism will use nodes to place bets on the next block. The winner of the bet will receive an additional Ethereum currency award. Those who do not win will be deducted Ether coins to reach consensus on the next block.
DPoS (DelegatedProof-Of-Stake, share authorization certificate): DPoS is easy to understand and is similar to the modern corporate board of directors system. The DPoS mechanism adopted by BitShares is that shareholders vote to select a certain number of witnesses. Each witness has two seconds of authority to generate blocks in order. If the witness cannot generate a block within the given time slice, The block generation authority is given to the witness corresponding to the next time slice. Shareholders can replace these witnesses at any time by voting. This design of DPoS makes the generation of blocks faster and more energy-saving.
Distributed Consistency Algorithm: Distributed Consistency Algorithm is based on traditional distributed consistency technology. Among them are Byzantine fault-tolerant algorithms that solve the Byzantine Generals problem, such as PBFT (Byzantine fault-tolerant algorithm). In addition, distributed consensus algorithms (Pasox, Raft) that solve non-Byzantine problems are not explained in this article. This type of algorithm is currently a commonly used consensus mechanism in alliance chain and private chain scenarios.
Taken together, POW is suitable for public chains. If you build a private chain, it is more suitable to use POS because there is no trust problem in verification nodes; and because there are untrustworthy local nodes in the alliance chain, it is more suitable to use DPOS.
Blockchain technology----Incentive layer: Develop a "salary system" for accounting nodes
Core technology 7. Issuance mechanism and incentive mechanism:
Take Bitcoin as an example. Bitcoins are initially rewarded by the system to miners who create new blocks, and this reward is halved approximately every four years. At the beginning, miners were rewarded with 50 Bitcoins for each new block recorded, and this reward is halved approximately every four years. By analogy, by around AD 2140, newly created blocks will no longer receive rewards from the system. By then, the total number of Bitcoins will be approximately 21 million. This is the total number of Bitcoins, so it will not increase indefinitely.
Another source of incentives is transaction fees. When there are no system rewards for newly created blocks, the miners' income will change from system rewards to transaction fees. For example, when you transfer, you can specify 1% of it as a handling fee to be paid to the miner who records the block. If the output value of a transaction is less than the input value, the difference is the transaction fee, which will be added to the incentive for that block. As long as a given amount of electronic currency has entered circulation, the incentive mechanism can gradually be converted to rely entirely on transaction fees, so there is no need to issue new currency.
Blockchain technology----Contract layer: giving the ledger programmable features
Core technology 8. Smart contract:
Smart contract is a set of scenario-based programsThe rules and logic are implemented through decentralized, trustworthy and shared script codes deployed on the blockchain. Normally, after the smart contract is signed by all parties, it is attached to the blockchain data in the form of program code, and is recorded in a specific block of the blockchain after being propagated through the P2P network and verified by nodes. Smart contracts encapsulate a number of predefined states and transition rules, scenarios that trigger contract execution, response actions under specific scenarios, etc. The blockchain can monitor the status of smart contracts in real time, and activate and execute the contract by checking external data sources and confirming that specific trigger conditions are met.
The above is what blockchain technologies the editor has brought to you? All content of the introduction to the core technology of blockchain.