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 Risk | Has the code been audited? Who controls upgrades? |
| Liquidity Risk | When you want to exit, will there still be money in the pool? |
| Oracle Risk | Where does the price come from? Can it be manipulated? |
| Bridge Risk | What actually backs the asset that crossed over? |
| Custody Risk | Who holds the assets? Who holds the private keys? |
| Counterparty Risk | If your counterparty disappears, what do you still have? |
| Governance Risk | Can a single vote move the money away? |
| Leverage Risk | If prices fall 30%, how many cascading liquidations follow? |
| Token Risk | Who gets diluted by unlocks and new issuance? |
| Operational Risk | How 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:
- A thin pool price is manipulated
- Collateral receives an incorrect valuation
- Positions are wrongly liquidated
- Forced sales drain liquidity
- Unsellable collateral leaves bad debt
- Emergency governance changes parameters
Classify each step:
| Step | Category | Reassurance in isolation |
|---|---|---|
| Manipulated price | Oracle Risk | Concentrated sources, but a seemingly large pool |
| Wrong valuation | Smart Contract Risk | Code follows design |
| Liquidation | Leverage Risk | The mechanism works |
| Drained depth | Liquidity Risk | Normal depth is sufficient |
| Bad debt | Counterparty Risk | A reserve exists |
| Emergency changes | Governance Risk | An emergency mechanism exists |
Individually manageable can become collectively catastrophic.
Compare a single failure with a compound incident:
| Single failure | Compound incident | |
|---|---|---|
| Trigger | One component | Failure propagates |
| Loss | Roughly component exposure | Can exceed any one exposure |
| Audit detection | Often possible | Rarely, beyond protocol boundaries |
| Postmortem | Module bug | Several unlikely events together |
| Prevention | Individual checks | Checks 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:
| Layer | Categories | Audit visibility | Typical loss |
|---|---|---|---|
| Code | Smart Contract, bridge verification | Often | Drained within a transaction |
| Economics | Oracle, Liquidity, Leverage, Token | Limited | Rules exploited as designed |
| People | Custody, Counterparty, Governance, Operational | Outside code audits | Authorized 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:
| Route | Appearance | Category | User-side action |
|---|---|---|---|
| Logic exploited | Unexpected operation combination | Smart Contract | Audit scope, fixes, operating history |
| Price manipulated | False valuation input | Oracle | Sources, depth, delays, medians |
| Keys compromised | Direct authority stolen | Custody, Operational | Multisigs, timelocks, single-owner powers |
| Rules changed | Vote or upgrade redirects funds | Governance | Voting distribution and execution delay |
| Your approval | Authorized contract acts differently later | User-side | Revoke 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 dependency | Consequence |
|---|---|
| Oracle or price source | Common manipulation |
| Collateral | Common depeg or deficit |
| Bridge | Unbacked claims throughout |
| Multisig or owners | Shared key compromise |
| Chain sequencer | Simultaneous 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 → unassessedSix 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
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.
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.
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.
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.
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.
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
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.
| Category | Status | Report 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:
- What was the first domino?
- Which single preventive change would most reduce loss?
- Who ultimately paid: treasury, depositors, holders, or insurance?
- 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
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:
- Invented identifiers, impossible to detect from plausible formatting alone.
- Mixed incidents, requiring official timeline comparison.
- 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 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 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.
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.
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
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.
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.
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.
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
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.
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.
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.
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
It covers one category and a particular version.
Economic design, people, and later upgrades remain separate concerns.
Major losses often concentrate beyond code defects.
Inspect scope, version, critical fixes, and later changes.
A repeated chain:
- Thin price source manipulated → Oracle
- False valuation enables excessive borrowing → Smart Contract design
- Reversal liquidates positions → Leverage
- Sales consume depth → Liquidity
- Unsellable collateral leaves debt → Counterparty
- Emergency parameter vote → Governance
Each link may look manageable alone; connections create the loss.
Draw arrows after completing the checklist.
Exploited logic, manipulated prices, stolen keys, changed rules, and your approvals.
Old unlimited permissions to upgraded contracts require no protocol breach.
Revoke unused approvals and separate large holdings from daily interaction wallets.
Past approved contracts remain part of today's safety boundary, growing unless cleaned up.
It separates checked and clear from not checked.
All-green reports may hide missing investigation.
Unassessed items create the next research agenda, preventing future confusion about completed checks.
Honest uncertainty determines checklist quality, beyond length.
Check:
- Did you review every category?
- Is evidence cited for each?
- Were permissions checked on-chain? Documents can disagree with reality.
- Did you connect categories?
- Can you state the loss-bearing order?
- Any unknowns? None usually means omissions.
Three to five unassessed categories are normal on a first serious pass. That is honest research, not failure.
Key idea
There is more than one kind of risk—there are ten, and incidents often involve several at once.