These notes are from the Blockchain Theory 101 course by Melanie Swan on Udemy. Highly recommend checking it out!
Contents hide
What is blockchain and why do we need it?
- Blockchain is a software protocol that tells the Internet how to transfer assets & money similar to how SMTP tells the web how to send emails
- i.e. blockchain and SMTP are layers on the Internet (like plumbing for the Internet) and Bitcoin, Outlook, Gmail etc are applications on those layers
- These apps don’t need to know how SMTP or blockchain work – they just need to know the other person’s email address or wallet address to send emails/money to
- Money needs to be securely transferred across the Internet – so it isn’t able to be copied and spent more than once and so transactions are valid – blockchain solves this
- Blockchain allows securely transferring info via smart networks that algorithmically verify the info was transferred
- The Internet effectively becomes a VPN/tunnel between two parties
- We need blockchain because:
- It’s scalable – algorithms can verify identities, execute transactions, check balances etc far quicker than human beings
- More scalability means access to financial services/credit for everyone
- Greater reach enables niche/long-tail economics, finance and governance to provide for every market rather than current one-size-fits-all approaches
Technical aspects of blockchain
Cryptographic wallets and the public ledger
- Software wallets don’t hold money, they hold public/private keys that allow you to access your money on a publicly-accessible Internet ledger on the blockchain
- This ledger keeps track of all transactions and everyone’s balances and updates when a transaction in the network clears
- Ledgers are pseudonymous – everyone can see how much money is in a wallet address but noone knows the personal entity that holds the wallet address
- To send money – get the other person’s wallet address and submit an amount to send
- The blockchain confirms you have enough in your wallet and then transfers it
Peer-to-peer distributed system
- Tons of machines run the blockchain/host its infrastructure – no single machine controls everything – it’s a global peer-to-peer distributed software system on the Internet
- Every machine on the network needs to hold the same copy of the ledger and sync when a transaction is created (the ledger is updated)
- Every so often (e.g. 10 minutes), transactions on the network are collected into blocks which are only recorded on the blockchain after being validated by miners
- Every subsequent block calls the next block as the first element
- That chains together the ledger into “blocks” of transactions that are time-stamped and hosted on machines globally – this is why it’s called the blockchain
Mining
- Mining is how some blockchains validate & record transactions in a ledger:
- Every so often, when a block is created with all the transactions in the period, a random number is issued (called a nonce)
- Then every miner tries to guess this random number (~billions of times/sec)
- Note – while you can run mining software on your machine, you’ll likely never make a correct guess because it’s not fast enough
- Once a miner guesses correctly, it gets monetary rewards (new block rewards in the system + transaction fees from parties submitting transactions)
- The winning miner confirms and validates all transactions in the block that are valid
- All other miners/peer machines on the network then also confirm/record those tx’s
- The entire system constantly updates the ledger periodically for all new transactions
- Every peer machine should have the current state of the ledger
- The point of mining is to be purposefully wasteful so only trustworthy people are kept on the network
- The more costly it is to guess the nonce, the harder it is to make a fraudulent transaction (and harder for miners)
Risks of blockchain
- Scalability
- Democratic nature of blockchains results in slow decision-making that can slow the growth of the blockchain as more people get involved
- Hard fork – an updated version of the blockchain separate from the current one
- All wallet balances on updated nodes in the current chain get included in the new hard fork of the blockchain while the wallet balance on older nodes don’t
- This can be avoided with soft forks (which are backwards compatible)
- Cybersecurity – people can hack/steal coins through software that doesn’t run directly on the underlying blockchain network (e.g. exchanges, wallet software)
- e.g. hacker impersonating your wallet and telling you to send money in a transaction again (but redirecting it to another wallet address)
- Concentration of mining – while Bitcoin is decentralized and peer-to-peer, the bitcoin mining operation is highly centralized and run mostly by 6-10 companies in China & Russia
- Regulation – Different state governments could ban or regulate crypto
Initial coin offerings
- Initial coin offerings (ICOs) are like Kickstarter for crypto projects – a blockchain/crypto project gives away coins (not equity) which allows:
- Investors to have liquidity immediately
- Crypto projects to raise money in a liquid way
Applications of blockchain
- While digital payments are the most obvious usecase, blockchains have other applications:
- Digital registries for all kinds of assets (cars, houses, money etc) and identity documents (like passports and VISAs)
- Logistics (supply chain) – record the status and location of shipments on a blockchain so transfers can be smoother, quicker and obvious to all parties
- Healthcare – standardised “digital health wallets” to securely hold insurance plans, prescription info, health history etc
- IoT (Internet of Things) – autonomously control millions of items securely
- Registry of assets (e.g. stocks, bonds etc) – once registered, assets can be immediately transferred or controlled in the future via smart contracts
- e.g. bond rates could be increased automatically depending on market conditions
- Governance
- Register all legal docs (like land title, auto registrations etc) on blockchain and transfer without bureaucracy of government
- Confirm identities without government approval – register driver’s license, birth certificates, VISA, passports etc on blockchain
- e.g. instead of sending schools your transcript, they could look it up themselves on the blockchain to confirm
- Secure voting systems (e.g. quadratic voting, delegative democracy, random sample elections, Page Rank voting)
- Legal contracts – legal docs can be pushed onto the blockchain with a proof-of-existence hash corresponding to doc’s contents at that particular point in time
Implementing blockchain in your organisation
- There are three ways to think about implementing blockchain today in your business:
- A way to connect to other parties in your industry
- A way to offer clients better services via blockchain (i.e. transfer info and money better, reach more customers, automate things etc)
- A way to reduce costs and risks within your business
- To move your organisation onto blockchain, follow this process:
- Identify processes within your org where there’s a transfer of info, money or assets
- Separate the act of transferring into a human decision-making component and a pure execution part
- Automate whatever you can via blockchain
Smart contracts
- Smart contracts are agreements between two or more parties that execute code on a blockchain if they meet the conditions of the contract
- Issue – they automate a lot of human effort but are we ready for code that automatically executes without any humans involved?
Blockchain consensus algorithms
- Blockchain consensus algorithms address two important technical problems
- The double spend problem – we don’t want multiple copies of money made/spent – we want to ensure money is only spent once
- Byzantine General’s Problem – we don’t know the status/trustworthiness of nodes distributed on our network – so how can we protect our network from bad actors?
- A consensus algorithm figures out how the network comes to the correct, synced state and updates all nodes after the state is changed (i.e. because of a transaction)
- Types of consensus algorithms:
- Proof of work (used by Bitcoin) – uses mining to randomly guess the nonce and validate & update state when guessed
- Works very well but isn’t scalable – miners convince the network they’re trustworthy by performing computationally expensive tasks to get rewards
- Proof of stake – depositing some stake in the network’s coin to convince the network they’re acting in good faith to validate transactions on the network
- More human-based voting system, much more scalable but may seem untrustworthy to new participants
- Prediction markets – getting external parties to review/guess the accuracy of transactions on the network and giving them rewards when they do
- Self-mined networks – algorithmic participants in the network (not human ones) could mine for each other (e.g. kitchen sensor in IoT network mines for bathroom sensors etc)
- Proof of work (used by Bitcoin) – uses mining to randomly guess the nonce and validate & update state when guessed
How to get involved in blockchain today
- Blockchain is future tech but you can get involved in it today and personally benefit:
- Download a digital e-wallet so you can receive crypto (like Bitcoin)
- Fill your wallet from your bank or different kinds of exchanges or from friends
- Purchase things (i.e. with QR codes in-store or online using your address)
- Invest in/speculate on crypto – just be aware it’s quite volatile and high-risk
- Accept crypto as payment through payment merchants like BitPay