Skip to content
KALANBLON
Advanced1 h 45Free

Advanced blockchain: consensus and smart contracts

How do thousands of nodes that receive blocks out of order end up agreeing on a single history? You simulate forks and reorganisations, compute the probability that a double spend succeeds, then move to proof of stake: validator selection, votes, the two-thirds quorum, finality and penalties. In the second part, you run smart contracts in a small Python virtual machine, with gas and transactions that revert on error, you replay the reentrancy attack that drained The DAO, and you write a robust solidarity crowdfunding contract.

Start the course

0 / 6 chapters completed

What you'll be able to do

  • Explain forks, the most-work chain rule and reorganisations
  • Compute the probability of a successful double spend by number of confirmations
  • Simulate proof-of-stake consensus with a two-thirds quorum and penalties for conflicting votes
  • Run a smart contract with gas and atomic transactions
  • Recognise and fix a reentrancy flaw with the checks-effects-interactions pattern
  • Write a crowdfunding contract without unbounded loops

Course outline