Password used by blockchain 6
bitcoin, Ruitai coin, Laite coin, Ethereum and other digital cryptocurrencies all use blockchain technology
blockchain is an important concept of bitcoin, which is essentially a decentralized database and the underlying technology of bitcoin. Blockchain is a series of data blocks generated by cryptography. Each data block contains the information of a bitcoin network transaction, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.
I have seen your question. In which aspects can blockchain be applied? Below by the small series to answer for you
in the data layer, that is, the "distributed ledger", the data information on the blockchain is stored, and the blockchain structure, asymmetric encryption technology, hash algorithm and other technical means of the block are encapsulated to ensure the security of the data in the case of the whole network being open. The specific method is:in the blockchain network, nodes use consensus algorithm to maintain the consistency of data layer (that is, the distributed database), and use asymmetric encryption and hash algorithm in cryptography to ensure the non usurpation and traceability of the distributed database
This constitutes the bottom data structure of blockchain technology. However, it is not enough to have a distributed database. We also need to let the data information in the database be shared and exchanged. Next, we will introce the upper layer of the data layer - the network layer
Second, network layer
the network system of blockchain is essentially a P2P (point-to-point) network. Point to point means that there is no need for an intermediate link or centralized server to control the system. All resources and services in the network are distributed in the hands of each node, and the transmission of information is also a direct communication between the two nodes. However, it should be noted that P2P
(peer-to-peer) was not invented by Nakamoto, and the blockchain only integrates this technology
therefore, the network layer of blockchain is actually a particularly powerful point-to-point network system. In this system, each node can not only proce information, but also receive information, just like sending e-mail. You can write your own e-mail, and you can also receive the e-mail sent to you by others
in the blockchain network, nodes need to jointly maintain the blockchain system. Every time a node creates a new block, it needs to notify other nodes in the form of broadcast. After receiving the information, other nodes verify the block, and then create a new block on the basis of the block. In this way, the whole network can jointly maintain and update the general ledger of the blockchain system
however, what rules should the whole network follow to maintain and update the general ledger of the blockchain system? This involves the so-called "laws and regulations" (rules), which we will introce next: the consensus layer
Third, consensus layer
in the world of blockchain, consensus simply means that the whole network should maintain and update the general ledger of blockchain system according to a unified and agreed rule, which is similar to the rule of updating data. It is one of the core technologies of blockchain and the governance mechanism of blockchain community to let highly dispersed nodes reach consensus efficiently in the decentralized blockchain network
at present, the mainstream consensus mechanism algorithms include: proof of work of bitcoin (POW), proof of rights and interests of Ethereum (POS), proof of rights and interests of EOS (dpos), etc
we now introce the data layer, network layer and consensus layer. These three layers ensure that there are data, networks and rules for updating data on the network. However, there is no free lunch in the world. How can nodes actively participate in the maintenance of the blockchain system? Here is the incentive layer, which we will introce next: incentive layer< 4. Incentive layer
incentive layer is the so-called mining mechanism, which can be understood as incentive mechanism: you can get as much reward as you contribute to the blockchain system. With this incentive mechanism, the whole network nodes can be encouraged to participate in the data recording and maintenance on the blockchain
mining mechanism and consensus mechanism are actually the same truth. Consensus mechanism can be understood as the company's general rules and regulations, while mining mechanism can be understood as the reward rules for what you do well in the general rules and regulations
just like the consensus mechanism POW of bitcoin, it stipulates that more work pays more. Whoever can find the correct hash value first can get a certain amount of bitcoin reward
and Ethereum's POS stipulates that the older the holder is, the more likely he or she will be rewarded
it should be noted that the incentive layer is generally only available for the public chain, because the public chain must rely on the nodes of the whole network to jointly maintain data, so there must be a set of incentive mechanism to encourage the nodes of the whole network to participate in the construction and maintenance of the blockchain system, so as to ensure the security and reliability of the blockchain system
the blockchain is safe and reliable, and it is not intelligent enough, right? The contract layer we will introce next can make the blockchain system more intelligent
v. contract layer
Contract layer mainly includes various scripts, codes, algorithm mechanisms and smart contracts, which is the basis of block chain programming. What we call "smart contract" is at the contract level
if the bitcoin system is not intelligent enough, the "smart contract" proposed by Ethereum can meet many application scenarios. The principle of the contract layer is to embed the code into the blockchain system, in this way to realize the smart contract that can be customized. In this way, on the blockchain system, once the terms of the smart contract are triggered, the system can automatically execute commands< Finally, the application layer. The application layer is very simple. As the name suggests, it is a variety of application scenarios and cases of blockchain. What we now call "blockchain +" is the so-called application layer. At present, the blockchain applications that have been implemented are mainly various blockchain applications built on
eth, EOS and other public chains. There are more applications of gambling and games, and the real practical applications have not yet appeared.
blockchain is composed of a series of blocks generated by cryptographic algorithm. Each block is filled with transaction records, and the blocks are connected in sequence to form a chain structure, which is the blockchain ledger
taking bitcoin as an example, when miners generate new blocks, they need to calculate the new hash value and random number according to the hash value of the previous block, the new transaction block and the random number. In other words, each block is generated on the basis of the previous block data, which ensures the uniqueness of the blockchain data
because subtle changes in transaction records will completely change the result of hash value, miners can't cheat when competing for computing power. Each miner must wait until the previous block is generated before starting to calculate the qualified random number according to the data of the previous block, which ensures the fairness of mining.
As an emerging technology, blockchain has attracted more and more attention. It is a new application of traditional technology in the Internet era, including distributed data storage technology, consensus mechanism and cryptography. With the establishment of various blockchain research alliances, more and more funds and personnel support related research. Hash algorithm, zero knowledge proof, ring signature and other cryptographic algorithms used in blockchain:
hash algorithm
as the basic technology of blockchain, the essence of hash function is to map a set of data of any length (limited) to a set of defined length data stream. If this function satisfies the following conditions:
(1) the calculation of hash value for any group of data is very simple
(2) it is difficult to find two different data with the same hash value
hash functions satisfying the above two properties are also called encrypted hash functions. In case of no contradiction, hash functions usually refer to encrypted hash functions. For the hash function, finding such that is called a collision. The current popular hash functions are MD5, SHA1, Sha2, Sha3
bitcoin uses sha256, and most blockchain systems use sha256 algorithm. So here's sha256< Step 1: additional filling bits. The length of the message is congruent with that of 448 mod512 (length = 448 mod512). The number of bits to be filled ranges from 1 to 512. The highest bit of the filled bit string is 1, and the rest bits are 0
Step2: additional length value. The bit length of the initial message (before filling) represented by 64 bit is appended to the result of step 1 (the low byte takes precedence)
Step3: initialize cache. A 256 bit cache is used to store the intermediate and final results of the hash function
Step 4: process 512 bit (16 word) packet sequence. The algorithm uses six basic logic functions and consists of 64 steps of iterative operation. Each step takes the 256 bit cache value as the input, and then updates the cache content. Each step uses a 32-bit constant KT and a 32-bit wt. Where WT is the packet after the packet, t = 1,2,..., 16
step5: after all 512 bit packets are processed, the output of the last packet of sha256 algorithm is 256 bit packet< In 2001, Rivest, Shamir and TauMan proposed ring signature for the first time. It is a simplified group signature, only ring members have no manager, and it does not need the cooperation between ring members. In the ring signature scheme, the signer first selects a temporary signer set, which includes signers. Then the signer can generate the signature independently by using his private key and the public key of others in the signature set without the help of others. Members of the signer collection may not know that they are included in it
ring signature scheme consists of the following parts:
(1) key generation. A key pair (public key PKI, private key ski) is generated for each member of the ring
(2) signature. The signer uses his private key and the public keys of any n ring members (including himself) to generate the signature a for the message M
(3) signature verification. According to the ring signature and message M, the verifier verifies whether the signature is signed by the member in the ring. If it is valid, it will be received, otherwise it will be discarded
ring signature satisfies the following properties:
(1) unconditional anonymity: the attacker can not determine which member of the ring generated the signature, even if the private key of the ring member is obtained, the probability is not more than 1 / n
(2) Correctness: the signature must be verifiable by all others
(3) unforgeability: other members of the ring can't forge the real signer's signature, and even if an external attacker obtains a valid ring signature, he can't forge a signature for message M
(1) anonymity. The verifier can verify that the signature is signed by a member of the group, but can't know which member it is, so that the signer can be anonymous< (2) traceability. In group signature, the existence of group administrator ensures the traceability of signature. The group administrator can revoke the signature and expose the real signer. The ring signature itself cannot reveal the signer unless the signer wants to expose or add additional information to the signature. A verifiable ring signature scheme is proposed. In this scheme, the real signer wants the verifier to know his identity. At this time, the real signer can confirm his identity by disclosing his secret information< (3) management system. Group signature is managed by group administrator, ring signature does not need to be managed, signer can only select a set of possible signers, obtain its public key, and then publish the set, all members are equalthe Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system< br />