Almost every discussion of wallet security is about the key: where it is stored, how it is backed up, whether a device holds it. That is the part users control. The part they do not control is how the software asking for that key got onto the machine, and that path has more participants than most people would guess.
What sits between the source and your device?
Four or five parties, any of which could change what runs.
The developer writes source code, which is usually public and occasionally read. A build machine compiles it, and the output depends on the compiler, the libraries present and the environment. A package registry supplies the dependencies that compilation pulls in. A distribution channel — an app store, a download page, a package manager — hands the result to the user. And the device’s operating system decides what the binary may do once it is there.
An update is the same path travelled again, and it is travelled far more often. Software that auto-updates has handed the distributor a standing permission to replace what runs, which is convenient, keeps security fixes flowing, and means the trust decision is renewed silently every few weeks rather than once at install.
Reading the source tells you about one of those. The others are trusted implicitly, and the trust is usually invisible: nothing in the install flow says “you are also relying on a build server you cannot inspect.”
What is a dependency attack?
Compromising a package that the wallet depends on, rather than the wallet.
The mechanism is documented in GitHub’s own advisory database. A
malicious actor added a package called flatmap-stream as a dependency
of event-stream, a widely used library, in a single release. Anyone
who installed or rebuilt against that version pulled in the malicious
code without changing a line of their own.
What made that incident notable was the targeting. The payload was written to activate only inside one specific downstream application — a cryptocurrency wallet — so it did nothing on the machines of the millions of other users who installed it, which is exactly the property that delays detection.
The structural problem is arithmetic. A modern application may have hundreds or thousands of transitive dependencies, each with its own maintainers, each a place where a compromised account or a transferred package changes what you ship. Nobody reads them. The ones most likely to be compromised are the small, unglamorous, single-maintainer packages at the bottom of the tree.
What do reproducible builds actually fix?
They prove the binary corresponds to the source. Nothing more, and that is a great deal.
In a reproducible build the compilation is fully specified — compiler version, libraries, timestamps, paths — so that anybody running it on their own machine gets a byte-identical result. Several people build independently and publish signed attestations of the hash they got. If they agree, a compromised build machine cannot have inserted anything, because its output would differ.
Bitcoin Core does this, and it is one of the stronger software-distribution guarantees available in any field. Most wallets do not. Checking whether a wallet publishes reproducible builds, and whether more than one person signs them, is a sharper question than almost anything else a user can ask about it.
What reproducibility does not address is whether the source is trustworthy. A backdoor committed to the repository and reviewed by nobody reproduces perfectly. Source review and build reproducibility are orthogonal defences, and a project needs both.
Why are app stores a weak point?
Because they are an unavoidable trusted third party, and they have shipped fake wallets repeatedly.
A mobile user cannot verify a signature on a binary the store installs. The store decides what the app is, can serve different builds to different users in principle, and has at various times hosted convincing counterfeits of popular wallets — applications whose only function was to collect recovery phrases. Takedowns happen after reports, which is after the losses.
Desktop is better only if the user acts. Signed releases and published hashes exist for most serious projects and verifying them takes two commands; the share of users who run those commands is small enough that the guarantee is largely theoretical.
The practical mitigations are unexciting. Install from the project’s own site or a store listing reached from it, never from a search result. Check the publisher name and the install count against what the project says. And treat a wallet that has no verifiable release process as software for small amounts regardless of how good its interface is.
Does a hardware wallet solve it?
It moves the problem, which is a real improvement and not a solution.
The point of a signing device is that a compromised host cannot extract the key, because the key never leaves. That holds, and it is why a hardware wallet with a malware-infested computer is a survivable position where a software wallet is not.
What it does not cover is the host lying about what you are signing. The device shows the transaction on its own screen precisely so the user can catch that, which works only if the user reads it — and the whole attack class exists because most do not.
The device has its own supply chain too: firmware, the vendor’s build process, the chip, and whoever handled the package between factory and door. Serious vendors address each with signed firmware and tamper-evident packaging, and a buyer’s defence is to purchase from the manufacturer and generate the seed on the device rather than accept one that arrived with it.
What happens after a suspected compromise?
Treat the key as exposed, not the device as cleanable.
If a wallet you used turns out to have shipped a malicious build, or a machine that handled a recovery phrase is found compromised, the question is not whether anything was stolen yet. A key that may have been copied is a key somebody can use at any future moment, and waiting to see whether funds move is a strategy with no exit.
The procedure is to generate a new wallet on hardware that was not involved, confirm it works with a restore test, and move the funds. Do it before investigating, because investigation takes time and the attacker does not need any.
What makes this hard is that supply chain compromises are usually disclosed long after the fact, and the disclosure arrives as news rather than as an alert in the software. A holder who does not follow such announcements will not learn of it, which is an argument for keeping the number of distinct wallet applications in use small enough to track.
What should a user actually do?
Four things, in descending order of value per minute spent.
Prefer software with many independent reviewers and a published, reproducible release process. Install from the project’s own distribution rather than from wherever a search engine points. Verify signatures on desktop downloads, which is two commands and the only point at which the chain can be checked rather than trusted. And keep the amount on any device proportionate to how much of its supply chain you have actually inspected, which for almost everyone is none of it.
Beyond that, the structural answer is the same as everywhere else in Bitcoin: reduce what a single failure can take. A signing device limits what a compromised computer costs. A multisig quorum across different vendors limits what a compromised device costs. Neither requires trusting a supply chain you cannot audit.
Check it yourself
For any wallet you use, three questions have published answers:
Does it publish release hashes and signatures?
Are its builds reproducible, and does more than one person attest?
How many dependencies does it ship, and who maintains them?
The third is answerable from the repository in a minute and is often startling. A project’s dependency count is a direct measure of how many parties it is asking you to trust, and the number varies between comparable wallets by more than an order of magnitude.
For Bitcoin Core specifically, the verification is standard and documented: check the signatures on the hash list, then check the file against it. It takes under a minute and is the only part of the chain an ordinary user can personally close. How to verify the Bitcoin Core you are running is the procedure, along with the part the commands do not settle — whose signatures you accept, and on what basis.
What remains uncertain
How much targeted compromise has already happened. A payload written to fire only inside one application on one platform is invisible to everyone else by construction, and the known cases were found by accident. The base rate is unknowable, and the incentive to attempt it rises with the value held in wallets.
Whether reproducible builds spread. The technique works and the cost is real engineering effort for a benefit almost no user checks. Without pressure from users or from distributors, projects rationally spend that effort elsewhere.
Whether app store distribution can be made verifiable. Several proposals exist for transparency logs that would let a user confirm the binary they received is the one everybody else received. None is deployed at scale on the platforms most people use, and the platform owners have little reason to adopt one.
Sources
- TechnicalGitHub Advisory — event-stream and flatmap-stream ↗
- First-partyBitcoin Core — contrib/guix/README.md ↗
- First-partyBitcoin Core — SECURITY.md ↗
- TechnicalReproducible Builds ↗
- ContextNIST — Secure Software Development Framework ↗