Welcome! Today we’re talking about how you and I interact with the Ethereum blockchain. More specifically, we’re covering the two key workflows that drive innovation on Ethereum: how developers create on-chain apps and how users use them.
By the end of this article, you’ll have a clear mental model of how the Ethereum ecosystem works.
Instead of the usual text-based post, we figured it would be easier to explain this with a video. This video assumes some familiarity with Ethereum concepts, so if you’re entirely new to this stuff, check out our starter series first.
For reference, here is the Figma file we used in the video.
If any of the concepts we mentioned in the video need further clarification, we’ve added the video notes below along with links to more information.
The Developer’s Workflow
👩💻💭 : “I should create an on-chain app to share with my friends!”
Write a smart contract in Solidity, a programming language. Smart contracts are simply programs that go on the blockchain
Compile the smart contract into bytecode, a blockchain friendly version of your program
Create a contractCreation transaction and send to developer wallet to be signed with the developer’s private key
Sign with the developer wallet, send to a node provider
The node provider sends the signed transaction to a blockchain node
Node accepts the transaction, and gossips the transaction to other nodes. Eventually, if consensus is reached, the transaction is marked as confirmed and the implicit blockchain state is updated
Developer creates a frontend to interact with the smart contract: A decentralized app (dApp)
Smart contracts are the “backend” to a dApp “frontend”
Developer deploys the frontend to the internet, such as to dapp.com
The User’s Workflow
👨💭: “My developer friend told me to check out her new dApp!”
User goes to the dApp, and wants to take some action via a transaction
dApp formats a transaction using a provider like ethers.js
The developer will have preloaded the contract information into the dApp. Ethers.js just helps with formatting it, estimating gas prices, etc.
dApp sends the transaction to the user’s wallet to be signed by the user’s private key
Wallet asks the user to pick the gas price and sign the transaction
The user’s wallet sends the signed transaction to a node provider
The node provider sends the transaction to a blockchain node
Node accepts the transaction, and gossips the transaction to other nodes. Eventually, if consensus is reached, the transaction is marked as confirmed and the implicit blockchain state is updated
This is exactly what happened with the developer’s transaction!
In the background, the dApp polls the node provider until the transaction is confirmed. This can sometimes take minutes
When the transaction is confirmed, the dApp can update the frontend for the user!
This video and article should give you a clear mental model of how all the pieces fit together when you interact with the Ethereum blockchain. See you next time!
We created this post with Sam Hatem - subscribe to his Mirror to learn about how crypto will be brought to the masses!