I have read a lot about Bitcoin and Defi. Now I am starting to explore some demonstrations. The first one is adapted from Dante Sblendorio's Active State Code. Now I know how proof-of-work and mining works.
This repo is not meant to educate. There are plenty of resources for that. It is where I organized my learning. It started when I got an example working and wanted to save my code in repo. Now I'll use it to continue my DeFi journey.
- Don't start with the Satsohi Nakamoto paper. Everyone gives that to you when you ask how Bitcoin works. It is a typical academic paper that has it all but doesn't present well. It's good to read this last, after understanding what a blockchain is, how proof-of-work works, and how mining works.
- Code a simple demonstration in any language you are most comfortable with.
- Dont' focus on wallets. The blockchain and mining are what is key.
Take from Synopsis
A blockchain is “a distributed database that maintains a continuously growing list of ordered records, called blocks.” These blocks “are linked using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. A blockchain is a decentralized, distributed and public digital ledger that is used to record transactions across many computers so that the record cannot be altered retroactively without the alteration of all subsequent blocks and the consensus of the network."
- Satoshi Nakamoto - original bitcoin paper. This is worth reading but it was very technical and left me with lots of questions that were easier to understand elsewhere. I got more out of this after learning how bitcoin works from Dante Sblendorio, thank you.
- Dante Sblendorio's Active State Code. I copied this code nearly verbatim in my
blockchain.py
file. For me, the best way to learn something is to code it. It forces me to pay attention to the details. Dante's explanations are clear. You don't need to use the flask web server. I added some more blocks in my code. - Justin Jaffe - CNET
- Bitcoin Wiki
- Difficulty in Mining. At first, and in the demonstration I coded, I could not see how the difficulty value was adjusted. This wiki cleared that up for me.