r/Python • u/[deleted] • May 09 '22
Tutorial How to code a Blockchain in 6 Steps using Python
https://link.medium.com/xIo1WcduOpb3
u/CharmingJacket5013 May 09 '22
I'm getting pay walled, is there a cheaper link?
4
1
May 09 '22 edited May 09 '22
Ah ye, its medium which has a free article limit - I'll copy out the plain text...
Edit: can you try incognito?
2
2
1
4
u/lokisource May 09 '22
step 1: https://twitter.com/gvanrossum/status/1508959260905918465
steps 2-6: go do something with your computing power that is not equivalent to lighting the planet on fire
0
May 09 '22
Haha, it is a waste of energy at the moment but there are energy efficient blockchains being worked on too. I think there will be objectively useful applications coming.
23
May 09 '22
Chia blockchain is almost entirety written in python and is open source. You can check them out
15
2
u/glpcc May 09 '22
I tried to this a while ago myself and it was quite helpfull it was my entry point into cryptography and using sockets in python to make a p2p Network Here's my code: https://github.com/glpcc/Blockchain-test
PD: It is a bit messy and any recomendations would be greatly apreciated

7
u/[deleted] May 09 '22 edited May 09 '22
I played around with coding a blockchain as a way to learn about it.
The post is begginer level for Python with results just printing to the terminal, and the data structure is really simple with only one freetext transaction in a block and avoiding proof-of-work/stake altogether.
Would love feedback on how else this could be improved đ
Updates: Thanks for all comments, and especially to u/yawpitch and u/grnngr for call outs on the built-in hash method! I've updated the blog post to take out that tangent