3.73. CS3E1 Blockchain and Decentralized Systems (Elective)

3.73. CS3E1 Blockchain and Decentralized Systems (Elective)

Figure 3.72: Connection Map. CS3E1 Blockchain and Decentralized Systems

3.73.1. Justification Back to top

Blockchain and decentralized systems have moved from a niche cryptocurrency topic to a general-purpose computing paradigm used in finance, supply chains, digital identity, and public infrastructure. This elective gives students a rigorous, systems-level understanding of how a blockchain actually works: the data structures and cryptographic primitives (hashing, digital signatures, Merkle trees) that make a distributed ledger tamper-evident, the peer-to-peer networking and consensus protocols (PoW, PoS, BFT-family) that let mutually distrusting nodes agree on a single history without a central authority, and the execution environment (the EVM) that turns a blockchain into a general-purpose computing platform for smart contracts.

Building on these foundations, students develop, test, and audit smart contracts using Solidity and industry-standard tooling, and architect decentralized applications that combine an on-chain backend with a Web3 frontend and wallet-based identity. Because smart contracts manage real economic value and cannot be easily patched after deployment, the course places particular emphasis on the vulnerability classes unique to this domain – reentrancy, integer overflow, access-control flaws, and oracle manipulation – and on the auditing discipline needed to catch them before deployment.

The course closes by situating these technical skills in their broader context: the scalability and interoperability techniques (Layer-2, bridges) and economic primitives (tokens, automated market makers, lending protocols) that underpin decentralized finance, and the governance, regulatory, and ethical questions – on-chain voting, DAO governance failures, and the evolving legal treatment of cryptoassets – that any engineer working in this space must be prepared to reason about.

3.73.2. Generales Goals Back to top

  1. Explain the data-structure, cryptographic, and peer-to-peer networking foundations that make a blockchain a tamper-evident, decentralized ledger.
  2. Analyze and compare consensus mechanisms, including Proof-of-Work, Proof-of-Stake, and BFT-family protocols, in terms of security, performance, and trust assumptions.
  3. Design, program, and test smart contracts on an EVM-compatible platform using Solidity and modern development and testing tooling.
  4. Architect decentralized applications that integrate a Web3 frontend, a wallet, and an on-chain smart-contract backend.
  5. Identify common smart-contract security vulnerabilities and apply auditing techniques and tools to mitigate them.
  6. Evaluate blockchain scalability and interoperability approaches, the economic primitives behind decentralized finance (DeFi), and the governance and regulatory implications of decentralized systems.

3.73.3. Contribution to Outcomes Back to top

AG-C09) Design and Development of Solutions: Designs, implements, and evaluates solutions for complex computing problems. (Assessment)
AG-C11) Use of Tools: Applies modern computing tools in problem solving. (Usage)
AG-C12) Applies computer science theory and software development fundamentals to produce computer-based solutions. (Assessment)

3.73.4. Content Back to top

3.73.4.1. Distributed Ledgers and Peer-to-Peer Architectures (8 hours) [Skills AG-C09,AG-C12] Back to top

Bibliography: (Narayanan et al., 2016; Antonopoulos, 2023)

Topics

  1. Distributed ledger structure: a chain of blocks linked by cryptographic hashes, providing append-only, tamper-evident storage of ordered transactions Cryptographic Algorithms .
  2. Peer-to-peer network topology and gossip/broadcast protocols for propagating blocks and transactions without a central server Networked Applications .
  3. Node roles: full nodes, light nodes, and miners/validators, and the responsibilities each assumes in maintaining the ledger.
  4. Decentralization versus centralization trade-offs: trust assumptions, single points of failure, censorship resistance, and performance costs Evaluation .

Learning Outcomes

  1. Explain how a distributed ledger's block structure and hash linkage provide tamper-evidence [Explain]
  2. Compare peer-to-peer and client-server architectures in terms of fault tolerance, scalability, and trust [Compare]
  3. Analyze the decentralization trade-offs of a given blockchain design against a centralized alternative [Analyze]
3.73.4.2. Cryptographic Foundations for Blockchain (8 hours) [Skills AG-C09,AG-C12] Back to top

Bibliography: (Narayanan et al., 2016; Antonopoulos, 2023)

Topics

  1. Cryptographic hash functions: properties (preimage resistance, collision resistance, avalanche effect) and their use in chaining blocks Cryptographic Algorithms .
  2. Digital signatures for transaction authentication: key pairs, signing and verification, and non-repudiation Cryptographic Algorithms .
  3. Merkle trees: construction, Merkle roots, and Merkle proofs for efficient verification of transaction inclusion in a block.
  4. Public-key-derived addresses and key management considerations Cryptography Fundamentals .

