Two years ago I published my book "Ethereum for Web Developers", a book on building apps on Ethereum targeted at web2 developers.

Yet a lot has changed in these past two years, so let's see how the book would look like if written today 🧵

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.

eips.ethereum.org/EIPS/eip-1155
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.

blog.soliditylang.org/2021/04/21/cus…
6⃣ Chapter 6 starts with more advanced topics: indexing and storage.

The topic for this chapter was making use of external services for more optimized queries to the network and for storing large blobs of data.
The storage section makes heavy use of @IPFS, which is still the go-to storage solution 💽

Pinning services are undervalued though, and many NFT holders have lost their metadata due to poor IPFS data management practices.

theverge.com/2021/3/25/2234…
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.

thegraph.com/docs/developer…
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.

🧠 Smart accounts have been popularized through @argentHQ, @Dharma_HQ, @authereum, and others

🆙 Upgradeability has become widely spread along with proper governance

⛽️ Meta-transactions are in use with both centralized relayers and through @opengsn

blog.openzeppelin.com/gasless-metatr…
As for @ensdomains, it is more popular than ever, now aiming at becoming a full sign-in-with-Ethereum solution ⚡️

notes.ethereum.org/@djrtwo/sign-i…
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.

A beautiful project by @dmihal!
dmihal.medium.com/introducing-de…
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!

We have both optimistic and zk rollups thanks to @optimismPBC, @arbitrum, @StarkWareLtd, and @zksync (among others!).
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.

You can get the book at palla.dev/book, or check the code samples at github.com/spalladino/eth….

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Santiago Palladino

Santiago Palladino Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @smpalladino

19 Mar
Yesterday I managed to rescue +$14K worth of tokens from a friend's compromised account using Flashbots 🤖⚡️

github.com/flashbots/pm

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.
Read 21 tweets
19 Feb 20
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.
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(