14. Provider / Signer Intro
Overview
Section titled “Overview”Everything in this module rests on one distinction: reading from the chain versus writing to it. This lesson introduces the two objects that embody that split — the provider and the signer — which every frontend library (ethers, wagmi, viem) exposes in some form. Get this concept clear and the rest of full-stack dApp development is mostly plumbing.
Key concepts
Section titled “Key concepts”- Provider (read) — a connection to an Ethereum node (via an RPC endpoint) that lets your app read chain data: balances, contract state, past events, the current block. Reads are free, need no wallet, and change nothing.
- Signer (write) — an object backed by a private key, almost always the user’s wallet, that can sign transactions. Any action that changes state — minting, transferring, calling a state-changing function — goes through a signer and costs gas.
- Why the split exists — reading is public and safe to do for anyone; writing must be authorized by whoever owns the account. The provider/signer split is the code-level expression of the key-pair idea from Module 1: reads need no key, writes need the key.
- The wallet is the signer — in a dApp you don’t hold the user’s key; you request a connection, and the wallet (MetaMask, etc.) becomes the signer that prompts the user to approve each transaction. Your app never sees the private key.
- Contract instances use one or the other — a contract object connected to a provider
can only call read (
view) functions; connected to a signer it can also send transactions. Picking the wrong one is a frequent early bug.
Common pitfalls
Section titled “Common pitfalls”- Trying to send a transaction with a provider-only contract instance. Writes need a signer; this fails with a “missing signer / cannot estimate gas” style error.
- Expecting your app to “have” the user’s key. It never does — it asks the wallet to sign.
- Forgetting that reads are free and instant while writes cost gas and wait for a block, and designing the UI as if both were the same.
Check yourself
Section titled “Check yourself”- Which object do you need to call a
viewfunction, and which to send a transaction? - Where does the signer’s private key live, and does your frontend ever see it?
- Why is it safe to let anyone read the chain but not to let anyone write to your account?
Watch the Video
Section titled “Watch the Video”
Provider / Signer Intro
Video credit: Austin Griffith