Learning Outcomes

  1. Explain which cryptographic hash-function properties make a blockchain's chain of blocks tamper-evident [Explain]
  2. Implement a Merkle tree and verify an inclusion proof for a given transaction [Implement]
  3. Apply digital signatures to authenticate and verify a blockchain transaction [Apply]
3.73.4.3. Memory and Consistency (8 hours) [Skills AG-C09,AG-C12] Back to top

Bibliography: (Narayanan et al., 2016; Bashir, 2023)

Topics

  1. Memory models, data consistency, and fault tolerance
    1. Memory models: sequential and release/acquire consistency
    2. Memory management; including reclamation of shared data; reference counts and alternatives
    3. Bulk data placement and transfer; reducing message traffic and improving locality; overlapping data transfer and computation; impact of data layout such as array-of-structs vs struct-of-arrays
    4. Emulating shared memory: distributed shared memory, Remote Direct Memory Access (RDMA)
    5. Data store consistency: Atomicity, linearizability, transactionality, coherence, causal ordering, conflict resolution, eventual consistency, blockchains
    6. Faults, partitioning, and partial failures; voting; protocols such as Paxos and Raft.
    7. Design tradeoffs among consistency, availability, partition (fault) tolerance; impossibility of meeting all at once
    8. Security and trust: Byzantine failures, proof of work and alternatives

Learning Outcomes

  1. Give an example of an ordering of accesses among concurrent activities (e.g., program with a data race) that is not sequentially consistent [Create]
  2. Write a program that illustrates memory-access or message reordering [Write]
  3. Describe the relative merits of optimistic versus conservative concurrency control under different rates of contention among updates [Describe]
  4. Give an example of a scenario in which an attempted optimistic update may never complete [Create]
  5. Modify a concurrent system to use a more scalable, reliable, or available data store [Create]
  6. Using an existing platform supporting replicated data stores, write a program that maintains a key-value mapping even when one or more hosts fail [Write]
3.73.4.4. Blockchain Execution Platforms: The EVM Model (8 hours) [Skills AG-C09,AG-C12] Back to top

Bibliography: (Antonopoulos and Wood, 2018)

Topics

  1. EVM architecture: stack-based virtual machine, opcodes, and the bytecode execution model Common Aspects: Platforms, APIs and Constraints .
  2. Gas model: execution cost accounting, gas limits, and its role in bounding computation and preventing denial-of-service.
  3. Account and state model: externally-owned accounts versus contract accounts, and persistent contract storage.
  4. Smart contract lifecycle: compilation to bytecode, deployment, invocation, and transaction receipts.

Learning Outcomes

  1. Explain how the gas model bounds smart contract execution and mitigates denial-of-service risk [Explain]
  2. Describe how EVM bytecode is executed against the stack and persistent contract storage [Describe]
  3. Compare externally-owned accounts and contract accounts in terms of capabilities and state [Compare]
3.73.4.5. Smart Contract Development and Testing (8 hours) [Skills AG-C09,AG-C11] Back to top

Bibliography: (Antonopoulos and Wood, 2018; Solorio et al., 2019)

Topics

  1. The Solidity programming language: contract structure, state variables, functions, modifiers, and events Common Aspects: Platform Languages and Web Programming Patterns .
  2. Smart contract development frameworks and tooling (e.g., Hardhat, Foundry, Truffle) for compiling, deploying, and scripting contracts Development Environment and IDE .
  3. Local and public test networks for simulating contract execution prior to mainnet deployment.
  4. Unit and integration testing of smart contracts, including test coverage and mocking of external dependencies Advanced Testing Practices .

Learning Outcomes

  1. Program a smart contract in Solidity that implements a specified business rule [Program]
  2. Write unit and integration tests for a smart contract using a development framework [Write]
  3. Determine whether a smart contract's test suite provides adequate coverage of its state transitions [Determine]
3.73.4.6. Decentralized Application (DApp) Architecture and Web3 Integration (6 hours) [Skills AG-C09,AG-C11] Back to top

Bibliography: (Antonopoulos and Wood, 2018; Solorio et al., 2019)

Topics

  1. DApp architecture: on-chain smart-contract backend versus off-chain frontend and storage Frontend, Frameworks and Web Standards .
  2. Wallets as identity and signing agents: key custody, transaction signing, and connection protocols.
  3. Web3 client libraries (e.g., ethers.js, web3.js) for reading blockchain state and submitting signed transactions Frontend, Frameworks and Web Standards .
  4. Oracles and off-chain data feeds for supplying external data to on-chain contracts.

