

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


AP PLIED COMPUTING • CH AP T ER 18
Cryptographic Hashing, Merkle Trees, Consensus Mechanisms & Smart Contracts
A blockchain is an append-only, distributed ledger where batches of transactions are linked together using cryptographic hash functions (such as SHA-256).
Figure 18.1 — Tamper-Evident Hash Linking Across Sequential Ledger Blocks
Immutability: Altering a single transaction in Block #101 changes its hash, breaking the Prev Hash pointer in Block #102 and every subsequent block. Merkle Tree: Pairs of transaction hashes are repeatedly hashed together into a single root hash, allowing lightweight nodes to verify inclusion in O(log n) steps.
Mechanism How Validators Are Chosen Trade-Offs Proof of Work (PoW)
Miners compete to find a nonce producing a target hash High security, but high electricity use & slower throughput Proof of Stake (PoS)
Validators lock native tokens as collateral; malicious acts get slashed
99%+ lower energy use & faster block finality
PBFT / Raft Known permissioned nodes vote in rounds Sub-second finality, suited for private enterprise consortia
Smart Contracts: Deterministic programs stored on-chain that automatically execute agreements (e.g., escrow release) when predefined conditions are met.
Block # Prev Hash: 000a8f... Merkle Root + Nonce
Block # Prev Hash: 0004c1... Merkle Root + Nonce
Block # Prev Hash: 0009e2... Merkle Root + Nonce
Best-Fit Applications: Cross-border settlement, tamper-proof supply chain provenance, and verifiable digital credentials— not high-frequency private databases where a central authority is already trusted.