Crypto OS
Non-Technical Crypto OSStage 4 · Tokens, Markets, and Research

Chapter 24 · Why Crypto Keeps Facing Attacks and Total Losses

How exactly does money disappear?

Capabilities practiced
System ThinkingResearchOnchain Literacy
Hands on
Pick a real incident, check it against ten types of risk, and reconstruct how funds left step by step.
AI Lab
Have AI reconstruct an exploit. Compare it with the official postmortem and mark anything fabricated or vague.

A Real-World Problem

Three people lose their money in the same year.

The first deposits stablecoins into lending. Price manipulation creates bad debt and deposits are reduced proportionally, despite correct user behavior.

The second earns fixed returns on a platform. Withdrawals stop; bankruptcy follows three months later. The coins become a claim in a creditor queue.

The third finds a wallet emptied without losing keys, revealing a recovery phrase, or visiting a fake site. An old approval pointed to a contract later replaced by the site.

All say Crypto is unsafe.

True but unhelpful: defenses against one do not prevent the others. The first needs oracle analysis, the second custody-versus-credit understanding, and the third approval review.

This chapter provides a classification system. Named risks with questions and checks turn vague insecurity into action.

It consolidates risk lessons from Part A's first four stages.

Thought Experiment

You become a warehouse security chief.

Before patrolling, list every route through which goods enter or leave.

You find:

  • Front door, governed by posted rules.
  • Valuation scale, determining collateral and release decisions.
  • Rear transport route, linking claims to goods held elsewhere.
  • Administrator keys, bypassing normal rules.
  • Owner meetings, able to rewrite rules.
  • Floor capacity, affected by borrowed inventory and leverage.
  • Exit width, limiting simultaneous withdrawals.
  • External key custodian, whose reliability matters.
  • Your own counting, requiring operational care.

Nine possible loss routes already improve on a vague safety question.

Next connect routes and ask whether one failure triggers another.

A manipulated scale undervalues goods; rules permit cheap removal; sales clog exits; normal users cannot withdraw; a deficit remains; emergency owners change rules; meeting eligibility becomes another risk.

One chain, five routes, one incident.

Real incidents usually propagate from one failed door into others.

Your Decision

How do you write a project's risk section?

What Happens

The course's shared Unified Risk Model continues into capstones:

Smart Contract RiskHas the code been audited? Who controls upgrades?
Liquidity RiskWhen you want to exit, will there still be money in the pool?
Oracle RiskWhere does the price come from? Can it be manipulated?
Bridge RiskWhat actually backs the asset that crossed over?
Custody RiskWho holds the assets? Who holds the private keys?
Counterparty RiskIf your counterparty disappears, what do you still have?
Governance RiskCan a single vote move the money away?
Leverage RiskIf prices fall 30%, how many cascading liquidations follow?
Token RiskWho gets diluted by unlocks and new issuance?
Operational RiskHow likely are errors in multisig, key management, and operations?

Three points.

First, classification rather than exhaustive prediction. Categories aim to be distinct and cover most incidents. A risk outside them is worth recording.

Second, inspection questions do the work. Each should produce a verifiable answer about audits, authority, or prices. Risk management becomes investigation rather than intuition.

Third, categories often occur together.

A recurring chain:

  1. A thin pool price is manipulated
  2. Collateral receives an incorrect valuation
  3. Positions are wrongly liquidated
  4. Forced sales drain liquidity
  5. Unsellable collateral leaves bad debt
  6. Emergency governance changes parameters
Six steps cross Oracle, Leverage, Liquidity, Smart Contract, and Governance risks. Each can appear manageable alone.

Classify each step:

StepCategoryReassurance in isolation
Manipulated priceOracle RiskConcentrated sources, but a seemingly large pool
Wrong valuationSmart Contract RiskCode follows design
LiquidationLeverage RiskThe mechanism works
Drained depthLiquidity RiskNormal depth is sufficient
Bad debtCounterparty RiskA reserve exists
Emergency changesGovernance RiskAn emergency mechanism exists

Individually manageable can become collectively catastrophic.

Compare a single failure with a compound incident:

Single failureCompound incident
TriggerOne componentFailure propagates
LossRoughly component exposureCan exceed any one exposure
Audit detectionOften possibleRarely, beyond protocol boundaries
PostmortemModule bugSeveral unlikely events together
PreventionIndividual checksChecks plus transmission diagrams

A checklist is step one; connecting its categories is step two.

Build a Model

Code, economics, and people

Group the ten categories by the layer in which they arise:

LayerCategoriesAudit visibilityTypical loss
CodeSmart Contract, bridge verificationOftenDrained within a transaction
EconomicsOracle, Liquidity, Leverage, TokenLimitedRules exploited as designed
PeopleCustody, Counterparty, Governance, OperationalOutside code auditsAuthorized transfers

The easiest layer to inspect is not necessarily where losses concentrate. Shallow oracle sources may be valid code but poor economic design. Perfect execution can drain a protocol.

Chapter 16's warning follows because code is only one layer.

Five routes for money to leave

Remember routes rather than dozens of incident names:

