change app icon

This commit is contained in:
agent 2026-09-13 21:23:27 -04:00
commit 7ad3679b51
No known key found for this signature in database
5 changed files with 405 additions and 1 deletions

View file

@ -0,0 +1,73 @@
# Recommendation: Option A — bundle the `arti` binary as a SOCKS subprocess
## What Option A is
Run the `arti` CLI (not `arti-client`) as a child process doing `arti proxy -p <port>`. The wallet child points `--proxy 127.0.0.1:<port>` at it. The messenger continues using in-process `arti-client`. Two Tor clients in one app: one in-process for the messenger, one subprocess for SOCKS.
This is the path the arti project itself points to for interop with external processes, and it is the known quantity. It answers the Android wallet question with the least custom code.
## What makes it attractive
- **No custom SOCKS server.** You do not write a SOCKS5 accept-loop, byte bridge, DNS-leak handling, stream lifecycle, or error handling. The arti binary already does all of that.
- **Wallet child just works.** `monero-wallet-rpc --proxy 127.0.0.1:<socks-port>` speaks plain SOCKS5. It does not need to know anything about Arti. This is the shape the wallet binary was built for.
- **Smallest diff to the messenger code.** The in-process `arti-client` used for chat does not change. You add one child-process manager for the SOCKS proxy and one config knob for the wallet child's `--proxy` target. No change to the Noise/identity/store paths.
## The auth gap
This is the real trade-off and the reason the recommendation is not unconditional.
The app's `--password` enforcement lives in the in-process `arti-client` path: the messenger dials friends' onions through Arti, and the wallet child reaches a remote `.onion` monerod through the SOCKS proxy. With Option A, the SOCKS listener is a separate process on a localhost port. Any local process that can connect to `127.0.0.1:<socks-port>` can use it — including a wallet child that was started without the app's credentials, or any other local code.
Concretely: if the wallet child is the only local consumer of the SOCKS port, the gap is small. If the app ever runs other local processes, or if the wallet child can be started by something other than the app, the SOCKS port is an open Tor exit for anything on the device.
This is not a Tor anonymity failure in the usual sense — the SOCKS port is localhost, not a clearnet bridge. But it is an authorization gap: the app's `--password` gate does not cover traffic that enters Tor through the child's SOCKS port, because that traffic never passes through the app's Arti client.
## How to reduce the gap without abandoning Option A
The cleanest mitigation is to make the SOCKS port access-controlled at the process boundary, not at the Tor boundary:
1. **Bind the SOCKS listener to a Unix domain socket, not TCP.** If `arti proxy` can listen on a Unix socket, only processes that can open that socket can use it. On Android that path lives in app-private storage, so it is gated by the app sandbox. This is the strongest local control and removes the TCP localhost exposure entirely. Verify `arti proxy` supports a Unix socket listen target before committing; if it does not, this mitigation is unavailable and you are back to TCP localhost.
2. **If TCP is the only option, bind to `127.0.0.1` only and treat the port as app-private.** Do not expose it on `0.0.0.0` or a LAN address. Document that the port is a local Tor entry point for the wallet child only, and that any other local process with user-level access can use it. This is honest, not a fix.
3. **Gate the wallet child's start on the same credential material the app already owns.** If the app requires `--password` / a wallet passphrase / a host identity before it will start the wallet child, then the only process that can reach the SOCKS port is one the app launched. That is not a technical block on a hostile local process that somehow gets on the box, but it means the normal path is closed unless the user already authenticated to the app.
4. **Keep the two Tor clients' state separated unless you have verified sharing is safe.** If you point the subprocess `arti` at the same state dir as the in-process client, confirm upstream whether that is supported and what the failure modes are. If it is not safe, run them with separate state and accept that they do not share circuits or cached data. Do not silently share state on the assumption that it works.
## What the wallet child's connection looks like under Option A
```
Android app process
├── in-process arti-client → friend onions (messenger)
└── arti proxy subprocess → SOCKS5 on 127.0.0.1:<port> (Unix socket if supported)
└── monero-wallet-rpc child --proxy 127.0.0.1:<port>
└── ( 양파 ) remote .onion monerod :18089
```
Wallet RPC itself stays loopback-local between the app and the wallet child. Only the chain traffic — the wallet child's `--daemon-address` connection to the remote `.onion` monerod — goes through the SOCKS proxy. That matches the existing rule: wallet RPC is loopback, chain traffic is Tor. The SOCKS proxy is the Tor entry point for the wallet child's chain connection.
## What to verify before committing to Option A
1. **Does `arti proxy` support a Unix domain socket listen target?** If yes, use it. If no, you are stuck with TCP localhost and the auth gap is real and must be documented.
2. **State sharing between the in-process client and the subprocess.** Can they safely share a state dir, or must they have separate state? This affects disk use, startup time, and whether the SOCKS proxy can reuse circuits the messenger already built.
3. **`monero-wallet-rpc --proxy` behavior.** Confirm the wallet child speaks SOCKS5 (not HTTP proxy), honors `--proxy` for its daemon connection, and does not do local DNS on the `.onion` target. The traffic is already a Tor address, so DNS is less of a leak than with a DNS name, but verify the handshake does not pre-resolve.
4. **Child lifecycle on Android.** The SOCKS proxy and the wallet child are both long-running subprocesses. Android can kill them under memory pressure, during Doze, or when the app is backgrounded. Confirm the app restarts them on resume and that the wallet child reconnects to its daemon after a kill. This is the same lifecycle problem the messenger already has with in-process Arti, but now multiplied by two children.
5. **APK size impact.** Bundling `arti` as a binary per ABI is additional APK weight. Quantify it before committing. If the binary is large and the SOCKS path is the only reason for it, that is a real cost against a feature that most users will not exercise (most will use receive-only or a remote wallet host, not a local chain connection through SOCKS).
## When Option A is the right call
Option A is right when:
- You want the wallet child to reach a remote `.onion` monerod and you do not want to write a SOCKS server.
- You accept that the SOCKS port is a localhost Tor entry point and you either control access via a Unix socket or document the TCP-localhost reality.
- You are willing to bundle `arti` as a subprocess binary and manage its lifecycle on Android.
- The alternative — writing a SOCKS5 bridge on top of in-process `arti-client` — is more code than you want to own, or the bridge's DNS/circuit/stream handling is not worth the maintenance.
## When to reconsider
Reconsider toward Option B if:
- `arti proxy` cannot listen on a Unix socket and you are unwilling to accept an open TCP localhost SOCKS port as the authorization model.
- Bundling `arti` as a binary is too heavy for the APK and the SOCKS path is not core enough to pay for it.
- You want a single Tor client and a single state dir, and you are willing to own the SOCKS bridge code to get there.
## Bottom line
Option A is the pragmatic choice: it uses the real arti SOCKS proxy, requires the least custom code, and matches the shape the wallet child expects. The cost is a second Tor client and an authorization gap on the SOCKS port, which is best closed with a Unix domain socket listen if `arti proxy` supports it, and otherwise documented honestly as a localhost-only Tor entry point gated by the app's own process launch policy.