Web3 Development: The New Frontier of Software Engineering

# Web3 Development: The New Frontier of Software Engineering

### Author: Son Nguyen

> Date: 2024‑06‑30

## 1. Why Web3?

Web3 moves power from centralized entities to users by leveraging:

- **Trustless Execution:** Code-enforced rules without intermediaries
- **User Sovereignty:** Self-custody of data & assets
- **Composability:** “Money legos” that interoperate
- **Permissionless Innovation:** Anyone can build & deploy

---

## 2. Core Concepts & Definitions

| Term | Definition | Example | Key Benefits | Common Pitfalls | Resources |
| -------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------ | ------------------------------------------------- | ---------------------------------------- |
| **Blockchain** | Immutable, distributed ledger of transactions grouped into cryptographically linked blocks. | Ethereum Mainnet | Censorship‑resistant; verifiable audit trail | Network congestion; storage bloat | https://ethereum.org/en/developers/docs/ |
| **EVM** | Gas‑metered virtual machine that executes smart contract bytecode deterministically across all nodes. | Ethereum Virtual Machine | Deterministic execution; broad ecosystem support | Limited compute; gas complexity | https://docs.soliditylang.org/ |
| **Gas** | Unit of computation cost for executing transactions and smart contract operations. | 21,000 gas for simple ETH transfer | Prevents network spam; incentivizes optimization | Fee volatility; unpredictable costs | https://ethgasstation.info/ |
| **Smart Contract** | Self‑executing on‑chain code enforcing business logic without intermediaries. | ERC‑20 token contract | Trustless automation; transparent rules | Bugs are permanent; security vulnerabilities | https://docs.openzeppelin.com/contracts |
| **Proxy Pattern** | Upgradeable contract design separating storage (proxy) from logic (implementation). | OpenZeppelin Transparent Proxy | Enables seamless upgrades; preserves state | Increased complexity; storage collisions | https://docs.openzeppelin.com/upgrades |
| **IPFS** | Content‑addressed, peer‑to‑peer storage network for immutable file hosting. | Storing NFT metadata | Decentralized; censorship‑resistant | Availability reliant on pinning; slower retrieval | https://docs.ipfs.io/ |
| **DID** | Decentralized Identifier standard mapping wallet addresses to user‑controlled identifiers. | did:ethr:0x1234 | User sovereignty; portable identity | Fragmented standards; adoption hurdles | https://www.w3.org/TR/did-core/ |
| **Rollup** | Layer‑2 scaling solution batching off‑chain transactions and posting compressed proofs on-chain. | Optimism | Lower fees; higher throughput | Delayed finality; bridge risk | https://optimism.io/docs/ |
| **Bridge** | Protocol enabling cross‑chain asset transfers via locking/minting or messaging. | Wormhole | Interoperability; liquidity expansion | Smart contract exploits; slippage | https://wormholenetwork.com/ |
| **Meta‑Transaction** | Mechanism allowing users to send gasless transactions via relayers covering gas fees. | Biconomy relayer | Improved onboarding; lower friction | Reliance on trusted relayer; replay attacks | https://docs.biconomy.io/ |
| **ZKP** | Cryptographic proof enabling verification of data without revealing the underlying information. | zkSNARK proof for private balances | Enhanced privacy; scalable proofs | Complex setup; heavy computation | https://zokrates.github.io/ |
| **Subgraph** | Decentralized indexing service exposing blockchain data through GraphQL APIs. | The Graph Vault subgraph | Fast queries; real‑time indexing | Schema maintenance; indexing delays | https://thegraph.com/docs/ |

---

## 3. Blockchain & EVM Internals

### 3.1 Merkle Patricia Trie

- **Structure:** Key-value store → efficient proofs
- **State Root:** Snapshot of entire state