Chapter 15 of 22Part III: Cybersecurity and Privacy
The Invisible Journey of Money
Each project below is tailored to a specific algorithm and scientific question from Chapter 15, with concrete inputs, verifiable numerical outputs, boundary cases, and links to the related lab and pioneer.
Project 1 of 3 · v1-c15-p01Foundational · ~25 min
Miniature Issuing-Bank Authorization Engine
Lab activity: A. The miniature issuing bank · Related code: block-01.js, block-04.js · Pioneer: View profile
Real-World Problem: When you tap a card, the issuing bank must decide Approve or Decline in under a second.
Scientific Question: What exact checks occur during authorization before settlement ever moves money between banks?
Objective: Implement an integer-cent issuing bank checking account status, daily limit, available balance, and fictional EMV cryptogram.
Hypothesis to Test: Holding authorized funds as "pending" immediately prevents spending the same balance twice before settlement.
Step-by-Step Implementation
Store all balances and transaction amounts strictly as integer cents.
Verify card active flag, fictional one-time cryptogram, daily limit, and available >= amount.
Move approved amounts into pending holds (authorization) separate from settled balance.
Run a batch settlement step to finalize pending holds into posted ledger entries.
Test Cases: Valid $19.99 -> approved; $35.00 on $30.01 left -> declined; Frozen card -> declined.
Boundary Condition: Zero or negative purchase amounts must be rejected immediately.
Common Mistake to Avoid: Using JavaScript floating-point dollars (0.1 + 0.2 !== 0.3) instead of integer cents.
Interpreting Results: Separating authorization holds from clearing/settlement explains why card statements show "Pending" charges.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 15 before testing the boundary case: Zero or negative purchase amounts must be rejected immediately.
Extension Challenge: Add a partial refund workflow that credits back 500 cents while preserving double-entry balance.
Reflection Question: How did Roland Moreno and Helmut Gröttrup's smart-card chip designs make dynamic payment cryptograms possible?
Test Cases: 3 identical keys -> 1 ledger entry; Same key with different amount -> rejected as conflict.
Boundary Condition: Reusing an old idempotency key with a different dollar amount must raise a 409-style conflict error.
Common Mistake to Avoid: Checking idempotency only in the browser UI instead of on the ledger processor.
Interpreting Results: Idempotency makes unreliable networks safe for financial transactions.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 15 before testing the boundary case: Reusing an old idempotency key with a different dollar amount must raise a 409-style conflict error.
Extension Challenge: Add a ledger audit function that detects any unbalanced single-sided tampering.
Reflection Question: Why did John Shepherd-Barron's ATM and modern digital banking rely on strict transaction atomicity?
Lab activity: C. The review desk · Related code: block-03.js, block-04.js, block-05.js · Pioneer: View profile
Real-World Problem: Banks flag unusual spending patterns while trying not to block legitimate travelers.
Scientific Question: How do transparent risk-scoring rules balance catching fictional fraud against annoying false declines?
Objective: Score fictional transactions using velocity, impossible-travel, and amount-anomaly rules and inspect false-positive rates.
Hypothesis to Test: Combining multiple weak signals (new country + high velocity + unusual hour) lowers false positives compared to a single rigid rule.
Score every transaction in the fictional review queue and log which rules fired.
Adjust the review threshold and count false declines vs. missed anomalies.
Explain why every declined customer needs a clear human-readable reason.
Concrete Input: 10 fictional transactions including 1 impossible-travel pair (City A and City B 3,000 km apart in 5 minutes).
Expected Output: Impossible-travel pair scored 95/100 (HOLD FOR REVIEW); normal bookstore purchase scored 10/100 (APPROVE).
Test Cases: 3,000 km in 5 min -> flagged; Normal $12 purchase -> approved.
Boundary Condition: Card-not-present online purchases can legitimately originate from another city (e.g., ordering a gift).
Common Mistake to Avoid: Hard-blocking transactions without giving users a verification path.
Interpreting Results: Risk scoring is a statistical threshold problem closely related to Chapter 19's FAR/FRR trade-off.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 15 before testing the boundary case: Card-not-present online purchases can legitimately originate from another city (e.g., ordering a gift).
Extension Challenge: Add a "travel notice" flag that suppresses the foreign-location penalty for verified trips.
Reflection Question: How did David Chaum's blind-signature research raise important questions about privacy in digital payments?