
⛓️ Blockchain & Web3 · State Machine
The states a blockchain transaction goes through from signing to final confirmation, including replacement and dropped transactions.
Drawing diagram…
State machine for an Ethereum transaction: Signed, Broadcast, Pending in the mempool, Included in a block, Confirming as more blocks are added, Final after enough confirmations. A pending transaction can be Replaced with a higher fee or Dropped from the mempool. An included transaction can be Reverted if the contract call fails.
stateDiagram-v2 [*] --> Signed Signed --> Broadcast Broadcast --> Pending: In mempool Pending --> Included: Mined in a block Pending --> Replaced: Resent with higher fee Pending --> Dropped: Evicted from mempool Included --> Reverted: Contract call failed Included --> Confirming Confirming --> Final: 12 confirmations Final --> [*] Reverted --> [*] Replaced --> [*] Dropped --> [*]
The main parts of a centralised crypto exchange: a matching engine, wallets split between hot and cold storage, deposits and withdrawals, and compliance checks.
How an exchange processes a crypto withdrawal safely: balance hold, 2FA, risk and address screening, signing, broadcast and confirmations.
How an NFT marketplace works: listings signed off-chain, metadata on IPFS, and sales settled by a marketplace smart contract.
How a team safely upgrades a smart contract behind a proxy: audit, testnet rehearsal, multi-signature approval and a timelock before the change goes live.
How a custodian separates internet-connected hot wallets from offline cold storage, with signing hardware and an air-gapped transfer process.
Where a decentralised app's parts run: frontend on IPFS, contracts on a layer-2 chain, and supporting services like RPC providers and an indexer.