> It is NOT secure neither a real blockchain and you should NOT use this for anything else than educational purposes.<p>It would be nice if non-secure parts of implementation or design were clearly marked.<p>What's the point of education article, if bad examples aren't clearly marked as bad? If MD5 usage is the only issue, author could easily replace it with SHA and get rid of the warning at the start. If there are other issues, how can a reader know which parts to trust?<p>Even if fixing bad/insecure parts are "left as an exercise for the reader", learning value of the article would be much greater if those parts would be at least pointed at.
For the last couple of months, there have been many educational, simple implementations that explains blockchain technology, I guess thanks to crypto bubble. I wish these were around when we were doing our senior design project on blockchains in 2014. Back then, I only could find basiccoin[0], which was purely minified to just fit in 1000 loc.<p>After that, I decided to re-implement everything from scratch. My foremost constraint was to write readable code so that anyone could read the codebase and have an idea of how blockchain works.<p>My current draft of implementation can be found on <a href="https://github.com/halilozercan/halocoin" rel="nofollow">https://github.com/halilozercan/halocoin</a> , which currently lacks detailed README and documentation. However, you can still experiment with it by using API or CLI. I'm running a dedicated server to have an always online peer you can connect to.<p>[0]: <a href="https://github.com/zack-bitcoin/basiccoin" rel="nofollow">https://github.com/zack-bitcoin/basiccoin</a><p>Edit: a word
Thanks! Simplest explanation I've seen.<p>Here's an nbviewer link (which, like base58, works on/over a phone):
<a href="https://nbviewer.jupyter.org/github/julienr/ipynb_playground/blob/master/bitcoin/dumbcoin/dumbcoin.ipynb" rel="nofollow">https://nbviewer.jupyter.org/github/julienr/ipynb_playground...</a><p>Note that Bitcoin does two rounds of SHA256 rather than one round of MD5. There's also a "P2P DHT" (peer-to-peer distributed hash table) for storing and retrieving blocks from the blockchain; instead of traditional database multi-master replication and secured offline backups.<p>> ERROR:root:Invalid transaction signature, trying to spend someone else's money ?<p>This could be more specific. Where would these types of error messages log to?
FYI: Great blockchain (from sratch) starter article. At the Awesome Blockchains page [1] I collect starter blockchains and articles (in Python, Ruby, JavaScript, etc.) the idea is the best way to learn about blockchains is to do-it-yoursef - build your own blockchains from scratch. Great example. Keep it up. Cheers.
[1] <a href="https://github.com/openblockchains/awesome-blockchains" rel="nofollow">https://github.com/openblockchains/awesome-blockchains</a>
This is great. Just last weekend I did the same thing, coding a very basic blockchain in Python for educational purposes. You tackled wallets, which I didn't get to yet, so that was really helpful.<p>I'm still a little unsure around exactly how miners and nodes communicate with each other. Especially things like broadcasting transactions and new blocks. Any good resources for that?
Very good writeup that shows all the steps.<p>Note it uses MD5 hash instead of SHA256 so not exactly bitcoin. I wonder how much more work would be to make the code fully implement bitcoin. Will it still be readable? Or Etherium? Would be great value for understanding even if Python would be inefficient to run in prod.
nice walkthrough.<p>also, not sure why folks are nitpicking about minor things like security disclaimers, number of sha256 hashes, md5, etc. while ignoring nontrivial gaps (eg no merkle dags, one of the cornerstone concepts).
Something from a few months back that's a bit closer to Bitcoin's actual implementation but at a similar level of readability: <a href="https://github.com/jamesob/tinychain" rel="nofollow">https://github.com/jamesob/tinychain</a>
So is there a non educational implementation of blockhain that someone could use/parametrize/configure? Something that is not educational but more industrial strength? What must someone do to convert an educational implementation to a serious one?