Hacker News new | past | comments | ask | show | jobs | submit login
Blockchains from the ground up: Part 1 (johnmathews.eu)
301 points by mthwsjc_ on May 27, 2017 | hide | past | favorite | 36 comments



The Minimum Viable Blockchain (https://www.igvita.com/2014/05/05/minimum-viable-block-chain...) is by far the best introduction to blockchain I have read.


I always find this introduction (including a "live demonstration") by Anders Brownworth very illustrative: https://anders.com/blockchain/


This is a great video/site. After watching this, it made me think how amazing the blockchain would be if our accounting and trading systems were built on top of it. As a programmer outside the financial services sector, it seems to me something like this has to be the future. But it would be really interesting to see what quants and others in the field think.


Back in 2008 I invented an algorithm for tree structures where the definition of the hash of any node, was "the hash of hashes of all its immediate children". I had invented a way to do 'tree node comparisons' where any time two tree nodes on a tree had the same 'hash' i knew the content (recursively deep into the tree) of those nodes was identical. I never went forward on that algorithm, because i knew it meant each time a tree node was modified, the hash of all it's parents (i.e. path to root), had to be recalculate. But I had explained it to several developers who were all amazed by it. It now realize I had invented blockchain. I am pretty sure i'm not the first one to realize hashing actual hashes (in a recursive or chained way) is a powerful concept. I may add this to my current project SubNode (sbnode.com), and I could pivot that app into a blockchain technology!


I think Merkle got there first, in about 1979 or so.

https://en.m.wikipedia.org/wiki/Merkle_tree


It's a nice strike against software patents though, probably every programmer interested in data structures goes through a whole series of these independent inventions.

To award a patent to someone just because they thought of it first is ridiculous.


I'm no lawyer, but they really need to outlaw patents on 'general purpose' technologies. Adam Carolla famously got sued for owning a podcast company, when someone claimed to have a patent on the entire concept of "downloadable audio". I think there should be a one year jail term for anyone who files a suit about something that ends up being determined "general purpose" technology. Would end the nonsense overnight.


Very interesting, thanks. I had never heard of Merkle Tree. Since a linked list is merely a special case of a 'tree structure' (i.e. one where there is always only one child), we can consider Merkle to be the true 'inventor' of blockchain. However, really the concept is so simple and obvious that I wouldn't be surprised if Babbage/Lovelace era folks had written papers on it.

I'm sure there's at least one arse who'll tell me the DIFFERENCE between a tree and a linked list. lol. Gotta love social media.


A linked list is a special case of a tree structure, but a blockchain is not a special case of a Merkle tree. If you considered the special case of a Merkle tree that was just a list it would be both useless, and not a blockchain.

Edit: Its worth pointing out that the main innovation of the 2008 paper by Nakamoto introducing the concept of blockchain's wasn't just storing things in a linked list based on hashes. It was the Sybil tolerant distributed consensus algorithm. Most people include that in the definition of a blockchain.


He'd also be the true inventor of Git then. It's a widely useful data structure.


Merkel WAS a genuine innovation, and it DOES collapse into plain blockchain if all 'nodes' on a given tree have one child, because in this case the directed graph (tree) is a linked list. If the key innovation in both structures were not the same then your snarkyness would have been appropriate.


The point is that there is more to blockchain technology than just Merkle trees, I think. Just focussing on the underlying datastructure is like saying filesystems are just B trees or something.


Yes. I think that there a bunch of interesting ideas in blockchain technology, not all of which are necessarily new, but they are often new to the blog writer and/or audience. So introductory articles often focus on those basic concepts, which leads to this confusion


The Wikipedia article on blockchain has this sentence: "From the technical point of view a blockchain is a hashchain inside another hashchain", and that sums it up. The actual blockchain algorithm itself is as simple as that. Period. Full stop.

Of course, most actual APPLICATIONS of blockchain also ADD ON a lot of other concepts, like distributed ledger, distributed consensus, etc. Trust me, i'm not the guy in this conversation confusing algorithms with applications.


I keep forgetting this exists. The video is damn good at explaining how blockchain overall. I think the strongest bit, is showing how data manipulation is easily detectable.


This is fantastic. Great explainer for both tech and non-tech alike. Thanks for sharing.


I found this very clear and accessible


wow. That Anders video is definitely the best description/explanation of blockchain I've ever seen.


Here is a really great video [1] which really made blockchains click for me. I believe this was posted on HN a while back.

[1] https://anders.com/blockchain/


This article has a few issues.

First, you spend the first half of the article explaining a signature scheme that isn't based on cryptography. It isn't really clear what that part of the article is actually about.

> "Signed by John" <- John encrypts this line using his private key

This isn't how message signing works. It has all the problems you described in the first part, before you introduced asymmetric encryption.


Thanks, I corrected the post.


I've found this a really clear and helpful explanation of blockchain concepts in the past: http://www.michaelnielsen.org/ddi/how-the-bitcoin-protocol-a...


One thing that bothers me about all blockchain demos or tutorials is that they work on the concept of tracking outputs of transactions rather than just maintaining state.


Is there a Blockchain email system? Wouldn't that be a solid evolution forward, in terms of human communication?


There is: https://www.reddit.com/r/ethereum/comments/68tyhn/lemonmail_...

It uses IPFS to store encrypted mail messages. Right now its free, but eventually, you will have to pay for the storage of emails.


What point would serve other than increasing latency, and vastly increasing storage and network requirements?


> Wouldn't that be a solid evolution forward, in terms of human communication?

How so?


No spam, no solicitation, you know whose line (email) you're picking up, and whom you're dialing (sending).


[flagged]


We've banned this account for breaking the HN guidelines. Flamewars aren't welcome here, even from blockchain experts.

We detached this subthread from https://news.ycombinator.com/item?id=14432952 and marked it off-topic.


> 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.


I 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-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.


> 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....

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

[1] https://en.wikipedia.org/wiki/Hash_list


A 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.


> A 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;

That is not incorrect. That is exactly what is happening.

> 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.

At the blockchain level, sure. But the Merkle tree exists at a higher level of abstraction.

> 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.

Right. This means that a Merkle tree of degree one can only contain one element, because it always have one leaf. That is why I called it useless in an earlier post.

> 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.

It is only a one line of code difference, but it is a very important line of code. Changing the Merkle Tree in that way complete breaks the two main algorithms that make it useful [0]. Data structures aren't just about the way data is organized. They are also about ways to manipulate that data in that organization that allow for algorithms that wouldn't be possible otherwise. This is why Merkle didn't patent the idea of including data in non-leaf nodes, and that is also why most people don't consider any linked list using cryptographic hashes instead of pointers to be a blockchain. Because the way data is manipulated is just as important as how it is stored.

[0] https://www.certificate-transparency.org/log-proofs-work


You'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.


In 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: