
Bitcoin acts as a big public ledger, a decentralized, open-source protocol that lets you own and move a digital asset securely across the globe without permission.
Examine how digital money enables double spending and how a centralized ledger prevents it, while considering central banks' costs and Bitcoin as a potential solution.
Explore how Satoshi Nakamoto introduced Bitcoin in 2008 through a white paper as a peer-to-peer electronic cash system, solving double spending and enabling anonymity, with blockchain as the public ledger.
Explore public key cryptography, the foundation of Bitcoin security, using public and private keys to enable authentication and message privacy through encryption and digital signatures.
Explore hashing in public key cryptography with sha-256, producing a 32-byte, one-way hash. See how small input changes drastically alter outputs in Bitcoin transactions, which cannot be reversed.
Explore how blocks form a blockchain, linking via hashes from the genesis block onward, and how hashes, previous-block hashes, and proof-of-work by miners prevent tampering.
Learn how Bitcoin's proof of work secures the blockchain by having miners mine computational puzzles, making tampering require recalculating hashes across blocks.
Centralized systems use a client-server model where a central server answers client requests, while Bitcoin relies on a decentralized network that uses a consensus mechanism to validate transactions.
Miners broadcast transactions across the network, assemble them into a block, and compute a hash with a hashing function; timestamped messages and hash integrity secure Bitcoin transactions from tampering.
Understand how bitcoin operates as a decentralised network of nodes and miners that validate transactions and link blocks via hashes to form a distributed public ledger.
Explore how proof of work uses a nonce value to regulate block creation. Miners race to compute hashes, seeking a hash with leading zeros to meet a ten-minute target.
Miners may produce competing blocks, but Bitcoin resolves conflicts with the longest chain rule, purging shorter branches and returning their transactions to the pool.
Learn how bitcoin nodes maintain a memory pool, or mempool, a per-node store of unconfirmed transactions, serving as a waiting room before miners add blocks.
Explain how a bitcoin miner operates by building a candidate block from the memory pool, prioritizing high-fee transactions, and broadcasting blocks to the blockchain.
Explore how bitcoin mining builds a candidate block with header and body, links to the previous block hash, uses nonce and hashes to meet a zeros-difficulty target, and secures blockchain.
Miners earn rewards for validating transactions and blocks, funded by block rewards and transaction fees as Bitcoin supply nears 21 million by 2140.
Understand how blockchain stores blocks across full nodes, light nodes, and miners, and why running a full node ensures decentralization, honesty, and independence in the Bitcoin network.
A cryptocurrency wallet stores your public and private keys and interfaces with blockchains to monitor balance and sign transactions, while coins themselves remain on the blockchain.
Compare hot and cold wallets to balance convenience and security for crypto storage. Hot wallets stay online, while cold wallets keep private keys offline on hardware devices.
Put your learning into practice by building a basic blockchain with JavaScript, named Satoshi Coin, to understand how a blockchain works.
Create a block class in Node.js with timestamp, data, previous hash, and nonce; compute a SHA-256 hash and mine by iterating nonce until the hash meets the difficulty.
Create and inspect a blockchain block with a transaction, then mine it by incrementing the nonce until the hash starts with the required zeros, illustrating mining and difficulty.
Develop a blockchain class with a genesis block, manage a chain array, and implement mining, difficulty adjustment, and validation to guard against tampering.
Debug a blockchain by building Satoshi coin, adding blocks, and validating the chain as mining difficulty increases. See how tampering breaks validity and what comes next with wallets and transactions.
Create a transaction class with sender, receiver, and amount; manage a pending transaction pool, mine transactions into blocks, and issue miner rewards via a minting address.
Create a mint wallet with the elliptic library to generate a secp256k1 key pair, derive the mint public address, and sign transactions by hashing from, to, and amount with sha256.
Debug the transaction flow by creating wallets, sending 100 satoshis, signing the transaction, and mining the block in the Satoshi coin blockchain.
Implement a get balance method in the blockchain class that takes a public address and computes its balance by traversing blocks and transactions, subtracting sender amounts and adding receivers.
Learn how blockchain validity depends on valid transactions, including balance checks, signature verification with elliptic curves, and hash-based integrity, plus validating blocks and guarding the transaction pool.
Follow a debugging session where wallets sign a transfer and the miner mines a block. The genesis block credits John 1000 satoshis, enabling the 100-satoshi transfer to Jennifer.
Explore how gas fees sustain blockchain operation after cap, rewarding miners and funding energy costs, and implement gas as a transaction property with updated balance checks and rewards.
Debug a blockchain app by creating wallets, simulating signed transactions, applying gas fees, and tracking genesis and block rewards to explain miner balances.
Build a basic client-server setup using WebSockets to illustrate how two machines communicate. Then adapt the code toward a true peer-to-peer architecture for a cryptocurrency network.
Build a websocket-based client-server setup on port 8081 that sends a 'Hello, world' message every second and logs connections and incoming messages between server and client.
Run a server and a client in two terminals, watch client connected and client disconnected messages, and contrast client-server architecture with bitcoin's peer-to-peer network using the VSE module.
Build a peer-to-peer network where every node acts as both client and server, connect John’s and Jennifer’s machines over a local area network, exchange messages, and prepare blockchain integration.
Create the first node by setting up a websocket server on port 3000, exchanging peer addresses with a handshake, and connecting to peers to form a local peer-to-peer network.
Create two new nodes by duplicating the miner node, assign ports 3001 and 3002 for John and Jennifer, and schedule messages after three and ten seconds.
Debug a three-node blockchain network by wiring miners and peers, establishing connections between John and Jennifer, and ensuring message propagation with basic error handling to keep terminals open.
Build a bitcoin-like blockchain network with miner, full, and light nodes; validate transactions, mine blocks, and synchronize ledgers across John, Jennifer, and Bob.
Modify the blockchain by using static mint and John keys, making is valid static, and ensure a consistent genesis block timestamp across nodes for reliable wallet and transaction validation.
Learn how to build a miner node that mines transactions, validates blocks, and broadcasts new blocks using a websocket network, with terminal commands for mining, balance, and blockchain display.
Create John and Jennifer as full nodes to store the complete blockchain, validate and broadcast transactions from their mempools, and implement duplicate checks as miners confirm blocks.
Install dependencies and run multiple nodes to broadcast and validate transactions, mine blocks, and synchronize chains, illustrating mempool handling, transaction validation, fees, and miner rewards.
Learn how to create a light node that relies on full nodes for state and balance checks, handle balance and verify messages, and fix get hash with a static method.
Debug a small blockchain network by cleaning a light Bob node, validating balances, broadcasting transactions, and mining across John, Jennifer, Minor, and Bob, with verification and gas fee.
Rebuild the block structure to match the Bitcoin protocol: block size, a header with version, previous hash, merkle root, timestamp, difficulty target, nonce, plus a transaction counter and transactions.
Explore merkle trees and hash trees introduced by Ralph Merkle as the backbone of blockchain data verification. Understand how the merkle root in headers enables light-node verification.
Explore the merkle tree as a data structure that summarizes block transactions with the merkle root, built from leaf hashes of transactions using SHA-256.
Learn how merkle trees compress Bitcoin block transactions into a merkle root, so light nodes can verify a transaction with a few hashes and detect tampering through root changes.
Refactor the blockchain by extracting duplicated node functions into shared utils, introduce blockchain utils for transaction checks, and update function imports across all four nodes.
Implement a bitcoin-like block header with nonce, previous hash, merkle root, timestamp, and difficulty. Estimate block size and compute the block hash from the header using SHA-256 and merkle trees.
Debug a multi-node blockchain by executing transactions, mining blocks, and validating balances, while noting block properties and merkle roots; address merkle root duplication by adding a timestamp to transactions.
Record each transaction with a current timestamp, set the gas fee to zero where needed, and validate the blockchain by testing nodes, ensuring unique timestamps produce distinct sha-256 merkle roots.
The light node stores only block headers to reduce storage and network data, and verifies blocks using header fields (nonce, previous hash, merkle root, timestamp, difficulty) from genesis header.
Debug a four-terminal blockchain setup, mine blocks, and confirm a light node stores block headers while exploring genesis block details; next course covers Bob Node’s transaction verification.
Learn how light nodes use simplified payment verification to confirm transactions by constructing the merkle path and verifying the merkle root against block headers, avoiding full blockchain storage.
SPV implementation shows a light node maintaining a transaction history, broadcasting transactions, and verifying inclusion in a block using merkle proofs and sha-256 leaves.
Verify a Merkle root against block headers in the chain array. Confirm a transaction's inclusion with a Merkle proof by reconstructing the Merkle tree using SHA-256.
Debug and refine a blockchain transaction workflow across nodes, resolve a proof object mismatch, reconstruct valid proofs, and implement Merkle tree techniques to empower light nodes.
Extend your blockchain to support smart contracts like Ethereum, turning it into a platform for decentralized applications. Learn about Solidity, Ether, and how to deploy smart contracts on a blockchain.
Explore how smart contracts on the Ethereum blockchain automate agreements with ether, enabling self-executing property transfers, bets, and rentals without intermediaries, and learn about deploying a custom contract language.
Explore deploying a smart contract on Ethereum by creating a deployment transaction with contract code in the data field, paying gas, and sending to a deployment address.
Explore how to execute smart contracts on a blockchain by sending transactions to a deployed contract address, and understand the role of the Ethereum Virtual Machine.
Explore how a runtime engine stores smart contract results in a global state using LevelDB or the Ethereum state database, and practice put, get, and iterator.
Welcome to our course on building a peer-to-peer network based on blockchain technology!
Do you have an interest in understanding the mechanics behind Bitcoin or Ethereum?
In this course, we will start by exploring the theory behind how blockchain works. You will learn about the key principles that underlie this innovative technology, including decentralization, consensus, and security. We will also delve into the technical details of how blocks are created and added to a blockchain, and how transactions are validated and processed.
Next, you will have the opportunity to put your knowledge into practice by building a blockchain from scratch in Javascript. This hands-on activity will give you a deep understanding of how a blockchain functions at a technical level.
Following this, you will learn about peer-to-peer networks and how they are used to facilitate communication and data transfer in decentralized systems. You will also have the chance to build a simple peer-to-peer network as a way of reinforcing your understanding of this important concept.
Then, you will learn how to implement a blockchain application on a peer-to-peer network, where multiple nodes are connected and can perform transactions with one another. This will give you the opportunity to apply your knowledge of blockchain technology and peer-to-peer networks to a real-world scenario.
Our ultimate goal is to make our blockchain support smart contracts. This means that nodes in the network will be able to deploy and execute smart contracts. These contracts will be written in a unique programming language, similar to how Ethereum uses Solidity, and we will have a customized runtime engine for executing these contracts, akin to Ethereum's Ethereum Virtual Machine (EVM).
Outline of the course content:
Introduction to blockchain theory, covering decentralization, consensus, and security.
Technical details on how blocks are created and added to a blockchain, and how transactions are validated and processed.
Hands-on activity building a blockchain from scratch in JavaScript.
Understanding of peer-to-peer networks and how they are used to facilitate communication and data transfer in decentralized systems.
Building a simple peer-to-peer network.
Implementing a blockchain application on a peer-to-peer network, with multiple nodes connected and able to perform transactions with one another.
Introduction to smart contracts, with the goal of making our blockchain support them.
Developing smart contracts using a unique programming language.
Customized runtime engine for executing smart contracts, similar to Ethereum's Ethereum Virtual Machine (EVM).
Overall, this course will provide you with a solid foundation in blockchain technology and give you the skills and knowledge you need to build and implement your own blockchain applications.