3 ms·
> The simplest implementation of a blockchain would be about 100 lines of Java code (assuming simple CRC hash). It's a linked list where each node rehashes not
by benchaney 9y ago
> The simplest implementation of a blockchain would be about 100 lines of Java code (assuming simple CRC hash). It's a linked list where each node rehashes not only that node's data but also the hash from the prior node. I'm sorry, but that's the actual definition.
That's your definition. It isn't the definition that most people use. It isn't clear to me why you think your definition is the definitively correct one, but feel free to enlighten me.
Edit: Also, I think you misunderstood my previous post. Even using your unconventional definition of block chain, the special case of a Merkle tree with only one child per node is something else entirely.
- fergazen 9y agoI just wonder what goes on in your mind when you try to ponder the phrase "simplest possible blockchain"...because you don't think there's a specific single characteristic of a "blockchain", but there actually is. Here's another for ya: https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54 https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-co... Regarding Merkle: Even the Wikipedia page on "blockchain" explains the Merkle connection and it's precisely what I said, and the Merkle Wiki page says: "Hash trees are a generalization of hash lists and hash chains.", which was also my point.
- lawrenceyan 9y agoYou're digging too deep into things. The technicalities of what a blockchain are fundamentally semantical. Most people when referencing "the blockchain" are also implying the portion relating decentralized trustless consensus. So the "simplest possible blockchain" would also require that component.
- fergazen 9y agoIn every post i've made it has been crystal clear I'm referring to "blockchain the data-structure"... The "consensus component" is an algorithm for detecting if one blockchain disagrees with other blockchains, and ignoreing it if it does. https://youtu.be/_160oMzblY8?t=5m5s https://youtu.be/_160oMzblY8?t=5m5s
- benchaney 9y ago> I just wonder what goes on in your mind when you try to ponder the phrase "simplest possible blockchain" What constitutes the "simplest possible blockchain" depends on what definition of the word blockchain you use. I don't see why that is particularly difficult to understand. > because you don't think there's a specific single characteristic of a "blockchain", but there actually is. I'm not sure what this is supposed to mean. The defining characteristic of a blockchain is a Sybil tolerant distributed consensus algorithm. At least that is the definition I (along with most people) use. > https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-co.. https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-co.... I'm not sure why you bothered to reference this. You have already established that there is one person who agrees with you. It isn't particularly relevant. > Regarding Merkle: Even the Wikipedia page on "blockchain" explains the Merkle connection and it's precisely what I said, and the Merkle Wiki page says: "Hash trees are a generalization of hash lists and hash chains.", which was also my point. The Merkle connection is that each block in the blockchain contains a Merkle Tree. That is not what you said at all. Also, if you clicked on the link for hash list or hash chain, you would see they are both very different from the linked list structure used in a blockchain. A hash chain is the repeated application of a hash function to a piece of data [0]. A hash list is a list of hashes, which is again hashed [1]. [0] https://en.wikipedia.org/wiki/Hash_chain https://en.wikipedia.org/wiki/Hash_chain [1] https://en.wikipedia.org/wiki/Hash_list https://en.wikipedia.org/wiki/Hash_list
- fergazen 9y agoA very literal reading of the Merkle sentence on wikipedia could conclude that it's stating each block of a blockchain must contain a valid Merkle tree, and so technically that sentence on the Wiki is incorrect; because, aside from re-hashing the prior hash (along with each node data), the blockchain algorithm doesn't care what the 'data' payload is. I was giving the Wiki editor the benefit of the doubt, assuming he just worded that sentence incorrectly. The only difference between an order-one (degree-one) merkle tree (wired like a 'linked list' graph) and a blockchain, is that merkle doesn't require new data to hash on each non-leaf node, but has data only on leaf nodes. In merkle, each level up the tree is rehashing ONLY the actual child hashes below it, so that all hashes are ultimately determined only by "hashes of hashes" (recursively) of LEAF nodes. So this means from a coding standpoint every order-one merkel is a single line of code away from being a blockchain. That is: The line of code that adds the 'node data' byte array to the SHA256 Hash Digester input stream, before outputting the node's hash. However this may also be a case where the Merkle wiki is not fully complete and accurate, because I cannot fathom that Merkle never thought of a case where each node contains data of it's own to add into the hashing. I bet the original source material from Merkle does include node data as an option, and would make him technically the actual first inventor of blockchain.