RouteAppearanceCategoryUser-side action
Logic exploitedUnexpected operation combinationSmart ContractAudit scope, fixes, operating history
Price manipulatedFalse valuation inputOracleSources, depth, delays, medians
Keys compromisedDirect authority stolenCustody, OperationalMultisigs, timelocks, single-owner powers
Rules changedVote or upgrade redirects fundsGovernanceVoting distribution and execution delay
Your approvalAuthorized contract acts differently laterUser-sideRevoke unused approvals; separate large holdings

The fifth is entirely on your side. No protocol breach is required: an old unlimited, persistent allowance can target an upgradeable contract. This route may account for enormous personal losses and is one you can close yourself.

Risk is not additive

Chapter 17 said returns add and risks multiply. More precisely, risks are also correlated.

Three protocols each have a hypothetical 97% annual incident-free probability:

If independent: 0.97 × 0.97 × 0.97 = 91.3%

Shared oracles, collateral, or bridges mean one incident can affect all layers, invalidating independence.

List dependencies and find overlaps:

Shared dependencyConsequence
Oracle or price sourceCommon manipulation
CollateralCommon depeg or deficit
BridgeUnbacked claims throughout
Multisig or ownersShared key compromise
Chain sequencerSimultaneous inability to liquidate or exit

Overlap undermines apparent diversification, generalizing Chapter 18.

Turn categories into records

Each category gets a concrete answer:

Category: Oracle Risk
Question: Where does price come from, and can it be manipulated?
Finding: Sources A and B, median and 30-minute time weighting
Source: Official section X and contract 0x… verified in an explorer
Conclusion: Single-pool manipulation is harder; both sources can fail under stress
Uncertainty: Stale-feed fallback not found → unassessed

Six lines each, ten records. The final line is essential:

Quality depends on honest unassessed items, not checklist length.

All-green reports often mean inadequate investigation. The Analysis Toolkit combines this with the eighteen questions and Project Canvas.

What It Is Called

Smart Contract RiskSmart Contract Risk

Code defects or changes through upgrades.

Bugs include logic, state ordering, and external calls. Authority includes upgrade owners, delays, and timelocks.

An upgradeable contract without a timelock puts funds under the upgrade key's control. T28 and T29 expand the attack surface.

Oracle RiskOracle Risk

Protocol input prices differ from market reality.

Check source count, time weighting or medians, and stale-feed behavior, often omitted.

A shallow valuation source effectively quotes an attack price, determined by its depth. See T21.

Bridge RiskBridge Risk

What backs an asset brought from another chain?

Typically real source assets support destination claims. Security depends on custodial signers, verification logic, or services.

What is the claim worth if the guarantor fails? Often nothing. Bridges concentrate assets into shared security points, extending Chapter 12.

Custody RiskCustody Risk

Who holds assets and keys?

As Chapter 5 explains, custodied balances can be creditor claims, different under failure.

Self-custody replaces custody risk with operational risk: lost keys, damaged backups, or mistaken phrases can cause permanent loss. Understand the choice.

Governance RiskGovernance Risk

Can a legal vote redirect funds?

Check voting concentration, execution delays, and emergency bypass authority.

Voting power can be temporarily borrowed, turning control into an economic attack: borrow, propose, vote, execute, repay.

ApprovalApproval / Allowance

Permission for a contract to spend a particular wallet asset.

It lasts until revoked, often with unlimited amounts.

Today's safety depends on every previously approved contract remaining sound. That exposure grows unless cleaned up.

It crosses categories but is a route you can close yourself.

Hands-on

Hands onClassify an incident and reconstruct how funds leftExplorer, official postmortem, and public incident archiveFree; read-only, no wallet connection, signatures, deployments, or attack calls

Only read records. Reconstruct transactions without executing attacks on any network.

Choose an incident with a public official postmortem. Complete evidence matters more than fame.

Read the report and draw a timeline: first abnormal transaction, discovery, pause, announcement, and completed outflow.

Inspect discovery-to-pause delay. Hours of response versus minutes of attack is a risk indicator itself.

Inspect key transactions: contracts, call order, and final destinations.

You need not decode everything. Check whether reported sequence matches primary records, applying Chapter 23.

Draw fund movement from before to after:

User deposits → protocol pool → ? → ? → attacker address → ?

Give each step an action and address. Leave unresolved steps as question marks.

Check all ten categories as triggered, not triggered, or unknown, with evidence.

CategoryStatusReport or on-chain evidence
Smart Contract
Liquidity
Oracle
Bridge
Custody
Counterparty
Governance
Leverage
Token
Operational

Many incidents touch three to five categories. One alone may indicate missed propagation.

Connect triggered categories, explaining each next failure.

Lists show what happened; diagrams show why it cost so much.

Answer four questions briefly:

  1. What was the first domino?
  2. Which single preventive change would most reduce loss?
  3. Who ultimately paid: treasury, depositors, holders, or insurance?
  4. Had anyone raised the issue before, including medium/low audit findings?

Many incidents had prior warnings that were ignored.

Apply the same table to a protocol you use. Incident review is practice; understanding your exposure is the purpose.

