top | item 14795457

Building a tiny blockchain

187 points| nitramm | 8 years ago |medium.com | reply

57 comments

order
[+] wildbunny|8 years ago|reply
This worries me. Bitcoin solved the double spend problem by using the LCR with PoW. That is the novel aspect which allowed cryptocurrencies to come into existence.

If you remove the LCR and PoW, all you are left with is a toy example which cannot work in practice.

What is needed is education about censensus design and bitcoin's implementation of the solution, rather than a 'how to guide' for building a basic linked list under the guise of 'blockchain'.

Cheers, Paul.

[+] jbb67|8 years ago|reply
As for proof of work, am I right in assuming it works like this :-

Add a field to store a random number. Keep generating values for this field until the hash of the structure has 'n' leading zeros.

Is that more or less correct?

[+] ionwake|8 years ago|reply
What does LCR stand for? Thank you
[+] ankushnarula|8 years ago|reply
Correct me if I'm wrong but the article is about elucidating the structure of a blockchain database - not a practical secure cryptocurrency.
[+] cableshaft|8 years ago|reply
Regardless of the semantic discussion on what exactly a 'blockchain' is and whether or not this qualifies, I found the article interesting by taking a tiny piece of the whole monster and demystifying it a bit.

I don't see this any differently than a tutorial that makes a static image move around the screen with key presses. Is it a full game? Not at all. But can it teach you how to build a tiny piece of it, and you can look at other tutorials to figure out how to build other tiny pieces of it, and eventually synthesize that knowledge and make a full game? Yes.

[+] todd_wanna_code|8 years ago|reply
Hey you got some link for other tutorials to go from here?
[+] Uptrenda|8 years ago|reply
So ah... where's the part where you implement a working blockchain, again? There's no proof-of-work, consensus logic, currency logic, accounting logic, peer-to-peer networking code, etc.

Instead this is just a list of hashed-linked documents... Not that much different from a Git repo or a basic file system with integrity checks. Hashing != blockchains.

[+] KenanSulayman|8 years ago|reply
What? A blockchain isn’t a distributed ledger. A blockchain IS a chain of linked documents - whereas these documents are usually hash trees including the “transactions” per block. They ensure integrity by hashing the previous blocks. The proof of work is just a way to ensure a self regulating growth of virtual currencies and to prevent double spending.
[+] CiPHPerCoder|8 years ago|reply
The only real blockchain is CBC mode. (Cipher Block Chaining)

What you're describing is a cryptocurrency, or some other form of cryptographically assured distributed ledger with a proof of work.

If you think I'm wrong, look in the original Bitcoin paper and search for "blockchain".

[+] kbody|8 years ago|reply
Clearly there's an association to Bitcoin and there are certain expectations by people when mentioning blockchain.

It's justified since blockchain on its own is a relatively simple data structure which on itself is not that significant. It's the composition of all the elements that have given the value and recognition to this technology.

[+] joepie91_|8 years ago|reply
Same answer here: the term "blockchain" didn't exist before Bitcoin. It has a very specific meaning involving a particular kind of distributed ledger.
[+] chrisallick|8 years ago|reply
I wanted to try re-writing in Ruby to warm up today. Can someone confirm this is correct? https://gist.github.com/chrisallick/cb196b13555c86f9193f3ec4...
[+] KenanSulayman|8 years ago|reply
Looks good to me.

You might want to keep track of the blocks as you create them, or you will find it hard to verify the integrity of a block.

(Do I know the hash of the previous block? Do I know about the next block, if it is not the last block?)

[+] e12e|8 years ago|reply
Regardless of the quality of the article, it's refreshing to see so many good questions and concise answers in this thread (mostly about blockchains-as-distributed-ledgers). It's been a while since I saw such nice, civil and interesting technical discussion on hn.
[+] wildbunny|8 years ago|reply
When you're talking about people's money, just following tutorials and piecing something together does not cut it.
[+] dguaraglia|8 years ago|reply
I don't think anyone is suggesting taking this and publishing as the latest niche 'WhateverCoin'.
[+] todd_wanna_code|8 years ago|reply
I don't think BlockChain is about creating a newer coin, it's just interesting as a topic.