OAK — OnChain Attack Knowledge

Worked example · 2024-06

Bittensor bittensor PyPI supply-chain coldkey-exfiltration compromise — Bittensor / TAO — 2024-07-02

Loss
approximately $8M extracted in TAO from Bittensor coldkey holders whose machines installed the malicious bittensor PyPI package release (v6.12.2) during the late-June / early-July 2024 vulnerable window. The exfiltrated coldkey private keys were used by the attacker to drain affected wallets of TAO holdings; the cumulative drained value at TAO spot price during the extraction window was approximately $8M. The affected cohort was the subset of Bittensor users who pip-installed the affected version during the vulnerable window — not the entire Bittensor user base — and the realised-loss bound is determined by the affected cohort's TAO holdings, not by the network's total TAO supply or staked weight.
Recovery
none of material consequence on the on-chain layer. The Bittensor Foundation / Opentensor Foundation operationally responded by halting key network-layer operations (validator transactions / staking transactions) for an extended window (~24 hours) to constrain further coldkey-driven drains while users rotated to non-compromised coldkeys. The pause was a delay-and-mitigation primitive rather than a recovery primitive; once the network resumed, TAO that had already been extracted to attacker-controlled coldkeys was no longer recoverable on-chain. Subsequent laundering followed the cross-chain bridge laundering pattern (TAO bridged into EVM-side liquidity, then routed through Tornado Cash and similar mixing infrastructure).
OAK Techniques observed
OAK-T11.002 (Wallet-Software / Signing-Surface Compromise) in the PyPI / package-manager supply-chain sub-class — the proximate cause was a malicious release (v6.12.2) of the official bittensor Python package on PyPI containing a module that exfiltrated coldkey private-key material from local machines on package import. The compromise was upstream of the user — users pip-installing the affected version received the malicious code as part of the package, with no per-user social-engineering step required. OAK-T7.001 (Mixer-Routed Hop / laundering tail) — the downstream laundering pipeline operated through a cross-chain-bridge-then-mixer pattern; the proceeds were bridged from Bittensor / TAO into EVM-side liquidity and routed through Tornado Cash, completing the standard 2024 laundering shape.
Attribution
pseudonymous. No public named-individual attribution. The package-supply-chain compromise vector is structurally similar to the broader 2023–2024 software-supply-chain compromise pattern (3CX 2023, MOVEit 2023, several PyPI / npm compromises across the same period), but no industry forensics provider has publicly converted on-chain analysis or supply-chain forensics into a named-individual or named-cluster claim for the Bittensor case. There is no public OAK-G01 / state-actor attribution for this incident, although the structural similarity to the 3CX 2023 supply-chain pattern (which has been attributed to a DPRK-aligned cluster — see /examples/2023-03-3cx-supply-chain.md if present in OAK's corpus) is worth noting for cohort framing without being claimed as direct attribution.
Key teaching point
package-manager supply-chain compromise of widely-installed crypto-native software is a 2024 attack-surface class that defender practice has under-prioritised at the user perimeter. The Bittensor 2024 case is the canonical 2024 worked example for this surface in the crypto-native software ecosystem. The structural parallels are 3CX 2023 (DPRK-attributed, software-supply-chain compromise of an enterprise communications product) at the ecosystem level and the MOVEit 2023 cluster (Cl0p-attributed, software-supply-chain compromise of an enterprise file-transfer product) at the breadth-of-impact level; the structural difference in the Bittensor case is that the affected software is crypto-native and the per-installation impact is direct private-key exfiltration rather than the multi-step downstream-data-or-credential-exploitation patterns that the enterprise-software supply-chain cases produced. Defender practice for crypto-native users should treat package-manager supply-chain integrity as a first-class threat vector, with package-pinning, signature-verification (where available), reproducible-build verification, and operator-side network-layer pause-readiness as the principal mitigations.

Summary

Bittensor (TAO) is a decentralised machine-learning network with a custom L1 / Substrate-based chain; the network's coldkey / hotkey separation is its principal account-architecture primitive, with the coldkey holding the principal staked-and-balance authority and the hotkey holding operational signing authority. The official bittensor Python package on PyPI is the principal client-side software for end-user interaction with the network — staking, transferring, validator operation, etc. — and is widely installed across the user base.

In late June 2024 / early July 2024, an attacker published a malicious release of the bittensor package on PyPI under version 6.12.2. The malicious release contained a module that, on package import (i.e., on any standard import bittensor in user code), exfiltrated coldkey private-key material from local machines to attacker-controlled infrastructure. The exfiltration mechanism — per the post-incident forensic analysis published by Opentensor Foundation, Bittensor community researchers, and several supply-chain security commentators — was structurally identical to the broader 2023–2024 PyPI / npm credential-stealer pattern: a malicious module that integrated cleanly with the package's normal import-time behaviour, with sufficient subtlety to evade casual code review.

The affected cohort was users who pip-installed the affected version during the vulnerable window. As coldkey private-key material was exfiltrated, the attacker drained affected wallets of their TAO holdings; cumulative extraction was approximately $8M at TAO spot price during the extraction window. The Opentensor Foundation operationally responded by halting key network-layer operations (validator transactions / staking transactions) for approximately 24 hours, constraining further coldkey-driven drains while users were guided to rotate to non-compromised coldkeys. The pause was a delay-and-mitigation primitive rather than a recovery primitive; TAO already extracted before the pause window or by users whose coldkey rotation lagged the pause was not recoverable on-chain. The malicious package version was removed from PyPI; subsequent communication included guidance on package-version verification and coldkey hygiene.

For OAK's purposes the case is a clean T11.002 (PyPI / package-manager supply-chain sub-class) extraction with a T7.001 (mixer-routed laundering tail) downstream pipeline — and a particularly clean worked example of T11.002 outside the standard end-user-software-supply-chain framing because the affected software is crypto-native (intended for direct interaction with the network) rather than general-purpose end-user software repurposed by attackers. The novel OAK contribution of the worked example is documenting the crypto-native package-manager supply-chain surface as a discrete attack-surface class, with cross-reference to the broader 2023–2024 supply-chain compromise pattern (3CX 2023 etc.) at the ecosystem level for cohort framing.

Timeline (UTC)

When Event OAK ref
Pre-event Bittensor / TAO network operates with coldkey / hotkey separation; official bittensor Python package on PyPI is principal client-side software, widely installed across user base (T11.002 surface — package-manager supply-chain)
Pre-event Attacker obtains publishing access to the bittensor package on PyPI via a vector that the post-incident forensics characterised as a credential / publishing-surface compromise (specific vector at the publishing-credential layer); no per-user social-engineering step required (off-OAK pre-event observation)
Late-Jun 2024 (publish window) Attacker publishes malicious bittensor package version 6.12.2 to PyPI containing a module that exfiltrates coldkey private-key material on package import T11.002 (PyPI supply-chain compromise) entry
Late-Jun – Jul 2024 (vulnerable window) Bittensor users pip-install the affected version; coldkey private-key material exfiltrated to attacker-controlled infrastructure on each import T11.002 (per-installation exfiltration)
2024-07-02 (drain-tx window onset) Attacker begins draining affected coldkey-controlled wallets of TAO; cumulative extraction reaches approximately $8M over the extraction window T11.002 + T7.001 chained extraction
2024-07-02 / -03 (within hours of detection) Opentensor Foundation detects anomalous TAO outflows; identifies the package-supply-chain vector via correlation of affected-user reports (operator response)
2024-07-02 / -03 (within hours of detection) Opentensor Foundation halts validator transactions / staking transactions for ~24 hours as a defensive pause; user-facing communication includes guidance on package-version verification and coldkey rotation chain-operator delay-and-mitigation primitive
2024-07-02 onward Malicious bittensor v6.12.2 removed from PyPI; clean version published; user guidance on package-source verification, virtual-environment hygiene, and coldkey rotation propagated (operator-side mitigation)
Days following Attacker laundering routes proceeds via cross-chain bridge from Bittensor / TAO into EVM-side liquidity, then through Tornado Cash T7.001 (mixer-routed laundering)
2024-07 onward Opentensor Foundation publishes follow-up post-mortem; community-side forensic analysis converges on the package-import-time exfiltration mechanism (transparency / cohort signal)
Continuing No public on-chain recovery; no civil-forfeiture action (recovery state)

What defenders observed

  • The compromise was upstream of the end user, not at the user perimeter. Users pip-installing the affected bittensor version received the malicious code as part of the package; no per-user social-engineering step (phishing email, clicked-link, signed-malicious-transaction) was required. This structural property — upstream-of-user compromise — is the defining feature of package-manager supply-chain incidents and is what distinguishes them from the user-perimeter compromise patterns that defender practice (security-awareness training, anti-phishing tooling, transaction-simulation in wallet-software) has historically focused on. Defender practice for crypto-native user environments should expand to cover package-manager supply-chain integrity as a first-class threat vector, alongside the user-perimeter mitigations.
  • Package-version verification and reproducible-build verification are the principal user-side mitigations. A user environment that pinned the bittensor package version to a known-good release (e.g., via a pinned requirements.txt or pyproject.toml-locked-version) and that verified package signatures or reproducible builds against the upstream source-of-truth would not have automatically pulled in the malicious v6.12.2. The Mitigations-layer lesson is that package-version pinning is a low-cost user-side mitigation that the crypto-native user base should adopt as standard practice; the operational friction of pinning is small relative to the realised-loss bound of an unpinned environment in a supply-chain compromise. Reproducible-build verification — where the user can deterministically regenerate the published package from its public source and verify the build matches — is the stronger property where the upstream supports it; the crypto-native ecosystem should prioritise reproducible-build adoption.
  • Operator-side network-layer pause-readiness is the principal protocol-side mitigation for this class. Opentensor Foundation's ability to halt validator transactions / staking transactions for approximately 24 hours during the active-extraction window constrained further coldkey-driven drains while users rotated to non-compromised coldkeys. The pause primitive was operationally available because Bittensor's chain-operator architecture supports network-layer-state coordination at the foundation level; on chains without comparable operator-side pause-readiness, the equivalent mitigation primitive would not be available. Defender threat models for crypto-native networks should treat operator-side network-layer-pause-readiness as a discrete defensive-design dimension; the dimension is more available on permissioned-validator / foundation-coordinated chains and less available on deeply-decentralised chains.
  • Affected-cohort-size as realised-loss bound applies in the supply-chain context. Not every Bittensor user was affected — only those who pip-installed the affected version during the vulnerable window. The realised loss is bounded by the affected cohort's TAO holdings, not by the network's total TAO supply. Defender threat models for package-manager supply-chain incidents should compute realised-loss bound as a function of the affected-cohort size and per-affected-user holdings, in the same operational analogue that Loopring 2024 at /examples/2024-06-loopring.md and Holograph 2024 at /examples/2024-06-holograph.md apply to smart-wallet recovery-flow defects and admin-key-mint AMM-dump incidents respectively.
  • Cross-reference with the 3CX 2023 supply-chain pattern is structurally informative without being direct attribution. The 3CX 2023 supply-chain compromise (DPRK-attributed at the cluster level) targeted enterprise-communications software with downstream credential-and-data-exfiltration outcomes; the Bittensor 2024 case targeted crypto-native software with direct private-key-exfiltration outcomes. The structural similarity at the supply-chain entry-vector level — compromise of an upstream software-publishing surface, malicious release distributed via the standard distribution channel, end users receive the malicious code as part of normal software-installation flows — is real and operationally informative for defender practice; defender threat models that have absorbed lessons from the 3CX 2023 cohort should extend those lessons to crypto-native package-manager surfaces. The structural difference at the per-installation impact level — direct private-key exfiltration in Bittensor, multi-step downstream-credential-exfiltration in 3CX — means the Bittensor surface produces realised-loss extraction faster and with fewer downstream-compromise hops, raising the attacker's expected value relative to the 3CX-style enterprise pattern. This dimension should be flagged for defender practice without claiming direct cluster-level attribution overlap.

What this example tells contributors writing future Technique pages

  • T11.002 covers package-manager supply-chain compromise as a sub-class within its broader wallet-software-compromise construction. The Bittensor 2024 case is the canonical 2024 worked example for the PyPI / package-manager sub-class. Together with the Loopring 2024 case at /examples/2024-06-loopring.md (smart-wallet-software-flow weakness sub-class) and the Gala / Holograph 2024 cases (operator-side admin-key compromise sub-class), the four cases anchor the principal sub-classes of T11.002 visible in the 2024 cohort. Future contributor guidance may consider whether the package-manager supply-chain sub-class warrants promotion to a separate technique ID, given the structural distinction at the upstream-of-user dimension; until that promotion happens, the broad T11.002 construction continues to hold.
  • Package-manager supply-chain integrity is a discrete Mitigation surface that the corpus's coverage of has been thinner than its coverage of user-perimeter mitigations. The Bittensor 2024 case anchors this dimension in the 2024 cohort and should be cross-referenced from any future Mitigations-layer entry on package-manager integrity. Recommended Mitigation framing: package-version pinning, reproducible-build verification, package-signature verification (where the upstream supports it), virtual-environment isolation, dependency-graph review, and integrated CI-side dependency-supply-chain-integrity checks. Defender practice in the broader software-engineering community has substantial existing tooling and best-practice for these mitigations; the crypto-native user-software ecosystem has been slower to adopt them at scale, and the Bittensor case anchors the operational consequence of that gap.
  • Operator-side network-layer pause-readiness is a discrete recovery-primitive sub-class within OAK's Recovery-Primitives taxonomy, distinct from the L2-sequencer-pause sub-class anchored by Velocore 2024. The two cases illustrate distinct operational shapes of the broader pause-style primitive: Velocore 2024's Linea sequencer-pause was a chain-operator response to a per-protocol exploit on a specific protocol on the chain, while Bittensor 2024's network-layer pause was a chain-operator response to a per-user supply-chain compromise affecting many user accounts. The two together delineate the corpus's understanding of pause-style primitives across the protocol-level versus user-level dimension, and contributors writing the Mitigations-layer Recovery-Primitives entry should record both as distinct sub-cases of the broader pause-style primitive.
  • 3CX 2023 and the broader 2023–2024 software-supply-chain compromise cohort is the structural-parallel framing point for the Bittensor 2024 case. Contributors writing the worked-example layer should preserve the cohort framing — supply-chain compromise of widely-installed software is a structural attack-pattern that crosses the enterprise-software / crypto-native-software divide — without over-claiming attribution overlap. The Bittensor case is pseudonymous at the OAK attribution-status layer; the 3CX case has DPRK-aligned cluster-level attribution at the industry-forensics layer; the structural similarity at the entry-vector level does not imply attribution overlap and should not be claimed as such.

Public references

  • [opentensorbittensor2024] — Opentensor Foundation official statement on the July 2024 bittensor package supply-chain compromise, including the malicious-version identification and the network-layer pause timeline.
  • [bittensorpostmortem2024] — Opentensor Foundation follow-up post-mortem on the package supply-chain compromise root cause and the user-side coldkey rotation guidance.
  • [peckshieldbittensor2024] — PeckShield headline figures and on-chain analytics for the Bittensor July 2024 TAO drain.
  • [blocksecbittensor2024] — BlockSec / on-chain forensic analysis of the Bittensor coldkey-drain transaction trace and the cross-chain bridge laundering tail.
  • [slowmistbittensor2024] — SlowMist incident analysis covering the package-supply-chain entry vector and the laundering pipeline.
  • [zachxbtbittensor2024] — ZachXBT / on-chain analyst thread tracking the attacker-controlled addresses and the cross-chain bridge laundering pattern.
  • [pypiadvisorybittensor2024] — PyPI / Python Software Foundation security advisory on the malicious bittensor v6.12.2 release, including the package-removal timeline and the user-facing remediation guidance.
  • [mandiant3cx2023] for cross-reference to the 3CX 2023 supply-chain compromise as the broader 2023–2024 software-supply-chain compromise cohort framing point.

Discussion

Bittensor 2024 is OAK's canonical case for the PyPI / package-manager supply-chain sub-class of T11.002 in the crypto-native software context. The case is operationally instructive because it surfaces an attack pattern — upstream-of-user compromise of widely-installed crypto-native software — that the OAK 2022–2024 corpus has covered relatively thinly relative to its coverage of the user-perimeter compromise patterns (phishing, malicious wallet-extension, malicious-transaction-signing). The Mitigations-layer lesson is that package-manager supply-chain integrity is a first-class threat vector for crypto-native user environments and that defender practice should expand to cover it explicitly.

The structural cohort framing with the broader 2023–2024 software-supply-chain compromise cluster is the corpus-level signal that contributors should preserve. 3CX 2023 (DPRK-attributed, enterprise-communications software, downstream credential-and-data-exfiltration), MOVEit 2023 (Cl0p-attributed, enterprise file-transfer software, multi-thousand-organisation downstream impact), several PyPI / npm 2023–2024 credential-stealer compromises (cluster-attribution varied), and Bittensor 2024 (pseudonymous, crypto-native software, direct private-key-exfiltration) are not the same incident and not the same attribution; they are the same broad attack-pattern class — software-supply-chain compromise of widely-installed software with downstream malicious-payload distribution to end users — and the defender-practice lessons of any one transfer to the others at the entry-vector level even when attribution does not. Contributors writing the worked-example layer should preserve this cohort framing without conflating it with attribution overlap.

The crypto-native dimension of the Bittensor case is what makes it operationally distinct from the broader 2023–2024 supply-chain cohort. In the enterprise-software cohort (3CX, MOVEit), the per-installation impact is downstream — the attacker still needs additional steps (lateral movement, credential pivot, data-exfiltration) to convert the compromise into realised loss. In the crypto-native cohort (Bittensor), the per-installation impact is direct private-key exfiltration, which the attacker can convert into realised on-chain extraction in a single subsequent step. The attacker's expected value per affected installation is therefore higher in the crypto-native case, which has corresponding implications for the rate at which attackers will probe crypto-native package-manager surfaces in the 2024–2025 cohort. Defender practice should anticipate this rate-elevation property and provision accordingly.

The operator-side network-layer pause primitive at Bittensor was the load-bearing protocol-side mitigation. The Opentensor Foundation's ability to halt validator transactions / staking transactions for approximately 24 hours during the active-extraction window constrained further drains while users rotated coldkeys. The primitive is operationally available because Bittensor's chain-operator architecture supports network-layer-state coordination at the foundation level; on chains without comparable pause-readiness, the equivalent mitigation would not be available. The Mitigations-layer dimension is that operator-side network-layer-pause-readiness is a discrete defensive-design surface — distinct from the L2-sequencer-pause primitive that the Velocore 2024 case at /examples/2024-06-velocore.md anchors at the per-protocol-on-chain level, and distinct from the on-contract-centralised-authority primitive that the Gala 2024 case at /examples/2024-05-gala-games.md anchors at the token-contract level. The four pause-style primitives (network-layer-pause, sequencer-pause, on-contract-centralised-authority, validator-coordinated-freeze) span the principal protocol-side defensive-pause primitives in the OAK 2024–2025 corpus and contributors writing the Mitigations layer should cover them as integrated sub-cases.

For OAK's broader credibility, including Bittensor 2024 in the worked-examples layer closes three gaps: it adds a 2024 worked example of the PyPI / package-manager supply-chain sub-class of T11.002 in the crypto-native software context, it documents the operator-side network-layer pause primitive as a real defensive surface visible in the 2024 cohort on a custom-L1 network, and it anchors the cross-reference framing with the broader 2023–2024 software-supply-chain compromise cluster (3CX 2023 in particular) without over-claiming attribution overlap.

Techniques demonstrated (2)