Software Engineering
Blockchain fundamentals, smart contracts, security, dApps and scaling for Web3 developers.
A path for developers who want to build on blockchains. It starts with how chains, consensus and cryptography work, surveys the main chain families and layer 2s, then covers writing, testing and securing smart contracts, building dApps with client libraries and nodes, and scaling techniques. Each subject links the official documentation.
The subjects follow the roadmap.sh Blockchain roadmap.
A blockchain is a shared, append-only ledger that many independent computers keep in sync without a central operator. Before writing contracts, understand what problem that solves, what it costs in speed and complexity, and when an ordinary database is the better answer.
A chain of blocks where each block commits to the previous one by hash, so changing history means redoing all later work and convincing the network. Copies live on every full node and agreement comes from a consensus protocol.
Control is spread over many parties so no single one can censor, rewrite or shut down the system. It has several axes: who runs nodes, who produces blocks, who writes the client software and who governs upgrades.
Blockchains let strangers share state and move value without trusting an intermediary, with rules enforced by code that anyone can audit. The trade-off is lower throughput, public data and irreversible mistakes.
Payments and stablecoins, decentralised finance, tokenised assets, NFTs, DAOs, supply-chain provenance and identity. Many proposed uses do not need a blockchain at all; ask whether multiple distrusting writers really share the data.
Each block has a header (parent hash, timestamp, state or Merkle root, consensus data) and a body of transactions. Merkle trees let light clients prove a transaction is included without downloading the whole block.
Users sign transactions with a private key, nodes gossip them into a mempool, a block producer orders some of them into a block, and the network validates and appends it. Fees decide priority.
The building blocks underneath every chain: cryptography, wallets, how nodes store and share data, how the network splits and rejoins, and how chains talk to each other. These concepts carry over whichever chain you build on.
Native assets such as BTC and ETH pay transaction fees and reward block producers, which is what makes securing the network worth it. Tokens are different: they are balances recorded by smart contracts on top of a chain.
A wallet holds private keys, not coins; the coins live on-chain. Custodial versus self-custody, hot versus hardware wallets, seed phrases (BIP-39) and smart-contract accounts with recovery are the key distinctions.
Hash functions (SHA-256, Keccak-256) link blocks and build Merkle trees; elliptic-curve signatures (secp256k1 ECDSA, Ed25519) prove ownership of an account. An address is derived from the public key.
Removing a trusted middleman shifts trust to cryptography, open code and the honesty of a majority of validators. Bridges, multisig admins and oracles often reintroduce trusted parties, so check where trust actually sits.
A temporary fork happens when two blocks compete and the fork-choice rule picks one. Protocol upgrades are soft forks (backward compatible) or hard forks (old nodes reject new blocks), and a contested hard fork can split a chain, as with Ethereum Classic.
Block producers earn new issuance plus fees, which pays them to follow the rules. Proof of work spends electricity to win blocks; proof of stake locks capital and slashes it for misbehaviour. MEV adds income from transaction ordering.
Nodes keep blocks, receipts and current state in key-value stores. Ethereum organises state as a Merkle Patricia trie; full, archive and pruned nodes trade disk space against how much history they can answer for.
Public mainnets hold real value, public testnets such as Sepolia mirror them with free coins, and private or consortium networks restrict who can join. Local dev chains like Anvil or Hardhat Network run on your machine.
Moving assets and messages between chains through bridges, light-client protocols like IBC, or messaging layers. Bridges have suffered some of the largest hacks, so understand each design's trust assumptions.
Proof-of-work chains consume large amounts of electricity by design. Ethereum cut its energy use by over 99% when it moved to proof of stake in 2022, and energy footprint is now a common criterion when choosing a chain.
How independent nodes agree on one order of transactions despite failures and attackers. Protocols differ in what they make costly (energy, stake, identity), how fast blocks become final, and how many faulty participants they tolerate.
Proof of work: miners search for a nonce that makes the block hash fall below a target, and the chain with the most cumulative work wins. Simple and battle-tested in Bitcoin, but energy-hungry and finality is only probabilistic.
Proof of stake: validators lock tokens and are chosen to propose and attest to blocks; dishonest behaviour such as double-signing is slashed. Ethereum uses it with checkpoints that become final after about two epochs.
Byzantine fault tolerant protocols, such as PBFT and Tendermint/CometBFT, reach agreement through voting rounds and give instant finality while fewer than a third of validators are faulty. They suit smaller, known validator sets.
Proof of history is Solana's verifiable clock: a sequential hash chain that timestamps events so validators agree on ordering without exchanging many messages. It works alongside proof of stake, not as a replacement.
Chains differ in execution model (account-based EVM, UTXO, TVM, Solana's parallel runtime), consensus and ecosystem. Most smart-contract jobs target EVM chains, but knowing the other families helps you pick the right platform.
Instead of account balances, the ledger is a set of unspent transaction outputs; a transaction consumes some and creates new ones. Easy to validate in parallel, but stateful contracts are harder to express.
The first blockchain, using proof of work and UTXOs with a deliberately limited scripting language. Development focuses on payments and security; layers like Lightning add fast payments on top.
A proof-of-stake chain using an extended UTXO model, where outputs carry data and validator scripts. Contracts are written in Plutus (Haskell-based) or higher-level languages like Aiken.
A high-throughput chain whose runtime executes transactions in parallel because each declares the accounts it touches. Programs are usually written in Rust, often with the Anchor framework.
Chains running the TON Virtual Machine, built for asynchronous message passing between contracts and sharding. Contracts communicate only through messages, which changes how you design transactions.
The Open Network, originally designed by Telegram and integrated with its app. Contracts are written in FunC or Tact, and the wallet itself is a smart contract.
A TVM-based chain that grew out of the original Telegram Open Network code, with dynamic sharding and contracts written in a Solidity dialect (TVM Solidity).
A TVM-based, multi-chain network derived from Everscale's technology, positioned for regulated financial use with workchains for specific applications.
A project built on TVM-based chains that stores Git repositories and their governance on-chain, aiming at a tamper-evident software supply chain. Niche, but a good example of non-financial use.
Chains that run the Ethereum Virtual Machine share Solidity, tooling, wallets and address formats, so a contract can often be redeployed across them unchanged. They differ in fees, finality, decentralisation and the opcodes or precompiles they support.
The original smart-contract platform and the reference EVM chain: proof of stake since 2022, the largest developer ecosystem, and a roadmap that pushes most activity to rollups.
A family of scaling products around Ethereum, best known for the Polygon PoS chain and its zero-knowledge efforts (zkEVM, AggLayer). Low fees made it popular for games and payments.
Binance's EVM chain with a small validator set, cheap fees and fast blocks. It forked from Geth, so most Ethereum tooling works directly.
An EVM chain secured by a large, low-cost validator set, with a stablecoin (xDAI) as gas so fees are predictable. Often used for payments and as a testing ground for Ethereum features.
A network of chains with fast finality; its C-Chain runs the EVM and teams can launch their own custom L1s with chosen validators and gas tokens.
An EVM chain built on a DAG-based asynchronous BFT consensus for quick finality. Its successor, Sonic, launched in 2024 and the ecosystem migrated there.
EVM-compatible parachains on Polkadot (Moonbeam) and its canary network Kusama (Moonriver), letting Solidity contracts reach other parachains through cross-chain messaging.
Layer 2s execute transactions off Ethereum and post data and proofs back to it, inheriting much of its security at a fraction of the cost. Check each one's stage of decentralisation: who can upgrade it and whether withdrawals can be censored.
An optimistic rollup with interactive fraud proofs. Arbitrum One is its main chain, and Stylus lets contracts be written in Rust or C++ compiled to WebAssembly alongside the EVM.
An optimistic rollup built on the open-source OP Stack, which many other chains reuse to form the "Superchain". It stays very close to Ethereum's own execution client.
Coinbase's L2 built on the OP Stack. Cheap fees and easy onboarding from Coinbase accounts made it one of the busiest rollups for consumer apps.
A validity (ZK) rollup using STARK proofs. It is not EVM-compatible: contracts are written in Cairo, and every account is a smart-contract account by default.
Contracts cannot fetch data from the outside world themselves, so oracles bring prices, randomness, weather or API results on-chain. A manipulated or stale oracle is a common root cause of DeFi exploits, so design for its failure.
Applications that combine on-chain contract logic with off-chain computation and data delivered by oracles, such as insurance that pays out based on a flight-status feed.
Many independent node operators fetch and aggregate data so no single source can lie. Read the heartbeat and deviation thresholds of a feed, and always check the returned timestamp for staleness.
The most widely used oracle network, offering price feeds, verifiable randomness (VRF), automation and cross-chain messaging (CCIP). Contracts read feeds through the AggregatorV3Interface.
Programs deployed to a chain whose code and state are public and, by default, immutable. Every operation costs gas and every bug can be exploited by anyone, so contracts favour small, simple, well-tested code built on audited libraries.
The main EVM language: statically typed, curly-brace syntax, with contracts, inheritance, events, modifiers and custom errors. Learn storage versus memory versus calldata, and the checked arithmetic introduced in 0.8.
A Pythonic EVM language that leaves out inheritance, modifiers and inline assembly to keep contracts easy to audit. Used by Curve and other DeFi protocols.
The language for Solana programs, Polkadot ink! contracts, NEAR and Arbitrum Stylus. Its ownership model catches many memory bugs at compile time, though on-chain logic bugs remain your job.
A popular editor for contract work when paired with a Solidity extension that adds syntax checking, go-to-definition and inline compiler errors, usually alongside a terminal running Foundry or Hardhat.
A browser IDE for writing, compiling, deploying and debugging Solidity without installing anything. Excellent for learning and quick experiments; real projects usually move to a local framework.
Standard interfaces wallets and apps understand: ERC-20 fungible tokens, ERC-721 NFTs and ERC-1155 multi-tokens. Inherit audited implementations rather than writing your own, and watch the approve race and decimals.
Contracts are immutable, so upgradability comes from proxies (transparent, UUPS, beacon) that delegate calls to a replaceable implementation. Storage layout must stay compatible and the upgrade key becomes a major trust point.
From a developer's side: connecting to injected providers (EIP-1193), requesting accounts, prompting signatures and switching networks. Libraries like wagmi and connectors like WalletConnect handle most of it.
Services that hand out free testnet coins so you can pay gas while testing. They are rate-limited and sometimes require a mainnet balance; local dev chains avoid them entirely.
On-chain storage is very expensive, so large files go to IPFS, Filecoin or Arweave and only a content hash (CID) is stored in the contract. Content-addressing proves integrity but somebody must still pin the data.
After deployment, watch events, balances, admin actions and failed transactions so you notice attacks or broken integrations quickly. Tools range from block explorers to alerting services and custom indexers.
Frameworks compile contracts, run a local chain, execute tests, script deployments and verify source on explorers. Foundry and Hardhat dominate today; older tools are worth recognising in legacy codebases.
A fast Rust toolkit: forge builds and tests with tests written in Solidity, cast talks to chains from the CLI and anvil runs a local node. Built-in fuzzing and cheatcodes like vm.prank make tests concise.
A TypeScript-based environment with a local network, plugins, console logging from Solidity and tests in JavaScript or Solidity. Pairs naturally with ethers or viem in a full-stack dApp repository.
A Python framework built on web3.py and pytest. It is no longer actively maintained, and its authors point users to Ape, so learn it only to work on existing projects.
The first popular Ethereum framework, with migrations and Ganache as its local chain. ConsenSys sunset Truffle and Ganache in 2023, so new projects should choose Hardhat or Foundry.
Test each function in isolation against a fresh local chain: success paths, reverts with the expected error, emitted events and access control. Fork tests and fuzz tests build on top of these.
Exercise several contracts together, often on a mainnet fork, so you test against real tokens, oracles and protocols. They catch problems that mocks hide, like fee-on-transfer tokens.
Measure which lines and branches your tests reach with forge coverage or the solidity-coverage plugin. High coverage is necessary but not sufficient; it says nothing about missing checks.
Deployed contracts hold real money and cannot easily be patched, so security is part of design, not a final step. Combine known patterns, audited libraries, automated analysis, fuzzing and independent audits before launch.
Follow checks-effects-interactions, use pull over push payments, minimise privileged roles behind multisigs and timelocks, pin compiler versions and keep contracts small. Plan an incident response such as pausing.
Reentrancy, missing access control, oracle and price manipulation with flash loans, front-running, signature replay, unchecked external calls and unsafe delegatecall cause most losses.
Block values like block.timestamp or prevrandao can be predicted or influenced by block producers, so they are unsafe for lotteries. Use verifiable randomness such as Chainlink VRF or commit-reveal schemes.
Static analysers scan code for known bug patterns without running it; fuzzers throw random inputs at functions and check invariants that must always hold. Both find bugs humans miss and run well in CI.
Trail of Bits' static analyser for Solidity and Vyper. Run slither . in a project to get detector findings like reentrancy or uninitialised storage, plus printers that summarise inheritance and call graphs.
A property-based fuzzer from Trail of Bits. You write invariant functions in Solidity and Echidna searches for call sequences that break them.
Consensys Diligence offers a hosted fuzzing service that runs long fuzzing campaigns against your Foundry or Hardhat project in the cloud and reports property violations, an alternative to running fuzzers yourself.
The standard library of audited Solidity building blocks: token standards, Ownable and AccessControl, ReentrancyGuard, proxies and utilities. Inherit from it instead of rewriting security-critical code.
Contracts, deployment scripts and addresses belong in version control like any other code. Tagging the exact commit that was deployed and audited lets anyone verify what is running on-chain.
Distributed version control: commits, branches, merges and rebases. Learn to keep secrets such as private keys and RPC URLs out of history with .gitignore and environment files.
The main home of open-source blockchain projects: pull requests for review, Actions to run tests and Slither in CI, and security advisories for responsible disclosure.
An alternative hosting platform with built-in CI/CD and a self-hostable edition, chosen by teams that want everything on their own infrastructure.
Atlassian's Git hosting with Pipelines CI, used mostly by teams already on Jira and Confluence.
A decentralised application is a user interface plus contracts, with indexers, storage and wallets in between. Good dApps hide chain latency and failed transactions behind clear UI states while keeping users in control of their keys.
Typical layers: contracts on-chain, an indexer (The Graph or a custom one) for queries, decentralised storage for media, an RPC provider and a front end that signs through the user's wallet.
Beyond contract tests, run the front end against a local or forked chain, test wallet flows such as rejected signatures and wrong networks, and rehearse deployments on a testnet.
Deploy with scripted, repeatable steps (forge script or Hardhat Ignition), verify source on block explorers, record the addresses, and hand admin rights to a multisig rather than a developer key.
Immutable code makes fixes slow: plan upgrade or migration paths, monitor dependencies like oracles and bridges, and communicate changes to users who must often act themselves.
The domains where blockchains have found real traction. Studying existing protocols in each shows common contract patterns and the risks specific to that domain.
Lending, exchanges (AMMs), stablecoins and derivatives as composable contracts. Learn constant-product pricing, liquidation mechanics and how flash loans enable both arbitrage and attacks.
Organisations that hold a treasury and vote on proposals on-chain, often with token-weighted governance and timelocks. Low turnout and vote buying are their practical weak spots.
Unique tokens (ERC-721, ERC-1155) representing art, tickets, game items or memberships. The token points to metadata, so where that metadata lives decides how permanent the NFT really is.
Stablecoin transfers settle globally in minutes without banks; L2s and payment channels keep fees low enough for small amounts. Compliance and off-ramps are usually the hard parts.
Pooled cover against smart-contract hacks or real-world events, paid out by member vote or automatically from oracle data in parametric designs.
Off-chain code glues everything together: front ends, scripts, bots, indexers and back-end services. Most tooling and examples are in JavaScript or TypeScript, with Python and Go as solid alternatives.
The default for dApp front ends and most tooling. Use TypeScript, and remember token amounts need bigint because 18-decimal values overflow JavaScript numbers.
Popular for data analysis, bots and scripting through web3.py, and for testing with Ape or Brownie.
Geth and many infrastructure tools are written in Go; its ethclient package and abigen bindings suit indexers and high-performance back-end services.
Any web framework can host a dApp; what matters is good wallet-connection libraries and handling of pending, failed and confirmed transactions in the UI.
The most common choice for dApps, with the richest Web3 ecosystem: wagmi hooks for accounts and contract calls, plus ready-made wallet modals like RainbowKit.
A full framework with dependency injection and RxJS; less common in Web3, so you will mostly call ethers or viem directly from services.
A progressive framework with simple reactivity; Web3 libraries such as viem work fine with it, and community wrappers port wagmi-style composables.
Libraries that talk JSON-RPC to nodes: read state, encode calls from an ABI, estimate gas, sign and send transactions, and subscribe to events. Viem is a newer, type-safe alternative to the classic options.
A compact library with Providers for reading, Signers for writing and Contract objects built from an ABI. Version 6 uses native bigint instead of the old BigNumber.
The original Ethereum JavaScript library. ChainSafe sunset it in 2025, so use it to maintain old code and pick ethers or viem for new projects.
A hosted Web3 data API that returns balances, NFTs, token prices and transaction history across chains without running your own indexer.
Node software validates blocks and serves the JSON-RPC API your app uses. Since the Merge, an Ethereum node is an execution client paired with a consensus client, and client diversity protects the network from a single bug.
Go Ethereum, the most widely used execution client. Learn its sync modes, the JSON-RPC namespaces you expose, and never open the admin or personal APIs to the internet.
A Java execution client under the Linux Foundation (Hyperledger), used on mainnet and for permissioned enterprise networks with privacy and permissioning features.
A .NET execution client known for fast sync and a plugin system, and an important part of execution-client diversity.
Parity's Rust framework for building your own blockchain from modular pallets, now part of the Polkadot SDK. Used to build Polkadot parachains and standalone chains.
Running nodes yourself is costly, so most apps use hosted RPC endpoints. Use more than one provider for resilience, keep API keys out of public front ends where possible, and remember the provider sees your users' requests.
A popular hosted node provider with enhanced APIs for tokens and NFTs, webhooks and account-abstraction tooling, plus a free tier for development.
One of the oldest RPC providers, run by Consensys and the default behind MetaMask, covering Ethereum, major L2s and IPFS.
A multi-chain RPC provider with add-ons for streams, indexing and functions, supporting many non-EVM chains as well.
A decentralised RPC network where independent node runners serve requests and are paid in POKT, avoiding dependence on one company.
A single chain processes only so many transactions, so scaling moves work off-chain or splits data while keeping security anchored to layer 1. Each approach trades off data availability, trust and withdrawal time.
Two parties lock funds on-chain, exchange signed updates off-chain and settle only the final state. Bitcoin's Lightning Network is the best-known example; channels need both parties online and capital locked up.
Batches are posted to L1 and assumed valid; anyone can challenge a bad one with a fraud proof during a window of about a week, which is why native withdrawals are slow.
Each batch carries a validity proof (SNARK or STARK) that L1 verifies, so funds can be withdrawn as soon as the proof lands. Proving is computationally heavy and EVM equivalence is hard.
Like a ZK rollup but transaction data stays off-chain with a data-availability committee. Cheaper, but if the committee withholds data users may be unable to exit.
An early design of child chains that commit roots to L1 and rely on exit games when operators misbehave. Mass exits and data availability problems led most teams to rollups instead.
Independent chains with their own consensus, connected to L1 by a bridge. They are fast and cheap but do not inherit L1 security; if their validators collude, bridged funds are at risk.
The retired name for Ethereum's upgrade path: the Beacon Chain (2020) and the Merge to proof of stake (2022). It is now just called the consensus layer, followed by upgrades like withdrawals and blobs.
Making layer 1 itself carry more: bigger or faster blocks, sharding, and data blobs (EIP-4844) that give rollups cheap temporary data space. Pushing it too far raises node hardware costs and hurts decentralisation.