๐ Transaction Signing: Mobile Approval
Discover how transactions are sent to mobile wallets for approval
Integrate Web3 wallets into your dApp
Your Progress
0 / 5 completed๐ Transaction Signing & Gas Estimation
Transaction signing is where things cost money. Unlike message signing (free), transactions modify blockchain state and require gas fees. When users click "Swap" on Uniswap or "Mint" on OpenSea, their wallet shows: transaction details, gas estimate, total cost. Users review, approve, and sign. The signed transaction is then broadcast to the network. Let's simulate the full flow.
๐ฎ Interactive: Transaction Approval Flow
Select a transaction type, review the details (like users see in MetaMask), adjust gas, and sign. Watch the transaction go from pending to confirmed.
Choose Transaction Type
โฝ Understanding Gas
Maximum gas you're willing to use. Simple transfer: 21,000. Token swap: 180,000. If actual usage is less, you get refund. Set too low = transaction fails, you still pay.
How much you pay per unit of gas. Higher price = faster confirmation (miners prioritize high-paying txs). 1 Gwei = 0.000000001 ETH. Typical: 20-50 Gwei.
Gas Cost = Gas Used ร Gas Price
Example: 21,000 ร 25 Gwei = 0.000525 ETH (~$1 at $2000/ETH). Plus transaction value.
Base fee (burned) + priority fee (to miner). Base fee adjusts per block. Users set max fee willing to pay. Wallet estimates for you. More predictable than legacy gas pricing.
๐ Transaction Security
Scammers create fake Uniswap clones at different addresses. Check "To" field matches official contract. Use verified addresses from Etherscan or official docs.
"Approve" transactions let contracts spend your tokens. Malicious contracts can drain approved tokens. Only approve trusted contracts. Use revoke.cash to audit/revoke old approvals.
Tools like Tenderly or MetaMask simulate transactions before signing. Shows expected outcome: "You receive 2000 USDC, send 1 ETH". If simulation shows unexpected transfers, REJECT.
๐ก Key Insight
Transaction signing is the highest-risk moment in Web3 UX. Users must review: recipient address, value, data (function call), and gas costโall in ~10 seconds. Mistakes are irreversible. This is why good dApps show clear transaction previews: "Swap 1 ETH โ 2000 USDC" instead of raw hex data. Modern wallets (MetaMask, Rabby) add transaction simulation and security warnings. But ultimately, users must verify everything. As a developer, your job is to make transactions as transparent as possible: decode data, show expected outcomes, warn about approvals. Trust but verifyโbecause on blockchain, there's no undo button.