Web3 Standards, Explained Simply
Clear explanation on window.ethereum, EIP-1193, EIP-6963, ERC-4337, ERC-7702, and x402
Introduction
You open a website, click Connect Wallet, and something just... works. But have you ever wondered what's actually happening under the hood? Who's talking to who? How does a website even know you have a wallet installed?
This article is for developers who are curious about the engineering behind Web3 i.e, the standards and protocols that make wallets, transactions, and payments work the way they do. No PhD required 😁. If you've written some JavaScript before, you'll follow along just fine.
Prerequisites
Before diving in, it helps if you're comfortable with:
Basic JavaScript i.e, variables, functions, async/await
What a browser extension is (like MetaMask, Phantom etc.)
A rough idea of what a blockchain wallet is e.g an address that holds funds
HTTP basics — what a request and response look like
You don't need to know Solidity, understand consensus mechanisms, or have built a dApp before. This article explains the standards, not the deep internals.
Web3 has a lot of acronyms. Most of them sound harder than they are. This article breaks down six foundational standards — what they are, the problem they solve, and how they work — as simply as possible.
window.ethereum
When you install a crypto wallet like MetaMask in your browser, it quietly drops a JavaScript object called window.ethereum onto every webpage you visit. Think of it as a door — your web app knocks on it, and the wallet answers.
window.ethereum is the socket in the wall. The socket doesn't do the work — it just gives your app a standardised place to connect to the electricity (the blockchain).It is injected by the wallet extension — your code does not create it.
Your app first checks if it exists before doing anything wallet-related.
Through it, you can ask for the user's wallet address, send transactions, switch networks, and more.
If
window.ethereumisundefined, the user has no wallet installed.
// Check if a wallet is installed
if (typeof window.ethereum !== 'undefined') {
console.log('Wallet detected!');
// Ask the user to connect their wallet
const accounts = await window.ethereum.request({
method: 'eth_requestAccounts'
});
console.log('Connected address:', accounts[0]);
} else {
console.log('Please install MetaMask.');
}
The problem it solves
Before wallets started injecting
window.ethereum, every app had to build its own way to talk to the blockchain. This gave developers a single, consistent entry point — check one object, and you have access to everything.
EIP-1193
window.ethereum exists, but what should it look like? What methods should it have? EIP-1193 is the official standard that answers those questions. It defines the exact API (the set of rules) that every wallet must follow so that any app can talk to any wallet.
Defines one core method:
request(), used to send any command to the blockchain.Defines events like
accountsChangedandchainChangedso your app can react in real time.Before this standard, every wallet had different method names, different formats — a mess for developers.
MetaMask, Coinbase Wallet, Brave Wallet etc all follow EIP-1193.
const provider = window.ethereum;
// All EIP-1193 wallets use this same .request() method
const chainId = await provider.request({ method: 'eth_chainId' });
console.log('Chain ID:', chainId); // e.g. "0x1" for Ethereum mainnet
// Listen for account changes (user switches wallet address)
provider.on('accountsChanged', (accounts) => {
console.log('New account:', accounts[0]);
});
// Listen for network changes (user switches to a different chain)
provider.on('chainChanged', (chainId) => {
console.log('Switched to chain:', chainId);
});
The problem it solves
Without EIP-1193, developers had to write separate code for every wallet. With it, you write one integration and it works everywhere — just like HTML works in every browser.
EIP-6963
The problem: window.ethereum is a single slot. If you have MetaMask and Coinbase Wallet both installed, they fight over who gets that slot. Whoever loads last wins, and the other wallet becomes invisible to the app. The user has no say.
The fix: EIP-6963 ditches the single slot entirely. Instead, each wallet announces itself through browser events. The app listens, collects all the announcements, and shows the user a proper wallet picker.
Wallets fire an
eip6963:announceProviderevent with their name, icon, and provider object.Your app listens for these events and builds a list of all available wallets.
The user can now actually choose their wallet, rather than it being chosen for them.
Backwards compatible, that mean old apps using
window.ethereumstill work fine.
const wallets = [];
// Listen for each wallet announcing itself
window.addEventListener('eip6963:announceProvider', (event) => {
wallets.push(event.detail);
console.log('Wallet found:', event.detail.info.name);
// e.g. "MetaMask", "Coinbase Wallet", "Brave Wallet"
});
// Ask all installed wallets to announce themselves
window.dispatchEvent(new Event('eip6963:requestProvider'));
// Now wallets[] has every installed wallet — show them to the user
The problem it solves
The "last wallet wins" race condition that plagued multi-wallet users. EIP-6963 is now the recommended standard for wallet discovery in all new dApps.
ERC-4337
Today, your Ethereum wallet is controlled by a private key, i.e a long secret string you must never lose. Lose the key, lose everything. ERC-4337 (Account Abstraction) replaces this rigid system with a smart contract wallet that can have its own rules — like a bank account with programmable logic baked in.
It introduces four key players that work together:
UserOperation
Instead of a regular transaction, you submit a UserOperation — an object describing what you want to do. It can include multiple actions in one go.
Bundler
A Bundler collects many UserOperations from different users, packs them into a single real transaction, and submits it to the blockchain. Like a postal worker batching packages.
EntryPoint
A single smart contract on-chain that receives the bundle, verifies each UserOperation is valid, then executes them. It's the gatekeeper and executor.
Paymaster
An optional contract that pays gas fees on behalf of the user. This means a dApp can sponsor gas, or users can pay fees in USDC instead of ETH.
No seed phrases required i.e wallets can use biometrics, social login, or multi-signature.
Lost your key? Social recovery lets trusted contacts help restore access.
Apps can sponsor gas fees i.e users transact without ever holding ETH.
Works on top of Ethereum today i.e no protocol changes needed. Launched on mainnet March 2023.
Over 40 million smart accounts deployed as of 2024.
The problem it solves
Traditional wallets are too fragile and too technical for mainstream users. ERC-4337 makes wallets programmable, so they can work more like modern apps: recoverable, flexible, and forgiving of mistakes.
ERC-7702
ERC-4337 creates new smart wallets. But what about the millions of people who already have regular wallets (EOAs) and don't want to move everything to a new address? ERC-7702 solves this, it lets your existing wallet borrow smart contract powers for a transaction, then go back to normal.
Your wallet stays at the same address i.e no migration, no moving assets.
For one transaction, your wallet delegates to a smart contract and gains its abilities.
Abilities include: batching multiple actions into one transaction, having gas sponsored, and using custom sign-in logic.
After the transaction, your wallet returns to its original, simple form.
Complements ERC-4337 — it doesn't replace it. They work together.
Proposed by Vitalik Buterin in May 2024 and shipped as part of Ethereum's Pectra upgrade.
// Before ERC-7702 — two separate transactions needed
// 1. Approve token spending
// 2. Swap the token
// With ERC-7702 — your regular wallet can do both in ONE
// by temporarily delegating to a smart contract
const authorization = {
address: '0xSmartContractLogic...', // the logic to borrow
chainId: 1,
nonce: 42
};
// Sign the authorization with your regular private key
// Your EOA now temporarily acts like a smart wallet
// and can batch approve + swap in one go
ERC-7702 vs ERC-4337 — in one line
ERC-4337 creates a brand new smart wallet. ERC-7702 upgrades your existing wallet on the fly. They're not competing, ERC-7702 actually uses ERC-4337 infrastructure under the hood. Think of 4337 as the toolbox, and 7702 as the adapter that lets old wallets use it.
x402
HTTP — the protocol the web runs on — has always had a status code called 402 Payment Required. It was reserved in 1991 but never actually used. x402 finally activates it. It lets servers charge for resources directly inside an HTTP request, settled instantly with stablecoins like USDC, with no logins, no subscriptions, and no payment processors.
Here is exactly how a payment flows:
Client requests a resource
An app, browser, or AI agent sends a normal HTTP request — e.g.
GET /api/data.Server says "402 — payment required"
The server replies with the price, the token to pay in (e.g. USDC), and the destination wallet. All in a header.
Client signs and pays
The client signs a payment payload with their wallet and retries the request, attaching the signed payment in a header.
Facilitator verifies on-chain
A facilitator service checks the payment on-chain and confirms it's valid — no wallet popups, no browser redirects.
Server delivers the resource
Payment confirmed — the server returns the data. The entire thing happens in one HTTP conversation.
Launched by Coinbase in May 2025 — already processed over 100 million payments.
Works with near-zero fees on Layer 2 networks like Base.
No accounts, no API keys, no subscriptions — pure pay-per-use.
Especially powerful for AI agents — a bot can autonomously pay for data, compute, or another API without any human step.
Supported by Google, Visa, and Cloudflare. Open standard i.e, anyone can build on it.
import { withPaymentRequired } from 'x402-express';
// Protect this endpoint — it costs $0.01 USDC per call
app.get(
'/api/weather',
withPaymentRequired({
amount: '0.01', // $0.01 USDC
currency: 'USDC',
network: 'base', // Layer 2 — near-zero gas fees
address: '0xYourWallet...'
}),
(req, res) => {
res.json({ temp: '28°C', city: 'Lagos' });
}
);
The problem it solves
Credit cards are too slow, too expensive, and require human accounts. APIs need API keys and billing plans. x402 makes paying for web resources as simple as making an HTTP request — ideal for both developers and AI agents operating autonomously.
| Standard | One-liner | Launched |
|---|---|---|
| window.ethereum | The wallet's entry point injected into every webpage | 2015 |
| EIP-1193 | The standard API all wallets must follow | 2018 |
| EIP-6963 | Multi-wallet discovery — no more "last wallet wins" | 2023 |
| ERC-4337 | Smart contract wallets — recoverable, flexible, gasless | 2023 |
| ERC-7702 | Gives your existing wallet temporary smart wallet powers | 2024 |
| x402 | Pay for web resources directly over HTTP with stablecoins | 2025 |
Summary
These six standards tell a story that builds on itself. window.ethereum gives your app a door to knock on. EIP-1193 defines what that door looks like for every wallet. EIP-6963 makes sure all your wallets can stand at the door at the same time. ERC-4337 makes wallets smarter and safer. ERC-7702 brings those smarts to the wallets people already have. And x402 takes the whole payment idea one step further — baking it directly into the web itself.
WAGMI 🚀
About the author
Frontend Developer• Technical Writer• Content Creator• Tech Enthusiast• Music Addict
Comments
Join the discussionNo comments yet. Be the first to comment.


