7 ms·
A Practical Introduction to Blockchain with Python
- mrlinx 9y agoGreat explanation!
- zach43 9y agoyes, as someone with minimal knowledge of bitcoin and blockchains, this helped with visualizing the roles of the miner, blockchain, and bitcoin wallet. As a sidenote, I have been working in C++-land for a while now, and its really cool to see how the examples both contain a simple blockchain implementation along with the views for a Flask web UI in the same file. I wonder if there are web libraries available to do something similar in C++?
- icebraining 9y agoPlease comply with the license of the blockchain implementation in Python. It's MIT, so all you have to do is include the copyright notice ("Copyright (c) 2017 Daniel van Flymen"). You should also tell people under what license you're releasing your changes :)
- adilmoujahid 9y ago@icebraining Author here. Thanks for the comments. I will add the copyright notice. Changes also will be MIT :)
- icebraining 9y agoThanks!
- geraldbauer 9y agoFYI: At the Awesome Blockchains [1] page I collect articles on building your own blockchains from scratch (incl. Python, Ruby, JavaScript, etc.) The idea is that a great way to learn and understand blockchains is by building your own blockchains from scratch (zero). Happy blockchaining. [1]: https://github.com/openblockchains/awesome-blockchains https://github.com/openblockchains/awesome-blockchains
- xchaotic 9y agonext up - a practical introduction to implementing a relational database from scratch. It's great to learn about the cryptography behind the blockchain etc, but the herd mind is horrible - so many better things to spend one's time on than a 100th implementation of blockchain. Why won't the hype die already?
- adilmoujahid 9y agoI would love to read a tutorial about implementing a relational database from scratch. Some people like to learn from the building blocks and others prefer to focus on high level applications.
- mediocrejoker 9y agoAgreed, I think no matter how good your abstractions are, it never hurts to know how they work under the hood.
- __bee 9y agoThis implementation is similar to the work that has been shared [by Daniel](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46 https://hackernoon.com/learn-blockchains-by-building-one-117...)
- smortaz 9y agoThanks for the write up! BTW, this would make a great Jupyter notebook (with the text, graphics, code).
- luckycharms810 9y agoI actually wrote up a small POC for blockchains in Python myself a few months ago. I went a little bit further in to the idea of transaction verification, as well as reverse traversing existing transactions as a part of that. https://github.com/ltavag/blocks https://github.com/ltavag/blocks Always love to see the interest here, I'm excited for the technology to become detached from Crypto speculation!
- michaelbuckbee 9y agoThe article adopts one of my preferred metaphors for the blockchain: "A blockchain is a distributed database that allows direct transactions between two parties without the need of a central authority." Which as a developer, I feel like I have a good handle on - but where I continually come up short is figuring out what I'd use such a data store for when building an application? The article starts off calling blockchain tech "significant and disruptive technologies that came into existence since the inception of the Internet." I'd love if someone had some examples of practical applications or uses that are being developed or could point me in the right direction.
- hudon 9y agoIt’s not clear that it doesn’t need a central authority. There is a rich history of blockchain consensus failure needing a central authority to tell everyone which chain is the right one. Satoshi did it in 2010, the Bitcoin developers did it in 2013, Vitalik did it with Ethereum in 2016. When the ledgers don’t reconcile, the developers are the central authority. And proof-of-work can’t save it because that too is centralized. So if it can’t do the first thing it promises it can do, maybe it becomes more like a Rube Goldberg machine than something that is meant to be useful/practical. The fact that people are praising CryptoKitties as a “practical application” seems to support the Rube Goldberg machine/toy theory.
- deleted 9y ago[deleted]
- kerkeslager 9y ago> It’s not clear that it doesn’t need a central authority. There is a rich history of blockchain consensus failure needing a central authority to tell everyone which chain is the right one. Satoshi did it in 2010, the Bitcoin developers did it in 2013, Vitalik did it with Ethereum in 2016. When the ledgers don’t reconcile, the developers are the central authority. And proof-of-work can’t save it because that too is centralized. There's a big difference between centralized influence and centralized control. The 2010 and 2013 examples were fairly homogeneous, because the changes were fairly obvious and reasonable, the thought leaders were widely trusted, and almost all the users followed them. But a large number of people didn't follow when Ethereum split (hence Ethereum Classic) or when Bitcoin split in 2017 (hence Bitcoin Cash). Thought leaders like Satoshi and Vitalik can influence most of the community of their respective coins, but they can't force anyone to accept their blocks. > So if it can’t do the first thing it promises it can do, maybe it becomes more like a Rube Goldberg machine than something that is meant to be useful/practical. The fact that people are praising CryptoKitties as a “practical application” seems to support the Rube Goldberg machine/toy theory. The problem I think is that decentralized control is really the only thing that blockchains offer over existing data stores. If you don't care about decentralized control, existing distributed logs such as Datomic are superior to blockchain in every way. I would go so far as to say that the vast majority of blockchain users fall into two categories: 1. People who don't understand decentralization. 2. People who don't care about decentralization but are riding the hype (whether they understand decentralization or not). This is why so many "blockchain applications" look like Rube Goldberg machines: 1. People who don't understand decentralization use it to implement things that would be much better served by an existing distributed datastore such as Datomic. 2. People who are just riding hype don't need to implement anything serious to fool people. They can implement a Rube Goldberg machine and there will always be suckers who take it seriously as long as it ticks the "blockchain" hype tickbox. Very few people actually understand decentralization AND care about it, and even fewer of those have the technical chops to implement them. So I think it will take time for more complex blockchain killer apps to emerge. It's worth noting that the first simple blockchain application, cryptocurrency, has already had pretty immense effects on our society, from darknet markets to crypto exchanges. You can argue whether the uses people use cryptocurrency for are good, but you can't argue it isn't useful--it's just not complex (from a logical standpoint--it's just a ledger--obvously it's technically and socially complex).
- geofftrojans 9y agoGreat introduction, thanks! Are you thinking about expanding this at all? If so, how?
- flashman 9y ago> Any business or organization that relies on a centralized database as a core competitive advantage can potentially be disrupted by blockchain technology. That's a pretty big "potentially" since many of those organizations use centralization as a defense against bad actors.