# Verifying OnionWire You were told OnionWire is a honeypot, or a trojan that steals Monero. That is a claim about a *binary*, and it deserves an answer you can check yourself in ten minutes rather than an argument you have to take on faith. This document is that answer. It is written so that nothing here has to be believed: every section is a command whose output you read yourself. If you only do one thing, do [Check 3](#check-3--10-minutes-rebuild-the-release-and-compare-bytes). It is the one that actually settles the question, and it is the thing most projects claiming "the source is public" cannot offer. --- ## What OnionWire can do to your Monero, and what it cannot Start with the honest part, because a threat model that only lists the good news is not a threat model. **The wallet is optional and chat never needs it.** OnionWire is a messenger. With no wallet configured at all there is no seed, no spend key, and no code path that touches Monero. `docs/WALLET.md` opens with that sentence and it is literally true. **By default it cannot spend.** No seed and no spend key are on the device. Receive works from a profile address or a view-only wallet. `/tip` is refused locally, before any network dial, unless spend was explicitly turned on at wallet create/restore. `ONIONWIRE_WALLET_NO_SPEND=1` forces that refusal. **A view-only wallet is detected and cannot be spent.** OnionWire probes `query_key` with `key_type=spend_key`; monero answers `-29 WATCH_ONLY` ("Cannot retrieve spend key") for a wallet with no spend key, and that answer is what the app keys off. It cannot extract a spend key that is not in the wallet. **The wallet RPC is loopback-only, and it demands a login.** OnionWire refuses an RPC URL with no credentials and refuses to run against an open RPC. It never puts wallet RPC on clearnet and never over `.onion`, and it never passes `--trusted-daemon`. **The part that is genuinely exposure — read this one.** In *app-owned wallet* mode OnionWire spawns `monero-wallet-rpc` itself and therefore knows the RPC credentials it set. It can read the open wallet's recovery phrase, and it does: `src/wallet.rs` calls `query_key keytype=mnemonic` to drive the backup screen, and `query_key spend_key` / `view_key` for the key-display actions. `docs/THREAT_MODEL.md` says so directly — "the recovery phrase and the private keys are displayable on demand", and a spend-capable wallet makes OnionWire "a local spend authority for that file". So: **a malicious build of that path could exfiltrate a seed.** That is not spin, it is the surface. The mitigations are that the seed-read is a user- initiated action on a wallet you chose to give it, that a funded wallet should be a separate hot wallet rather than savings, and that if you want OnionWire to *not* be able to spend, point it at a view-only wallet or run it with no wallet at all. The threat model already recommends exactly this; it is not a concession extracted by criticism. The rest of this document is about how you check that the binary you downloaded is the code described above, and not something else. --- ## Check 1 — 30 seconds: what code is even in the binary From a clone, on whatever commit you are interested in: ```bash cargo tree --locked -e normal --depth 1 # direct dependencies: 27 of them cargo tree --locked -e normal | wc -l # ~523 crates in total ``` The direct list is the one worth reading. All 27 are known crates: ``` argon2 arti-client chacha20poly1305 cuprated ed25519-dalek futures hkdf hmac md-5 qrcode rand ratatui rpassword rusqlite rustls safelog serde_json sha2 sha3 snow tokio toml tor-cell tor-hsservice tor-rtcompat x25519-dalek zeroize ``` Two of those deserve naming, because they are the honest answer to "why is there HTTP in a chat program": - **`arti-client`** — Tor, in-process. - **`cuprated`** — the in-process Monero chain node, pinned to a git revision. It is a **default feature**, so the release binary ships it. That second one is why the graph contains `hyper`, `axum`, `tower-http` and `http`. Do not take a grep's word for provenance — ask the graph: ```bash cargo tree --locked -e normal -i http # axum <- cuprate-rpc-interface <- cuprated cargo tree --locked -e normal -i reqwest # "did not match any packages" ``` `axum` and `hyper` are Cuprate's **JSON-RPC server** — the thing that answers a wallet client on loopback. That is a server, not a client. `http`/`httparse` also reach the graph through Arti's directory client, which speaks the Tor directory protocol inside a Tor circuit. What is genuinely absent, and worth confirming yourself: - **No HTTP client.** `cargo tree -i reqwest` matches nothing: no `reqwest`, `ureq`, `isahc` or `curl` anywhere. - **No telemetry.** No Sentry, analytics or crash-reporting SDK in the graph. ## Check 2 — 2 minutes: run it with no wallet at all ```bash ONIONWIRE_WALLET_NO_SPEND=1 ./onionwire ``` Chat, invites, onion rotation and the ratchet all work. Nothing about Monero is reachable. If your concern is specifically "steals Monero", this is the configuration where the concern does not apply. **The clearnet traffic you will see, stated plainly.** The release binary's default feature set includes the in-process Cuprate node. If you start a chain source, that node syncs to the Monero P2P network over clearnet, and you will see it in `sudo ss -tupn` or `tcpdump`. That is the node doing its job — it is not the messenger phoning home and it carries no chat data — but it *is* real outbound traffic, and any "no clearnet at all" claim would be false without this sentence. If you do not want it: - leave the chain source unset and unstarted (`F7`), and let a wallet RPC you run yourself be the only Monero side; or - build without it: `cargo build --release --no-default-features --features rustls`. Honest note on that second option: a `--no-default-features` binary is a different build and will not match the published hash. Building it yourself is the trust-minimising move — you just cannot use Check 3 to compare it against a download. ## Check 3 — 10 minutes: rebuild the release and compare bytes This is the real check. It answers the only objection that survives "the source is public": *the binary I downloaded might not be that source.* ```bash git clone https://forgejo.siriusdevops.com/sirius/onionwire cd onionwire git fetch --tags scripts/verify-reproducible.sh v0.14.0 ``` Replace `v0.14.0` with the tag you are checking. You need docker; you do not need Rust, or the right glibc, or the right distro. The rebuild happens inside the same builder image, pinned **by digest**, that CI uses, with the source paths, the target path, and `SOURCE_DATE_EPOCH` all fixed by `scripts/reproducible-build.sh`. It prints one of: ``` RESULT: MATCH — the published onionwire-x86_64-unknown-linux-gnu is byte-for-byte the output of commit built with the documented recipe. ``` or `RESULT: MISMATCH` and exits non-zero. **What a MATCH proves:** the released binary is exactly what this source compiles to with this recipe. Auditing the source is therefore sufficient — which is the property that was missing before, and the one the "just read the code" argument always quietly assumed. **What a MATCH does not prove:** that the source is benign. A project could publish source that does something bad and a binary that faithfully implements it. Reproducibility removes the *builder* from your trust set; it does not remove the *author*. Judging the source is still yours to do — now at least against a binary you know corresponds to it. A mismatch is a finding, not a glitch. The release also carries `build-info-.txt` recording the commit, epoch, toolchain, builder image digest and resulting hash, so you can see whether the release was cut from a different commit or the pinned image moved before you cry foul. ## Check 4 — verify the release signature Every binary and checksum asset is signed with [minisign](https://jedisct1.github.io/minisign/). The public key lives in the repo at `scripts/onionwire-signing.pub` and is also published as a release asset — get it from the repo, not from the same download you are checking, or the signature proves nothing. ```bash minisign -Vm onionwire-x86_64-unknown-linux-gnu -p onionwire-signing.pub ``` `Signature and comment signature verified` means the file is the one signed by that key. A `.sha256` file next to a binary only proves the download matches the release page; a signature proves the artifact is the one the maintainer signed, even if the release page is later altered. --- ## What is still not proven So that nobody over-claims on our behalf: - **There is no third-party audit.** `docs/SECURITY_AUDIT.md` is explicitly in-house. It is a starting point for a reviewer, not a substitute for one. - **Reproducible builds pin the build, not the intent.** See above. - **The seed-display capability is by design.** If you consider "an app that can read my seed" unacceptable regardless of what it does with it, then do not give OnionWire a spend-capable wallet. Use a view-only wallet or none. That is a legitimate position and OnionWire supports it without argument. - **A build you compile yourself is stronger than a verified download.** If you want the shortest trust chain, `git clone && cargo build --release` beats both the signature and the reproduction check, because there is no released binary to trust at all. If you find a discrepancy, a way to exfiltrate a seed, or a signature that does not verify, that is exactly what these checks are for. Report it. --- ## Maintainer: the signing key One-time setup, on a machine you control: ```bash minisign -G -W -p scripts/onionwire-signing.pub -s onionwire-signing.key ``` `-W` means the secret key is not encrypted: CI cannot answer a password prompt, and a passphrase stored beside the key in the same secret store protects nothing. Then: 1. Commit `scripts/onionwire-signing.pub`. 2. Store the **contents** of `onionwire-signing.key` as the Forgejo Actions secret `MINISIGN_SECRET_KEY` (Settings → Actions → Secrets). 3. Delete `onionwire-signing.key` from your machine, or keep it somewhere genuinely offline. Anyone holding it can sign a release. `scripts/sign-release.sh` fails closed: with no key, or if a signature it just produced does not verify against the committed public key, it exits non-zero and the release is not published. That is deliberate — an unsigned release is worse than a missing one, because it looks the same as a signed one to anyone who is not checking. ## Maintainer: the builder image digest `BUILDER_IMAGE` is pinned by digest in three files that must agree: `.forgejo/workflows/release.yml` (`RUST_IMAGE`), `scripts/verify-reproducible.sh`, and `scripts/build-release-local.sh`. When you bump it, the released hashes are expected to change — that is a toolchain change, not a compromise. Bump all three in one commit so a verifier never rebuilds with a different toolchain than CI shipped.