1⃣ Chapter 1 is an introduction to crypto, blockchains, and Ethereum.
All fundamental concepts still apply, though back then there was a lot of attention around private blockchains which has subsided a lot.
And I missed to mention collectibles among the main use cases! 🎨
2⃣ Chapter 2 goes hands-on building a complete dapp for a simple Counter contract.
This chapter sets the toolchain to be used throughout the book:
- @reactjs for the UI
- @MetaMask for wallet
- @web3_js for Ethereum interaction
- @0xProject sol-compiler for Solidity contracts
Today I'd pick a different stack 🏗️
While React still dominates in web2 and Metamask is the most widespread wallet, @ethersproject has replaced web3.js for me.
And @HardhatHQ is stable (and awesome!) enough for contracts. It gets mentioned in the book, though as "buidler". 👷
Aside from that, this chapter still holds strong! 💪
For better or worse, the fundamentals of writing a dapp have changed little over these past two years. I'm surprised at how little the screenshots from Metamask have changed!
3⃣ Chapter 3 unloads all the theory behind transactions and smart contracts.
Transaction lifecycle hasn't changed, though a section on 1559-like transactions would come in handy today when discussing gas consumption!
As for contracts, the book was written on solidity 0.5, and we're on 0.8 now. Revert reasons and safe arithmetic (bye SafeMath!) would be a good addition to this chapter.
As for notable ERCs, I'd add ERC1155 next to ERC20 and ERC721.
This chapter makes heavy use of @EthereumRemix as an environment for experimenting with smart contracts.
Remix is a great tool for onboarding new devs and for quick experiments. I'm happy to see it well maintained and that it keeps getting love from the ecosystem!
4⃣ Chapter 4 discusses nodes, providers, querying, and events.
This one can be brought verbatim to 2021. Without using additional services (I'll get to thegraph later!), the polling, filters, and subs options for events are the same. And calls don't have much magic to them!
This chapter includes a dapp to monitor ERC20 txs, using REP (v1, still active!) as an example.
Fun fact: I once received a candidate application that included this very app claiming to be part of their portfolio. It did have nicer CSS though.
5⃣ Chapter 5 goes to sending transactions, and discusses development nodes, wallets, and seed phrases.
It includes gas estimation, tracking a transaction through its lifecycle, and handling generic errors; almost everything that you still need to account for today! 🗒️
This chapter does not include capturing application-specific revert reasons, for a simple reason: they didn't exist back then!
Today we have widespread revert strings, and custom errors were recently added to the language.
As for indexing, it was a good excuse to talk about the challenges that arise from reorgs when tracking events, which is a topic I was particularly interested in.
However, for all practical purposes, the indexing section today could be replaced with a tutorial on using @graphprotocol, which today powers many of the main dapps in the space via its decentralized indexing network.
This chapter also packs two pages with a discussion on decentralization which I still think is critical for the space.
The TLDR is that decentralized protocols with centralized apps are a perfectly valid setup. We don't need to decentralize everything for the sake of it!
For example, the Uniswap app is hosted and managed by a team, which allows to rapidly iterate on it.
And if you don't like that a set of tokens were censored, you can use a different app that interacts with the same underlying decentralized protocol!
7⃣ Chapter 7 packs several advanced topics around user onboarding.
It covers keystores, mnemonics, single-use addresses, deterministic deployments, smart accounts, upgradeability, off-chain signatures, gasless meta-transactions, and wraps up with ENS.
If I had to change something on this chapter, it'd probably be breaking it down into more than one, since it packs a lot of info!
Now, while onboarding has received less attention lately (I blame the bull market!), all concepts covered are still useful.
The onboarding chapter also includes a little trick I love: you can let users interact with contracts without requiring a web3 wallet by setting up forwarding proxies, where each proxy calls a different function on the same set of main contracts!
I recently found this technique was used as a frontend for dexes: users send tokens to an ENS address like dai.uniswap777.eth, and that address takes care of exchanging for DAI.
8⃣ Chapter 8 closes the book with the other main problem to be solved in Ethereum: scalability.
It starts with state channels, which were all the rage back then, and then goes on to build a simple PoA sidechain with a custom bridge, to close with an overview of Plasma.
Scalability is probably the topic that has changed the most in these 2 years 📈
State channels didn't prosper as expected, though they are being rethought as cross-chain solutions. Most POAs evolved into POS, and we saw a huge proliferation of sidechains.
And Plasma evolved into Rollups, which are taking the ecosystem by storm!
So, while it was nice to cover the theory behind sidechains and bridges in the book, I reckon that today a hands-on chapter on integrating with an existing sidechain or rollup would probably be more valuable to a developer building a dapp.
Last but not least, the book dedication would not be the same.
The book was dedicated to my soon-to-be-wife, but today it'd go to my wife and our soon-to-be-born daughter instead 👶
All in all, I'd say the book stood the test of time throughout these two years well. There is new stuff in the ecosystem, but the fundamentals are still there.
Read on for a long story full of adrenaline, black & white hats, bots, txs, and code snippets! ⤵️
Everything started with an email from the brother of a friend asking for help.
Amidst the excitement of an alpha leak, he had entered his seed phrase where he shouldn't had. He got almost all of his savings siphoned out of his account.
Yet not everything was lost! He still had $14K worth of RFuel tokens (no, I didn't know this project existed either) staked in a contract.
Unstaking them involved a 7-day waiting period, which the hacker had already kicked-off.
To everyone not following the crypto scene, a new use case that is an actual game changer has come up recently.
I'm talking about flash loans (thread) 🧵
Decentralized Finance (DeFi, for short) has become one of the most popular use cases.
Financial instruments from the traditional world, such as loans and derivatives, have been encoded as smart contracts and run on the Ethereum decentralized network.
It's easy to see why DeFi took off. The first and most widespread blockchain (Bitcoin) was used for monetary transactions.
It makes sense that the next big step would be instruments operating on that value, which took so much effort to move on chain.