Current location - Quotes Website - Personality signature - The difference between git and blockchain
The difference between git and blockchain
I. Similarity

distributed

Git ensures that each code repository keeps a complete project library locally, not just the branches it works on and its submission history.

At the same time, it also retains all snapshot and index information after the last pull.

In the blockchain, each node maintains a complete database locally, not just its own transaction information.

traceability

On the Git mit chain, each mit object contains the parent object (the object of the last mit, except the first mit), and all previous records can be traced back.

In the blockchain, each block contains the index of the previous block (except the creation block), which can be traced back to all previous valid transactions.

Can't be tampered with.

In Git's mit chain, each object itself calculates a checksum before storing it, and then references it with a checksum.

Once modified, the checksum will go wrong, which means that it is impossible to change any file content or directory content without Git's knowledge.

The mechanism Git uses to calculate the checksum is called SHA- 1 hash.

This is a string consisting of 40 hexadecimal characters (0-9 and a-f), which is calculated according to the contents of files or the directory structure in Git.

SHA- 1 hash is as follows:

24 B9 da 6552252987 aa 493 b 52f 8696 CD 6 d3b 00373

In the blockchain, each block contains two SHA-256 hashes of the previous block ID and the current block ID, both of which are calculated based on the block content.

Once the content is modified, the hash will change, which is inconsistent with the chain of other nodes. Finally, the longest chain cannot be added, so the content cannot be tampered with.

Second, differences.

Collective knowledge and central node will: 1- Blockchain is the longest chain based on collective knowledge (POW/POS), which is the main chain.

2- In Git system, when multi-node cooperation is carried out through the warehouse hosting platform, it is the platform project manager who holds the merging power, which embodies the will of the central node.

cryptology

In the 1- bitcoin blockchain, cryptography mainly uses the following methods.

In the whole system of bitcoin blockchain, a large number of public encryption algorithms are used, such as Merkle tree hash number algorithm, elliptic curve algorithm, hash algorithm, symmetric encryption algorithm and some coding algorithms.

The functions of various algorithms in the bitcoin blockchain are as follows:

A) hash algorithm

The two hash functions used by Bitcoin system are: 1. SHA-256, which is mainly used to complete PoW calculation; 2.RIPEMD 160, which is mainly used to generate bitcoin addresses.

B)Merkle hash tree

Binary tree or multi-branch tree based on hash value, in the computer field, Merkle tree is mostly used for integrity verification. In distributed environment, its integrity verification can greatly reduce the complexity of data transmission and calculation.

C) elliptic curve algorithm

In Bitcoin, the public key cryptography algorithm based on secp256k 1 elliptic curve mathematics is used to sign and verify the signature. On the one hand, it can ensure that the user's account is not impersonated, on the other hand, it can ensure that the user can't deny the transaction he signed.

The private key is used to sign the transaction information, and the digger verifies the signature with the user's public key. If the verification passes, the transaction information is recorded and the transaction is completed.

D) symmetric encryption algorithm

The official client of Bitcoin uses AES (symmetric block cipher algorithm) to encrypt wallet files. After the user sets the password, the wallet private key is encrypted by AES setting the hungry password to ensure the security of the client private key.

E)Base58 coding

Base58 is a unique encoding method used by Bitcoin, which is mainly used to generate the wallet address of Bitcoin. Similar to the permutation algorithm mechanism in classical cryptography, its purpose is to increase the readability of the binary hash value to the address "177rnltxyaaxqtrrjprsqnxvr9a1gf5p3k" we see.

2-Git: SSH key is mainly used for remote login verification, and SHA- 1 is used for code content checksum.

SSH is the abbreviation of Secure Shell, which was formulated by IETF's network working group. SSH is a protocol designed to provide security for remote login sessions and other network services.

Using SSH protocol can effectively prevent information leakage in the process of remote management.

The process of SSH transmission is as follows: (1) The remote host receives the user's login request and sends its public key to the user.

(2) The user encrypts the login password with this public key and sends it back.

(3) The remote host decrypts the login password with its own private key, and allows the user to log in if the password is correct.