AI Lab

AI LabAsk AI for an incident review and mark invention against the official postmortemLevel 2 · AI Copilot

Public reports and records provide fixed, verifiable evidence, making this useful for calibrating model trust.

Review [incident name and approximate date].

1. Timeline: timezone, event, transaction hash or block, and source.
2. Attack path: contract/function, effect, and why design allowed it.
3. Classify triggered / not triggered / unknown for:
Smart Contract / Liquidity / Oracle / Bridge / Custody /
Counterparty / Governance / Leverage / Token / Operational
Give public evidence for each.
4. Loss amount, valuation date, and final bearer.
5. Separate sourced facts, analogous-case inferences, and unavailable facts.

Mark uncertainty unavailable. Never invent plausible hashes, addresses, or numbers.

Open every hash and address first.

Common failures:

  1. Invented identifiers, impossible to detect from plausible formatting alone.
  2. Mixed incidents, requiring official timeline comparison.
  3. False certainty, especially unresolved loss allocation.

Have the model separate certainty, then focus checks on claimed certainty. This can reduce checking effort and improve output reliability.

Verify these points yourself after using AI

  • Have you opened every transaction hash and contract address?
  • Does the timeline match all official milestones?
  • Did it merge details from similar incidents?
  • Does the loss valuation specify its price date?
  • Did alleged or suspected claims become certain facts?
  • Are classifications supported rather than inferred silently?
  • Does it identify the final loss bearer clearly?
  • Does it state uncertainty? None is a warning sign.

Real-World Case

Bridge verification is bypassedRepeatedly in recent years

Bridge issuance depends on proving locked source assets. Attackers convince bridges of deposits that never occurred, through false proof, bypassed checks, or compromised signers.

Bridges are concentration points, combining many assets under shared verification. Chapter 12's multi-chain growth increases that exposure.

Ask what claims retain if the guarantor fails.

A shallow pool values collateralRepeated incidentsLending and perpetual protocols

A collateral price comes from a DEX pool with limited reserves.

Borrow funds, inflate price, borrow real assets against false collateral value, and reverse manipulation, potentially within one transaction.

Code and audits may pass. The design mistake is making manipulation cheaper than extractable debt.

Oracle, Leverage, and Chapter 15's Liquidity interact. Separate assessments can miss the combination.

Several platforms halt withdrawals together2022

Fixed-yield platforms failed through leveraged, mismatched investments using customer money. Declines created losses, redemptions, forced selling, and more losses.

No code bug was necessary. Custody, Counterparty, Operational, and Leverage combined.

Chapter 5's ownership distinction became costly reality: balances turned into creditor claims.

A vote transfers the treasuryGovernance protocolsRepeated cases

Transparent rules can still permit attacks when voting power is acquired temporarily or already concentrated. Borrowing, voting, execution, and repayment form an economic operation.

Inspect concentration, timelocks, and emergency authority together.

Every step can be legal under the rules, making advance warnings harder to convey.

Change One Variable

What ifThree firms audit the protocol

Code risk falls, but only audited versions are covered; economic design is not comprehensively assessed; people and authority practices remain outside code review.

One risk category receives serious inspection, rather than the system receiving a universal safety guarantee.

What ifAn oracle adds multiple sources, medians, and time weighting

Manipulation becomes more expensive and must persist long enough to influence the window.

But time weighting delays prices, potentially allowing collateral deficits before liquidation.

Manipulation resistance and timeliness trade off. Ask where the parameters place the design and why.

What ifUpgrade control becomes 4-of-7 with a 48-hour timelock

Two categories improve.

Operational Risk falls because one key is insufficient. Governance Risk falls because users can observe changes and exit; timelocks provide an escape window.

Emergency fixes slow, while seven keys on one machine or under one person's control provide little independence.

Identify signers and their independence.

What ifCollateral becomes the protocol's own token

A self-referential loop emerges: rising tokens create borrowing capacity, which funds more purchases.

Reversal is faster: declines trigger liquidation and further selling. Token depth is often far below supported debt.

Chapter 13, Chapter 18, and Chapter 21 share this structure. Inspect whether collateral includes the protocol's own issuance.

Takeaway Questions

9
Who bears the risk?

Check ten categories, then connect them.

Also determine the order of loss bearers. Without a written sequence of treasury, depositors, holders, and insurance, the structure remains unclear.

11
Can the product still run if its token price goes to zero?

Inspect collateral and price sources for the protocol's own token.

If present, token collapse and protocol failure may be one event, explaining impressive rallies and rapid declines.

16
What permissions does an agent have?

The human version of Agent permissions is reviewing wallet approvals, limits, and upgradeability.

What can spend, within which boundary, until when, and how can you revoke it? T33 and T34 engineer these controls.

17
Who bears the loss when AI gets it wrong?

If AI supplies a wrong address, price, or approval, who bears loss?

Authority and loss-allocation order need written answers before deployment. T32 turns this into architecture constraints.

Chapter Check

Key idea

There is more than one kind of risk—there are ten, and incidents often involve several at once.

Finished this chapter’s lab? Mark it completeView all progress

On this page