Learning Blockchain & Solidity
This is a curated list of resources arranged in the order a learner is recommended to go through
- DLT: Distributed Ledger Technology
- Are blockchain and Distributed Ledger Technology (DLT) the same? No. This is a common misconception that many people have.
- Blockchain is just one type of distributed ledger.
- DLT is a digital system for recording the transactions of assets in which the transaction details are recorded in multiple places simultaneously. It provides a verifiable and auditable history of all information stored on that dataset.
- A distributed ledger has no central data store or administration functionality thus eliminating the need for a central authority or intermediary to process, validate or authenticate transactions.
- A centralized database essentially has a single point of failure. However, a distributed ledger is decentralized to eliminate the need of keeping a check against manipulation and enabling the secure functioning of the system.
- Resources for deeper understanding:
- Why do “Trustless Systems” matter?
- How does the Bitcoin Blockchain work?
- Bitcoin has been a buzzword forever, many of us even have them but let's take a moment to understand what does it actually means to have one and how does it work.
- A blockchain is a shared public ledger that works on a trustless exchange of cryptocurrencies between users each of which is uniquely identified through a public key/private key pair. This public ledger records all the transactions and verifies them through digital signatures generated by hashing private keys and the transaction message to prevent forgery.
- Now to pull out the need for a central party controlling the ledger, everyone maintains their copy of the ledger, and every time a transaction is made it is broadcasted to everyone. Having multiple such private ledgers might lead to inconsistency, this is where proof of work comes in.
- Proof of work(PoW) is a consensus algorithm where users compete to figure out a mathematical equation. This process is called mining and the users and those who take part in it are known as miners. Each block in the blockchain contains a set of transactions, proof of work, and hash for the previous block.
- Checkout this video from 3Blue1Brown below for the best description out there
- How is the Ethereum blockchain different from the Bitcoin Blockchain?
- What is ether?
- (Ethereum 2.0 is interesting, read more about it)
- The MakerDAO attack: https://www.gemini.com/cryptopedia/the-dao-hack-makerdao#section-the-dao-hack-remedy-forks-ethereum
- What are its subunits? Gwei and Wei
- Gas prices are denoted in gwei More on gas, gas price, gas limit : https://www.zastrin.com/courses/ethereum-primer/lessons/2-6
- Block gas limit: Block gas limit is the maximum cap applied to each block in Ethereum. Currently, a block can only include transactions whose total sum of gas is less than 8 million. The reason you have a limit for each block is to prevent someone from just writing an infinite loop in which case the transaction wouldn't complete it's execution resulting in block not getting mined.
- How does consensus work on Ethereum?
- Proof of Work : https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/
- Nonce : https://en.wikipedia.org/wiki/Cryptographic_nonce
- Proof of stake: https://www.investopedia.com/terms/p/proof-stake-pos.asp
- What do we mean by "n confirmations on a transaction"?
Mining on Ethereum
- What is mining?
- What is the hash rate?
Block on Ethereum
- What is a block on ethereum?
- https://ethereum.org/en/developers/docs/blocks/#:~:text=Blocks are batches of transactions,derived from the block data.
- https://ethereum.org/en/developers/docs/blocks/#:~:text=Blocks are batches of transactions,derived from the block data
- How do you see the transactions in a block?
- By using black explorers like etherscan.
- 70 transactions in a block, number of transactions that can be fitted in a block depend on the gas.
- What are Block Explorers?
- Online tool to view all transactions that have taken place on the blockchain
Learn to read these pages
Anatomy of a Transaction
- What is EVM?
- What is gas and gas price?
- How do you check the latest gas price?
- On Ethereum you check it using https://ethgasstation.info/
- How are the gas price and the network traffic-related and why?
- When the traffic is more the lower gas priced transactions will take longer to execute so in order to complete the transaction faster when traffic is high, the gas price needs to be high to complete a transaction in time
- Where does your code run? Can it be changed/taken down?
- On collection of nodes. They can’t be changed, since they are immutable.
- Understanding that there is one ethereum mainnet (the main blockchain) and then there are multiple testnets (test blockchains) with fake ether so that developers can test their code before going to the mainnet
- Make 2 addresses on Metamask and transfer some ETH(fake) from address A to B on ethereum testnet
- Understand ERC 20
- What is the approval event in solidity? Why is it required?
- Deploy an ERC 20 token
- Make a Solidity contract which does the following:
- which has one variable called
- deploy it on any ethereum testnet
- make one transaction to change the name variable to your name
- Understand ERC 721(NFT)
- Deploy ERC 721
- Read about Infura
- Difference between read and write calls on the blockchain
- Where does the read call’s computation take place?
- Make a ERC 20 token contract
- Deploy it on the Ganache
- Write a Python script using brownie to make 100 random transfers for the token
- Print the list of all those transfers in a CSV
Events and Logs
- Understanding Events and Logs
- How to read them with external code, like Python or JS scripts
- Pick any popular ERC 20 token deployed on Ethereum
- Write a script which fetches all the Transfer events from that token
- From those transfer events deduce the number of token holders, compare this number with the one stated on websites like coingecko
- Token Holders are addresses that currently have non-zero quantity of that token, if they held the token sometime in the past they will not be counted in this.
Understanding London fork
- Read about EIP-1559
- EVM Compatible
- Binance smart chain
- Binance Chain
Read about major projects in this ecosystem
- Wrapped tokens
- Oracles- Chainlinks
- Swaps- Uniswap, PancakeSwap
- Bridges- Binance Bridge
- Dex - dydx
- Lending- Alpaca, Compound, MakerDAO, Balancer, Bancor