News for hackers. Stuff that matters.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jackschultz on Saturday November 04, 2017 @02:42PM (#15626322)
Hey guys, I'm actually the one who wrote this. Really glad to see it here and that people think it's worthwhile.

I mention this in the post, but the reason I started this is to learn more about how blockchains operate. I've never been that into them, I don't invest in the coins that the big ones operate with, but am more interested in how they work and other use cases. As with everything, the best way to learn is to write one yourself. I definitely don't consider myself an expert, but when I go back and read the Satoshi paper and Ethereum's white paper, it makes way more sense than before.

Let me know if you have questions, or if you don't agree with something I wrote. Want to make sure people reading this can get more info out of it than many of the other articles on this topic.

Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by kirillseva on Saturday November 04, 2017 @06:24PM (#15627191)
Thanks for the blog series, Jack! When is your ICO?
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jackschultz on Saturday November 04, 2017 @06:52PM (#15627277)
Hah yeah that's not gonna happen. If it were, you'd get to give it a name though. Maybe something to do with Master and Margarita, one of the better books people have said I should read.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jbmsf on Saturday November 04, 2017 @09:48PM (#15627776)
Who's ready to buy Behemoth?
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by swe445 on Saturday November 04, 2017 @03:42PM (#15626550)
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by geraldbauer on Saturday November 04, 2017 @01:31PM (#15626031)
FYI: I've collected more article series and samples about building your own blockchain(s) at the Awesome Blockchains page [1]. Anything missing? Let us know. Happy blockchaining. [1] https://github.com/openblockchains/awesome-blockchains#artic...
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by swalsh on Saturday November 04, 2017 @10:27PM (#15627885)
Small nitpick, I ran the example and found I could only create 3 blocks. (I'm on ubuntu if that matters) looking more into it, it seems like the issues is the glob.glob in sync.py is not always read in order so the chain is out of order. My solution was to move the add block to chain call lower, and to sort the blocks first. After changing that code it seemed to work fine.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jackschultz on Saturday November 04, 2017 @10:58PM (#15627974)
Ahh yeah, on a Mac, using os.list_dir leaves 10.json ahead of 2.json. I heard from someone else on Linux that had that problem. If you have the code that works would you make a pull request and I'll throw that in?
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by aisofteng on Sunday November 05, 2017 @12:51AM (#15628207)
This is pretty universal. Use lexicographic sorting.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jackschultz on Sunday November 05, 2017 @01:26AM (#15628286)
Well yes. That's why I put at least 6 characters of 0 in front of the index of a block,so the filenames were 000001.json, and used glob rather than list_dir. But that didn't work for Linux.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by tfmatt on Saturday November 04, 2017 @02:08PM (#15626175)
Can't wait for part 4, I've been following this series very closely and really appreciate the details the author has included. Way more in-depth than the typical "build your own blockchain" submission.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jackschultz on Saturday November 04, 2017 @02:44PM (#15626330)
Thanks, really like hearing people like what I wrote. And definitely trying to write more in depth than some of the other posts on this topic. Hopefully more to come.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by bezeee on Saturday November 04, 2017 @11:11PM (#15628011)
This is really neat...I've been working on the exact same thing in my spare time with the intent to learn the guts of blockchains. Our code is very similar, unsurprisingly. Mine is also Python but I'm running in with Serverless using Redis at the block store.

What I've found is that it's pretty easy to build out the basics, but then very complicated to cover all of the hard cases (specifically, resolving disparate chains between nodes). The deeper I dig the more appreciation I have out there for the "real" blockchain implementations and implementors.

Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by exabrial on Saturday November 04, 2017 @02:12PM (#15626196)
Random idea: a logging/audit framework with built in blockchain support to prove events happened/didn't happen. Maybe an extension to slf4j?
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jsmthrowaway on Saturday November 04, 2017 @02:38PM (#15626300)
You can sign log messages several ways without blockchain. Even systemd (cough) has support for one crude form, which it calls forward secure sealing. Not sure what proof-of-work, which seems to be the subtext and is really intended for distributed lack of trust, would buy you in this situation.

I can think of a reasonable blockchain-like implementation for logs, actually: chunk up the log, sign, include the hash of the prior sig as the first log message in the new chunk. Boom, blockchain! Throw in Merkle trees somehow and you’ve got yourself a VC-funded startup. You’re welcome.

Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by jcims on Saturday November 04, 2017 @05:32PM (#15627010)
This would be useful to ensure you aren't missing any log data...an issue near and dear to my heart these days.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by runeks on Sunday November 05, 2017 @02:48AM (#15628586)
Blockchains don’t help with ensuring you’re not missing any data, their purpose is to define which series of logs is the “right one”, which doesn’t make much sense in anything but a distributed context. The purpose of the Bitcoin blockchain is to define the “right” log of transactions, that everyone agrees is the right log.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by nerdponx on Saturday November 04, 2017 @06:30PM (#15627218)
Indeed. That might actually be a good idea for government records and other legal documents.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by mekacalvin on Monday November 06, 2017 @05:56AM (#15634629)
This series has been so in-depth, I can't wait to part 4, thanks so much, this really helped.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by mrsdreaj on Saturday November 04, 2017 @02:34PM (#15626282)
I also agree with the extension to slf4j.
Re:How to Build Your Own Blockchain Part 3 – Writing Nodes T... by BCrundown on Saturday November 04, 2017 @06:24PM (#15627196)
I also agree also with the extension to slf4j.