问题
Git's internal data structure is a tree of data objects, wherein each objects only points to its predecessor. Each data block is hashed. Modifying (bit error or attack) an intermediate block will be noticed when the saved hash und the actual hash deviate.
How is this concept different from block chain?
Git is not listed as an example of block chains, but at least in summaries, both data structure descriptions look alike: data block, single direction reverse linking, hashes, ...).
So where is the difference, that Git isn't called a block chain?
回答1:
git is not an example of blockchain technology for several reasons (these were the first that came to mind):
In a blockchain implementation, every block is verified independently multiple times before it is added to the blockchain. This is indeed one of the most important things about blockchain technology and is what ensures its "unhackability." On the other hand, many
gitprojects do not require independent verification and, when they do, they only require one person to sign off on a change before it is committed to the repository. Hence, with at most one point of validation that you must trust,gitbreaks one of the core tenets of blockchain technology.A
gitrepository is not necessarily duplicated on many servers. You can work from agitrepository locally and if your local disk were corrupted, you would lose everything. Blockchain technology implies the reproduction of the ledger across servers.You can rewrite
githistory. Agit push <remote> <branch> --forcewhere<branch>is set to a previous state than that at<remote>would rewrite the history. In blockchains, the ledger is an immutable history.
回答2:
The reason why Git and blockchains appear similar is because they are both using merkle trees as their underlying data structure. A merkle tree is a tree where each node is labeled with the cryptographic hash value of their contents, which includes the labels of its children.
Git’s directed acyclic graph is exactly that, a merkle tree where each node (tag, commit, tree, or blob object) is labeled with the hash of its content and the label of its “child”. Note that for commits, the “child” term conflicts a bit with Git’s understanding of parents: Parent commits are the children of commits, you just need to look at the graph as a tree that keeps growing by re-rooting it.
Blockchains are very similar to this, since they also keep growing that way, and they are also using its merkle tree property to ensure data integrity. But usually, blockchains are understood as way more than just merkle trees which is where they are separating from the “stupid content tracker” Git. For example, blockchains usually also means having a highly decentralized system on a block level (not all blocks need to be in the same place).
Understanding blockchains is kind of difficult (personally, I’m still far away from understanding everything about it), but I consider understanding Git internals as a good way to understand merkle trees which definitely helps understanding a fundamental part about blockchains.
回答3:
Cyber Currencies like Bitcoin, use a distributed consensuses cryptographic chain of blocks (merkle tree). Common usage has shortened this to 'blockchain'
While git uses a chain of blocks (merkle tree), it lacks the distributed consensuses cryptographic components that common usage of the term 'BlockChain' imply.
回答4:
Unlike cryptocurrency blockchains; git doesn't have a p2p trustless consensus mechanism.
回答5:
Blockchain is not just any chain of any blocks.
Blockchain is when there is a way of determining the main chain when two or more are diverted, and when no central authority is needed for that determination.
回答6:
The Goals are different for blockchain and git although both use merkle trees as data structure.
A blockchain is typically managed by a peer-to-peer network adhering to a protocol for inter-node communication and validating new blocks. Once recorded, the data in any given block cannot be altered retroactively without alteration of all subsequent blocks, which requires consensus of the network majority.
As According to Bitcoin whitepaper :
A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. Digital signatures provide part of the solution, but the main benefits are lost if a trusted third party is still required to prevent double-spending. We propose a solution to the double-spending problem using a peer-to-peer network. The network timestamps transactions by hashing them into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed without redoing the proof-of-work. The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power. As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain and outpace attackers. The network itself requires minimal structure. Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will, accepting the longest proof-of-work chain as proof of what happened while they were gone
While Git is a distributed version-control system for tracking changes in source code during software development.It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
As according to Linus Torvalds:
In many ways you can just see git as a filesystem – it's content-addressable, and it has a notion of versioning, but I really designed it coming at the problem from the viewpoint of a filesystem person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system.
来源:https://stackoverflow.com/questions/46192377/why-is-git-not-considered-a-block-chain