区块链mdp是什么意思,区块链 存储空间
请查看相关英文文档
⑴Blockchain Technology
Background: After the birth of Bitcoin, it was discovered that the technology was very advanced, and blockchain technology was discovered. Bitcoin and blockchain technology were discovered at the same time.
1.1 The purpose of the birth of Bitcoin:
①Currency transactions have records, that is, ledgers;
②The disadvantages of centralized institution accounting - it can be tampered with; Yi Chaofa
Bitcoin solves the first problem: anti-tampering - hash function
1.2 hash function (encryption method)
① Function: convert any A string of length, converted to a fixed-length (sha256) output. The output is also called a hash value.
② Features: It is difficult to find two different x and y such that h(x)=h(y).
③Application: md5 file encryption
1.3 Blockchain
①Definition
Block: Split the general ledger into zones Block storage
Blockchain: On each block, add a block header. It records the hash value of the parent block. By storing the hash value of the parent block in each block, all blocks are connected in order to form a blockchain.
②How does the blockchain prevent transaction records from being tampered with?
After the blockchain is formed, tampering with any transaction will cause the hash value of the transaction block to be different from that of its sub-blocks. , tampering was discovered.
Even if you continue to tamper with the hash value in the sub-block header, the hash value in the sub-block will be different from that in the grandchild block, and the tampering will be discovered.
1.4 The essence of blockchain
①The essence of Bitcoin and blockchain: a big ledger visible to everyone, only recording transactions .
②Core technology: Through cryptographic hash function + data structure, it ensures that the ledger records cannot be tampered with.
③Core function: Create trust. Fiat currency relies on government credibility, and Bitcoin relies on technology.
1.5 How to trade
①To conduct transactions, you need an account number and password, corresponding to the public key and private key
Private key: a string of 256-bit binary numbers , you don’t need to apply for it, you don’t even need a computer, you can generate the private key by tossing a coin 256 times
The address is converted from the private key. The address cannot reverse the private key.
The address is the identity, which represents the ID in the Bitcoin world.
After an address is generated, it can only be known by everyone if it enters the blockchain ledger.
②Digital signature technology
Signature function sign (Zhang San’s private key, transfer information: Zhang San transferred 10 yuan to Li Si) = signature of this transfer
Verify Korean verify (Zhang San’s address, transfer information: Zhang San transfers 10 yuan to Li Si, signature of this transfer) = True
Zhang San uses his own private key through the signature function sign() key to sign this transaction.
Anyone can verify whether the signature was issued by Zhang San himself who holds Zhang San's private key by verifying the Korean vertify(). It returns true, otherwise it returns false.
sign() and verify() are cryptographically guaranteed not to be cracked. ·
③Complete the transaction
Zhang San will provide the transfer information and signature to the entire network. Under the premise that the account has a balance, after verifying that the signature is true, it will be recorded in the blockchain ledger. Once recorded, Zhang San's account will be reduced by 10 yuan, and Li Si's account will be increased by 10 yuan.
Supports one-to-one, one-to-many, many-to-one, and many-to-many transactions.
In the Bitcoin world, private keys are everything! ! !
1.6 Centralized Accounting
① Advantages of Centralized Accounting:
a. No matter which center keeps accounts, don’t worry too much
< p> b. Centralized accounting, high efficiency②Disadvantages of centralized accounting:
a Denial of service attack
b Stop service after getting tired
p>c Central institutions are vulnerable to attacks. For example, destroying servers and networks, committing self-intrusion, legal termination, government intervention, etc.
All attempts at confidential currencies with centralized institutions in history have failed.
Bitcoin solves the second problem: how to decentralize
1.7 Decentralized accounting
①Decentralization: Everyone can keep accounts. Everyone can keep a complete ledger.
Anyone can download open source programs, participate in the P2P network, monitor transactions sent around the world, become an accounting node, and participate in accounting.
② Decentralized accounting process
After someone initiates a transaction, it is broadcast to the entire network.
Each accounting node continues to monitor and continue transactions across the entire network. When a new transaction is received and the accuracy is verified, it is put into the transaction pool and continues to be propagated to other nodes.
Due to network propagation, the transactions of different accounting nodes at the same time are not necessarily the same.
Every 10 minutes, one person is selected from all accounting nodes in a certain way, and his transaction pool is used as the next block and broadcast to the entire network.
Other nodes delete the transactions that have been recorded in their own transaction pool based on the transactions in the latest block, continue accounting, and wait for the next selection.
③ Features of decentralized accounting
A block is generated every 10 minutes, but not all transactions within these 10 minutes can be recorded.
The accounting node that obtains the accounting rights will be rewarded with 50 Bitcoins. After every 210,000 blocks (approximately 4 years), the reward is halved. The total amount is about 21 million, and it is expected to be mined in 2040.
Recording the reward of a block is also the only way to issue Bitcoin.
④ How to allocate accounting rights: POW (proof of work) method
Compete for accounting rights by calculating mathematical problems on several accounting points.
Find a random number that makes the following inequality true:
There is no other solution except traversing the random numbers starting from 0 and trying your luck. The process of solving the problem is also called mining.
Whoever solves the problem correctly first will get the accounting rights.
If a certain accounting node finds the solution first, it will announce it to the entire network. After other nodes verify that it is correct, a new round of calculation will start again after the new block. This method is called POW.
⑤ Difficulty adjustment
The generation time of each block is not exactly 10 minutes
As Bitcoin develops, the computing power of the entire network does not increase.
In order to cope with changes in computing power, the difficulty will be increased or decreased every 2016 blocks (approximately 2 weeks), so that the average time for each block to be generated is 10 minutes.
#欧易OKEx# #BTC[超话]# #digital currency#
⑵ Comic illustration: What is blockchain?
Comic illustration: What Is Blockchain
What is Blockchain?
Blockchain, English Blockchain, is essentially a decentralized distributed database. Anyone can become a node of this huge network as long as they set up their own server and connect to the blockchain network.
Since the blockchain is essentially a database, what exactly is stored in it? Let’s take a look at the basic unit of blockchain: Block.
A block is divided into two parts:
1. Block header
areaThe block header stores the header information of the block, including the hash value of the previous block (PreHash), the hash value of the current block body (Hash), and the timestamp (TimeStamp), etc.
2. Block body
The block body stores the detailed data (Data) of this block. This data contains several rows of records, which can be transaction information or some other information.
What does the hash value just mentioned mean?
Everyone must have heard of MD5. MD5 is a typical hash algorithm that can convert a string of plaintext of any length into a string of fixed length (128 bits). This string is the hash value.
In our blockchain, a more complex hash algorithm called SHA256 is used. After a series of complex calculations, the latest data information (such as transaction records) will eventually be converted into a 256-bit hash value string through this hash algorithm, which is the Hash in the block header. The format is as follows:
Blocks and Hash have a one-to-one correspondence, and Hash can be regarded as the unique identifier of the block.
How are different blocks related to each other? Rely on Hash and PreHash to associate. The PreHash value of each block is equal to the Hash value of the previous block.
Why do we need to calculate the hash value of the block?
Since the blockchain is a chain structure, there must be a head node (the first block) and a tail node (the last block) of the chain. Once someone calculates the hash value of the latest data in the blockchain, which is equivalent to packaging the latest transaction records, a new block will be created and connected to the end of the blockchain.
The Hash of the new block header is the hash value just calculated, and the PreHash is equal to the Hash of the previous block. The data in the block body stores the transaction records before packaging, and this part of the data information has become unmodifiable.
This process of calculating Hash values and creating new blocks is called mining.
The server used for massive calculations is called a mining machine.
The workers who operate calculations are called miners.
What is so difficult about calculating hash values? Let’s give the most superficial explanation. The formula for calculating the hash value is as follows:
Hash = SHA-256 (Hash of the last block + basic information of the new block + transaction record information + random number)
Among them, the transaction record information is also a string of hash values, and its calculation involves a data structure Merkle Tree. Interested friends can check the relevant information, we will not introduce it for now.
The key computational difficulty here lies in the generation of random numbers. In order to increase the difficulty of Hash calculation, the wretched blockchain inventor requires that the first 72 bits of the Hash result must be 0.This probability is really too small.
Since (the Hash of the last block + the basic information of the new block + the transaction record information) is fixed, whether the Hash that meets the requirements can be obtained depends entirely on the value of the random number. Miners must go through massive calculations and repeatedly generate random numbers in an attempt to "get lucky" before they can get the correct Hash and successfully mine.
At the same time, the block header also contains a dynamic difficulty coefficient. When the world's hardware computing power becomes faster and faster, the difficulty coefficient of the blockchain will also increase, making the entire network capable of completing the task every 10 minutes on average. A new block is generated.
Friends, do you understand how difficult mining is? It should be added that different blockchain applications are different in details. The mining rules described here take Bitcoin as an example.
Applications of Blockchain
The concept of Bitcoin (BitCoin) was first proposed by Satoshi Nakamoto in 2008, and then based on this idea, open source software and P2P built on it were designed and released. network. Bitcoin is a P2P form of digital currency. Peer-to-peer transmission means a decentralized payment system.
What is a P2P network?
Traditional currencies are uniformly issued by the central bank, and all personal savings are uniformly managed by banks. This is a typical centralized system.
Bitcoin is deployed on a decentralized network composed of many peer nodes around the world. Every node is qualified to record and issue this digital currency.
As for the underlying data storage of Bitcoin, it is based on blockchain technology. Each transaction in Bitcoin corresponds to a row in the block data. A simple diagram is as follows:
Each row of the transaction record contains a timestamp, transaction details, and digital signature.
The table is only for ease of understanding. The actual stored transaction details are anonymous, and only the wallet addresses of the payer and payee are recorded.
As for digital signatures, they can be understood as anti-counterfeiting marks for each single transaction, generated by an asymmetric encryption algorithm.
Next let’s talk about the rewards of Bitcoin miners:
The Bitcoin protocol stipulates that miners who mine new blocks will receive rewards. Starting from 2008, it is 50 Bitcoins, and then halved every 4 years. , currently 12.5 Bitcoin in 2018. The new Bitcoins in circulation are all born in this way. No wonder everyone is so eager to mine Bitcoins!
Advantages and Disadvantages of Blockchain
Advantages of Blockchain:
1. Decentralization
Blockchain does not rely on a central node. The data of the entire system is All peer nodes in the entire network are jointly maintained and can store and verify data. In this way, unless the attacker hacks more than half of the nodes in the entire network, the entire system will not be destroyed.
2. Information cannot be tampered
The data in the block cannot be tampered with. Once the data is tampered with even a little bit, the hash value corresponding to the entire block will change accordingly, and it will no longer be a valid hash value, and the subsequent linked blocks will also be broken.
Disadvantages of blockchain:
1. Excessive consumption of energy
To generate a new block, a large amount of server resources must be used to perform a large number of unnecessary trial calculations, which seriously consumes electricity.
2. Network delay of information
Take Bitcoin as an example. Any transaction data needs to be synchronized to all other nodes. The synchronization process will inevitably be affected by network transmission delay, resulting in a long time consuming.
A few additional points:
1. Part of the content of this comic refers to Ruan Yifeng’s blog post "Blockchain Introductory Tutorial". I would like to thank this great master for his popular science.
2. Due to limited space, the knowledge about Merkle Tree and asymmetric encryption has not been discussed in detail for the time being. Interested friends can check the information for further study.
⑶ Hash algorithm
1. The original data cannot be deduced reversely through the hash value (so the hash algorithm is also called one-way hash algorithm)
2. It is very sensitive to the input data. If one bit is changed in time, the hash value is also very different
3. The probability of hash conflict should be small,
4. The execution efficiency should be high, even if the text is very long , can also calculate the hash value as quickly as possible
The result of MD5 is 128 bits --> 32 hexadecimal strings
The hash algorithm most commonly used for encryption is MD5 (MD5 Message-Digest Algorithm, MD5 message digest algorithm) and SHA (Secure Hash Algorithm, secure hash algorithm)
By getting the encrypted ciphertext and then comparing it in the dictionary table (rainbow table) Yes, if you find the same ciphertext, you can know the plaintext.
You can add salt (add a string) to the user's password and then encrypt it and store it.
The blockchain is composed of blocks, and each block is divided into two parts: block header and block body.
The block header stores the hash value of its own block body and the previous block header.
Because of this chain relationship and the uniqueness of the hash value, as long as any block on the blockchain is modified, the hash values saved in all subsequent blocks will be incorrect.
The blockchain uses the SHA256 hash algorithm. Calculating the hash value is very time-consuming. If you want to tamper with a block, you must recalculate the hash values of all blocks following the block. In a short time Almost impossible to do.
Suppose we have k machines, countThe range of the data hash value is [0, MAX]. We divide the entire range into m small intervals (m is much larger than k), and each machine is responsible for m/k small intervals. When a new machine is added, we will move the data between certain cells from the original machine to the new machine. In this way, there is no need to rehash and move all the data, and the balance of the amount of data on each machine is maintained.
⑷ What is the blockchain cryptographic algorithm?
As an emerging technology, blockchain has received more and more widespread attention. It is a new application of traditional technology in the Internet era. , which includes distributed data storage technology, consensus mechanism and cryptography, etc. With the creation of various blockchain research alliances, related research has received more and more funding and personnel support. Hash algorithm, zero-knowledge proof, ring signature and other cryptographic algorithms used in the blockchain:
Hash algorithm
Hash algorithm is the basic technology of the blockchain. The essence of the Hash function is to A set of data of arbitrary length (finite) is mapped into a set of data streams of defined length. If this function satisfies both:
(1) The calculation of the Hash value of any input set of data is very simple;
(2) Think It is computationally difficult to find 2 different data with the same hash value.
Hash functions that satisfy the above two properties are also called cryptographic Hash functions. Unless there is any contradiction, the Hash function usually refers to the cryptographic Hash function. For the Hash function, finding such a value is called a collision. Currently popular Hash functions include MD5, SHA1, SHA2, and SHA3.
Bitcoin uses SHA256, and most blockchain systems use the SHA256 algorithm. So here we will introduce SHA256 first.
1. SHA256 algorithm steps
STEP1: Add padding bits. The message is padded so that the message length is congruent with 448 mod 512 (length = 448 mod 512). The number of padding bits ranges from 1 to 512. The highest bit of the padding bit string is 1 and the remaining bits are 0.
STEP2: Additional length value. Append the bit length of the initial message (before padding) expressed in 64-bit to the result of step 1 (low-order byte first).
STEP3: Initialize the cache. Use a 256-bit cache to store the intermediate and final results of the hash function.
STEP4: Process 512-bit (16 words) message packet sequence. The algorithm uses six basic logic functions and consists of 64 steps of iterative operations. Each step takes a 256-bit cache value as input and then updates the cache content. Each step uses a 32-bitA constant value Kt and a 32-bit Wt. Where Wt is the message after grouping, t=1,2,...,16.
STEP5: After all 512-bit packets are processed, the output generated by the last packet of the SHA256 algorithm is a 256-bit message.
2. Ring signature
In 2001, three cryptographers, Rivest, Shamir and Tauman, proposed the ring signature for the first time. It is a simplified group signature, with only ring members and no managers, and does not require cooperation among ring members. In the ring signature scheme, the signer first selects a temporary set of signers, which includes the signer. The signer can then use his own private key and the public keys of others in the signature set to generate signatures independently without the help of others. Members of a set of signers may not be aware that they are included.
The ring signature scheme consists of the following parts:
(1) Key generation. Generate a key pair (public key PKi, private key SKi) for each member in the ring.
(2) Signature. The signer uses his own private key and the public keys of any n ring members (including himself) to generate signature a for message m.
(3) Signature verification. The verifier verifies whether the signature is signed by a member of the ring based on the ring signature and message m. If it is valid, it will be accepted, otherwise it will be discarded.
The properties that ring signatures satisfy:
(1) Unconditional anonymity: The attacker cannot determine which member of the ring generated the signature, even after obtaining the ring member’s private In the case of key, the probability does not exceed 1/n.
(2) Correctness: The signature must be verified by all others.
(3) Unforgeability: Other members in the ring cannot forge the signature of the real signer. Even if an external attacker obtains a valid ring signature, he cannot forge a signature for message m.
3. Comparison between ring signature and group signature
(1) Anonymity. It is a system in which individuals sign on behalf of a group. The verifier can verify that the signature is signed by a member of the group, but cannot know which member, so as to achieve the anonymity of the signer.
(2) Traceability. In group signatures, the existence of the group administrator ensures the traceability of the signature. Group administrators can revoke signatures to reveal the true signer. The ring signature itself cannot reveal the signer unless the signer himself wants to reveal or add additional information to the signature. A verifiable ring signature scheme is proposed. In the scheme, the real signer hopes that the verifier knows his identity. At this time, the real signer can confirm his identity by revealing the secret information he holds.
(3) Management system. Group signatures are managed by the group administrator, ring signatures are notManagement is required. The signer can only select a possible set of signers, obtain its public key, and then publish the set. All members are equal.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only approved "Smart Learning Factory 2020- Xueshuo Innovation Workstation" launched by the School Planning and Construction Development Center of the Ministry of Education of China. "Blockchain Technology Professional" pilot workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.