Learning Outcomes

  1. Design the on-chain/off-chain architecture of a decentralized application for a given use case [Design]
  2. Integrate a web frontend with a user's wallet using a Web3 client library to sign and submit transactions [Integrate]
  3. Explain the role of oracles in supplying trustworthy off-chain data to smart contracts [Explain]
3.73.4.7. Smart Contract Security and Auditing (8 hours) [Skills AG-C11,AG-C12] Back to top

Bibliography: (Atzei et al., 2017; Antonopoulos and Wood, 2018)

Topics

  1. Reentrancy attacks and checks-effects-interactions mitigation patterns Memory Safety and Types .
  2. Integer overflow and underflow in contract arithmetic, and safe-math mitigations Memory Safety and Types .
  3. Access-control flaws in contract functions, such as missing modifiers or unprotected initialization Access Control and Applications .
  4. Oracle and price-manipulation attacks, and front-running/transaction-ordering risks.
  5. Auditing methodology: manual code review, static analysis, and formal verification tools Threat Analysis and Security Engineering .

Learning Outcomes

  1. Analyze a smart contract for reentrancy and integer-overflow vulnerabilities [Analyze]
  2. Apply checks-effects-interactions and safe-math patterns to remediate an identified vulnerability [Apply]
  3. Evaluate the findings of a static-analysis tool run against a smart contract and prioritize remediation [Evaluate]
3.73.4.8. Blockchain Scalability, Interoperability, and DeFi Primitives (6 hours) [Skills AG-C09,AG-C12] Back to top

Bibliography: (Bashir, 2023; Werner et al., 2022)

Topics

  1. Layer-2 scaling techniques: rollups, state channels, and sidechains Evaluation .
  2. Cross-chain interoperability: bridges and their trust assumptions.
  3. Tokenomics and decentralized finance (DeFi) primitives: fungible/non-fungible tokens, automated market makers, and lending protocols Economic Models and Strategies .

Learning Outcomes

  1. Compare Layer-2 scaling approaches in terms of throughput, security, and trust assumptions [Compare]
  2. Analyze the trust assumptions and failure modes of a given cross-chain bridge design [Analyze]
  3. Describe how a given DeFi primitive, such as an automated market maker, uses token incentives to provide a decentralized financial service [Describe]
3.73.4.9. Blockchain Governance, Regulation, and Ethical Case Studies (4 hours) [Skills ] Back to top

Bibliography: (Filippi and Wright, 2018; Bashir, 2023)

Topics

  1. On-chain governance and decentralized autonomous organizations (DAOs): voting mechanisms and protocol upgrade processes.
  2. Regulatory treatment of cryptoassets across jurisdictions and its implications for compliance Security Laws, Policies and Responsibility .
  3. Ethical case studies: notable governance failures and contested community interventions Ethical Foundations and Frameworks .

Learning Outcomes

  1. Explain how a DAO's on-chain voting mechanism governs protocol upgrades [Explain]
  2. Debate the trade-offs between permissionless innovation and regulatory compliance in a given cryptoasset case [Debate]
  3. Evaluate the ethical and governance implications of a historical blockchain governance failure [Evaluate]

3.73.5. Bibliography Back to top

Narayanan, A., Bonneau, J., Felten, E., Miller, A., and Goldfeder, S. (2016). Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduction. Princeton University Press, 1st edition.

Antonopoulos, A. M. (2023). Mastering Bitcoin: Programming the Open Blockchain. O'Reilly Media, 3rd edition.

Bashir, I. (2023). Mastering Blockchain: A Deep Dive into Distributed Ledgers, Consensus Protocols, Smart Contracts, DeFi, and More. Packt Publishing, 4th edition.

Antonopoulos, A. M. and Wood, G. (2018). Mastering Ethereum: Building Smart Contracts and DApps. O'Reilly Media, 1st edition.

Solorio, K., Kanna, R., and Hoover, D. H. (2019). Hands-On Smart Contract Development with Solidity and Ethereum. O'Reilly Media, 1st edition.

Atzei, N., Bartoletti, M., and Cimoli, T. (2017). A survey of attacks on ethereum smart contracts (sok). In Principles of Security and Trust (POST). Springer.

Werner, S. M., Perez, D., Gudgeon, L., Klages-Mundt, A., Harz, D., and Knottenbelt, W. J. (2022). Sok: Decentralized finance (defi). In Proceedings of the 4th ACM Conference on Advances in Financial Technologies (AFT). ACM.

Filippi, P. D. and Wright, A. (2018). Blockchain and the Law: The Rule of Code. Harvard University Press, 1st edition.

Spotted a typo, an outdated course, a broken link, or have a suggestion? Let us know.

Scan to open on your phone