android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
# The in-process chain daemon (`cuprate-daemon`) in the APK
|
|
|
|
|
|
|
|
|
|
The wallet's third chain source — Cuprate's chain daemon running **inside the
|
|
|
|
|
OnionWire process** — is compiled into the Android build. This document is the
|
|
|
|
|
provenance record for that: how the feature is enabled, why the link line looks
|
|
|
|
|
the way it does, what CI checks, and what has *not* been proven.
|
|
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
Companion reading: [docs/WALLET.md](../docs/WALLET.md) ("The in-process chain
|
|
|
|
|
daemon") for what the daemon is, [docs/cuprate-android-spike.md](../docs/cuprate-android-spike.md)
|
|
|
|
|
for the cross-compile spike this plumbing comes from,
|
|
|
|
|
[MONERO_BINARIES.md](MONERO_BINARIES.md) for the `monero-wallet-rpc` executable
|
|
|
|
|
(still a child process — Cuprate has no wallet layer), and
|
|
|
|
|
[README.md](README.md#wallet-child-and-chain-sources-as-android-sees-them) for
|
|
|
|
|
how the Android wallet screen drives it.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
|
|
|
|
## What changed in the build
|
|
|
|
|
|
|
|
|
|
`android/sdk/build.gradle.kts`:
|
|
|
|
|
|
|
|
|
|
| | |
|
|
|
|
|
|---|---|
|
|
|
|
|
| Feature | `--features cuprate-daemon` on the **Android** build only |
|
|
|
|
|
| Where | `cargoBuildAndroid` (the `cargo ndk` cross-compile) |
|
|
|
|
|
| Not where | `cargoHostLib` / `uniffiBindgen` stay feature-free |
|
|
|
|
|
|
|
|
|
|
The host cdylib exists only so `uniffi-bindgen --library` can dlopen it. Building
|
|
|
|
|
the Cuprate graph there would add ~152 crates and a C++ RandomX build to every
|
|
|
|
|
build for a library that never runs the daemon, and the UniFFI surface does not
|
|
|
|
|
fork on a cargo feature (`ChainChoice.InProcessCuprate` is present either way, and
|
|
|
|
|
`WalletChildStatus` carries the same fields) — so the generated Kotlin bindings are
|
|
|
|
|
the same bytes.
|
|
|
|
|
|
|
|
|
|
`cargoBuildAndroid` prints the feature it is building with, so the CI log carries
|
|
|
|
|
the request rather than only the task name:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
cargo ndk build for arm64-v8a features=cuprate-daemon api=26 ndk=28.2.13676358
|
|
|
|
|
```
|
|
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
There is no `-P` knob that turns the feature off. A build that silently dropped
|
|
|
|
|
it would ship an APK whose on-device node can only fail; `android-ci.yml` greps
|
|
|
|
|
the artifact (below) so that is not only a log line.
|
|
|
|
|
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
## The link line
|
|
|
|
|
|
|
|
|
|
RandomX is C++ and its aarch64 JIT calls `__clear_cache`, and `randomx-rs`'s build
|
|
|
|
|
script emits `rustc-link-lib=static=stdc++` against the NDK's *stub*
|
|
|
|
|
`libstdc++.a`. Without libc++ and the compiler-rt builtins the link fails on
|
|
|
|
|
`__cxa_allocate_exception` / `std::runtime_error` / `typeinfo` / `__clear_cache`.
|
|
|
|
|
`cargo ndk --link-builtins` covers the builtins but not libc++, and
|
|
|
|
|
`-static-libstdc++` is ignored by NDK clang, so the full set is spelled out:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
-L$NDK/toolchains/llvm/prebuilt/<host>/sysroot/usr/lib/<triple>
|
|
|
|
|
-L$NDK/toolchains/llvm/prebuilt/<host>/lib/clang/<ver>/lib/linux
|
|
|
|
|
-lclang_rt.builtins-<abi>-android
|
|
|
|
|
-lc++_static
|
|
|
|
|
-lc++abi
|
|
|
|
|
-Wl,--exclude-libs,libc++_static.a
|
|
|
|
|
-Wl,--exclude-libs,libc++abi.a
|
|
|
|
|
```
|
|
|
|
|
|
2026-09-18 16:11:43 -04:00
|
|
|
Five more things the build has to get right, each of which fails as something
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
else:
|
|
|
|
|
|
|
|
|
|
1. **`ANDROID_NDK` must be exported**, not only `ANDROID_NDK_HOME` / `NDK_HOME`.
|
|
|
|
|
`cmake-rs` (RandomX's C++ half) aborts with *"Android: Neither the NDK or a
|
|
|
|
|
standalone toolchain was found"*, and `randomx-rs`'s build script then panics
|
|
|
|
|
inside `cmake`. The task exports all three.
|
|
|
|
|
2. **The linker is the NDK clang driver, named explicitly.** The dev machines'
|
|
|
|
|
`~/.cargo/config.toml` pins `[target.aarch64-linux-android] linker` to the
|
|
|
|
|
**API 21** wrapper, and API 21 fails this link (`pthread_atfork` is API 23+).
|
|
|
|
|
`cargo-ndk`'s own linker wrapper is bypassed so the `-Wl,…` args reach clang as
|
|
|
|
|
link args.
|
|
|
|
|
3. **The flags are `CARGO_TARGET_<TRIPLE>_RUSTFLAGS`, not `RUSTFLAGS`.** A global
|
|
|
|
|
rustflags would also apply to build scripts and proc macros, which are
|
|
|
|
|
**host**-targeted, where `-lc++_static` breaks the link. Setting the
|
|
|
|
|
per-target variable also *replaces* the `target.<triple>.rustflags` in
|
|
|
|
|
`~/.cargo/config.toml`, so the sysroot `-L` it carried is repeated in the list.
|
2026-09-18 16:01:17 -04:00
|
|
|
4. **The build image needs `cmake`.** RandomX is built by `randomx-rs`'s build
|
|
|
|
|
script through `cmake-rs`, and both Android workflows' `debian:bookworm`
|
|
|
|
|
containers install their own package list. Without `cmake` the build gets
|
|
|
|
|
~11 minutes in, compiles 400-odd crates, and then dies with a `randomx-rs`
|
|
|
|
|
build-script panic — *failed to execute command: No such file or directory …
|
|
|
|
|
is `cmake` not installed?* — surfacing as Gradle's "cargo finished with
|
|
|
|
|
non-zero exit value 101", which reads like a Rust error and is not one.
|
|
|
|
|
`android-ci.yml` and `android-release.yml` both install it.
|
2026-09-18 16:11:43 -04:00
|
|
|
5. **The Rust toolchain must be >= 1.93**, not the workspace MSRV of 1.91.
|
|
|
|
|
`tapes`, a Cuprate dependency this repo cannot patch, calls
|
|
|
|
|
`VecDeque::pop_front_if`, which is stable only from 1.93. On 1.91 the Android job
|
|
|
|
|
compiles ~400 crates and then dies with
|
|
|
|
|
`error[E0658]: use of unstable library feature 'vec_deque_pop_if'`.
|
|
|
|
|
`android-ci.yml` and `android-release.yml` pin `RUST_TOOLCHAIN: "1.98"` (the
|
|
|
|
|
stable release this graph is built and tested with); `ci.yml`, `release.yml` and
|
|
|
|
|
the `rust-version = "1.91"` MSRV are untouched, because the feature-off workspace
|
|
|
|
|
does not need the bump and moving the MSRV is a separate decision.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
`:sdk:preBuild` also runs `verifyDynamicLibc`: `libonionwire_sdk.so` must have
|
|
|
|
|
`libc.so` in `DT_NEEDED`. Linking the NDK's static `libc.a` instead null-derefs
|
|
|
|
|
inside `dlopen` on the first SDK call.
|
|
|
|
|
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
## What ends up in the APK
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
lib/arm64-v8a/libandroidx.graphics.path.so
|
|
|
|
|
lib/arm64-v8a/libjnidispatch.so
|
|
|
|
|
lib/arm64-v8a/libmonerowalletrpc.so
|
|
|
|
|
lib/arm64-v8a/libonionwire_sdk.so
|
|
|
|
|
lib/arm64-v8a/librandomx_rs-<hash>.so <- new, see below
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
`librandomx_rs-<hash>.so` is new and is **not a load-time dependency** of the SDK:
|
|
|
|
|
`readelf -d libonionwire_sdk.so` lists `liblog.so` and nothing else, and the
|
|
|
|
|
RandomX code is statically inside the SDK's own `.so` (its symbols and strings are
|
|
|
|
|
there). `cargo-ndk` copies every cdylib the target directory produced into
|
|
|
|
|
`jniLibs`, and `randomx-rs` also builds one. It is left in place rather than
|
2026-09-20 00:52:43 -04:00
|
|
|
filtered out: it is 1,122,296 bytes uncompressed / 387,996 deflated (sizes from
|
|
|
|
|
the feature-on CI run in the table below), and dropping it would be a packaging
|
|
|
|
|
rule that silently breaks the day something *does* link it.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
|
|
|
|
## The CI gate
|
|
|
|
|
|
|
|
|
|
`.forgejo/workflows/android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from
|
|
|
|
|
the built APK and greps it for `target_max_memory` — a rodata literal from
|
|
|
|
|
`src/cuprate.rs`'s config TOML, compiled only under
|
|
|
|
|
`#[cfg(feature = "cuprate-daemon")]`. The job **fails** if it is absent.
|
|
|
|
|
|
|
|
|
|
The negative control is v0.7.0's shipped APK: its `libonionwire_sdk.so` contains
|
|
|
|
|
**zero** occurrences of that string (and of `randomx` / `cuprated`), so a match
|
|
|
|
|
means the daemon is in the artifact, not merely requested. The build log line
|
|
|
|
|
above is the other half of the proof — request and artifact, separately checkable.
|
|
|
|
|
|
|
|
|
|
## What the wallet screen does with it
|
|
|
|
|
|
|
|
|
|
`ui/WalletScreen.kt` grew a third chain source beside the daemon field and
|
|
|
|
|
**Receive-only** (`ui/WalletChildStatusText.kt` holds the pure model):
|
|
|
|
|
|
|
|
|
|
* Selecting **On-device node (Cuprate)** stores `ChainChoice.InProcessCuprate` with
|
|
|
|
|
an **empty** `monerod_datadir`, which the SDK resolves to
|
2026-09-20 00:52:43 -04:00
|
|
|
`$ONIONWIRE_HOME/chain/{testnet,mainnet-pruned,mainnet-full}` from the stored
|
|
|
|
|
`mainnet` / `prune` flags — Kotlin never invents an absolute path.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
* `monero-wallet-rpc` is still required and still a subprocess: Start is gated on
|
|
|
|
|
the bundled binary exactly as before, and an in-process node does not bundle
|
2026-09-20 00:52:43 -04:00
|
|
|
`arti`, so a `.onion` daemon is still refused. Wallet RPC is loopback only.
|
|
|
|
|
Chain traffic stays off until the user opted into a wallet and chose a source.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
* The status line renders the core's words verbatim and grows a `node <word>`
|
|
|
|
|
segment from `WalletChildStatus.node_state` for this source only. An unrecognised
|
|
|
|
|
word is never rendered as ready.
|
android: show the chain daemon's sync height on the wallet status line
The SDK surface from the rust-dev parent (#129) carries `WalletChildStatus.height`
and `target_height` (Rust `u64` → generated Kotlin `ULong`), so the wallet status
line can say how far the chain daemon has got instead of only naming it.
* `WalletChildInput` mirrors both fields as `ULong` — checked against the
generated `uniffi.onionwire_sdk.WalletChildStatus`, not assumed. Defaults stay
`0uL` so every existing fixture is unchanged.
* `walletChildLine` appends ` · sync h/t` after the source and the `node` segment,
before the error em-dash, and only when either value is non-zero: `0/0` is
unknown (probe failed, daemon not up), not `0%`, and a zero target still prints
as `/0`. No percent, no progress bar, no ETA.
* `WalletScreen.toInput()` copies both fields field-for-field; the status row's
screen-reader sentence moved into `walletChildStatusDescription`, which carries
the same `sync h/t` the eye reads. One line, still no second widget.
* Tests cover the three sync cases plus the spoken row; the old exact-line
assertions (`off · receive-only`, `connecting · local node`,
`ready · remote onion daemon`) are untouched. `:app:testDebugUnitTest`: 114
tests, 0 failures.
* `android/CUPRATE_DAEMON.md` no longer claims the record has no height field.
2026-09-19 19:50:04 -04:00
|
|
|
* **The daemon's sync height is on the line.** `WalletChildStatus.height` /
|
|
|
|
|
`target_height` (Rust `u64` → UniFFI/Kotlin `ULong`) carry the blocks the chain
|
|
|
|
|
daemon had at the last probe — read from the wallet RPC, or, when that RPC is
|
|
|
|
|
refused (the 111 case) and the source is local/in-process, from the daemon over
|
|
|
|
|
loopback. The status line appends ` · sync h/t` after the source (and after the
|
|
|
|
|
`node` segment) whenever either is non-zero: `0/0` means the last probe failed
|
|
|
|
|
or the daemon is not up, so it is *unknown*, not `0%` — there is no percent, no
|
|
|
|
|
progress bar and no ETA anywhere in the UI, and a zero target still prints as
|
2026-09-20 00:52:43 -04:00
|
|
|
`/0` when height is non-zero. This is the **daemon's** chain height, not the
|
|
|
|
|
wallet's scan height. The same string is what the status row's screen-reader
|
|
|
|
|
`contentDescription` carries (`walletChildStatusDescription`), so the spoken row
|
|
|
|
|
is never shorter than the visible one. Cross-compiled and unit-tested on the
|
|
|
|
|
JVM; still not device-proven.
|
2026-09-20 00:54:57 -04:00
|
|
|
* **What writes that snapshot on Android.** The wallet screen's loop
|
|
|
|
|
(`WireViewModel.openWalletChild` → `walletChildRefreshLoop`) does one cached
|
|
|
|
|
`Wire.walletStatus()` paint, then every 2 s a live
|
|
|
|
|
`Wire.walletChildRefresh()` (`Wire::wallet_child_refresh`). The live call is
|
|
|
|
|
what makes height/target move between ticks; it never spawns. See
|
|
|
|
|
[README.md](README.md#what-the-apk-refresh-loop-actually-calls).
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
* **Storage honesty.** The card shows the free space on the filesystem the fjall
|
|
|
|
|
store grows into (`StatFs` on the app's data dir) and refuses Start below a
|
2026-09-20 00:52:43 -04:00
|
|
|
floor, or when that filesystem cannot be read at all. The floor is a *floor*,
|
|
|
|
|
not a sync estimate, and the doc comment says why: nothing in this stack
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
exposes one — `WalletChildStatus` has no size field, and Cuprate's restricted RPC
|
2026-09-20 00:52:43 -04:00
|
|
|
reports a hardcoded 5 GiB `database_size` placeholder. Floors in
|
|
|
|
|
`ui/WalletChildStatusText.kt`: 3 GiB testnet, 64 GiB mainnet-pruned, 280 GiB
|
|
|
|
|
mainnet-full.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
* **Pre-production warning**, above the Start button, in a sentence:
|
2026-09-20 00:52:43 -04:00
|
|
|
`CUPRATE_PREPRODUCTION_WARNING` — quoted user book, testnet-only / mainnet
|
|
|
|
|
unvalidated, and Cuprate issue #278, assertable in `WalletChildStatusTextTest`.
|
|
|
|
|
Opt-in, never a default.
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
2026-09-18 17:30:20 -04:00
|
|
|
## What it costs in CI
|
|
|
|
|
|
android-ci: echo the artifact digests and the deflated native-lib sizes
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.
Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
|
|
|
The Android job runs on the `docker-amd64` runner (it is **not** the Raspberry Pi
|
|
|
|
|
runner) with `CARGO_BUILD_JOBS=1` and a warm named volume at `/cargo-target`, so
|
|
|
|
|
the numbers below are one runner and one volume: `main` with the feature off, and
|
|
|
|
|
the feature on. There are two feature-on regimes, and the second is the one a PR
|
|
|
|
|
author feels — the first build after the feature lands compiles the whole cuprated
|
|
|
|
|
graph, every later build is incremental against the same volume.
|
|
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
These figures are the **recorded** costs from the runs that landed the feature
|
|
|
|
|
(not re-measured on `fa0e4b2`):
|
|
|
|
|
|
android-ci: echo the artifact digests and the deflated native-lib sizes
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.
Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
|
|
|
| | feature off — `main` 773dacb, run 402 | feature on — PR #113 head 3860c3d (merged as 8626da2), run 412 |
|
2026-09-18 17:30:20 -04:00
|
|
|
|---|---|---|
|
android-ci: echo the artifact digests and the deflated native-lib sizes
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.
Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
|
|
|
| Gradle | `BUILD SUCCESSFUL in 6m 10s` | `BUILD SUCCESSFUL in 7m 14s` |
|
|
|
|
|
| job | 8m 21s | 11m 12s |
|
|
|
|
|
| build step | 484 s | 653 s |
|
|
|
|
|
| `/cargo-target` | 3.1 G before the build | 5.6 G after (2.7 G of it `aarch64-linux-android/release`) |
|
2026-09-18 17:30:20 -04:00
|
|
|
| `libonionwire_sdk.so` in the APK | 33,533,264 B | 55,438,112 B |
|
|
|
|
|
| `librandomx_rs-<hash>.so` | absent | 1,122,296 B |
|
android-ci: echo the artifact digests and the deflated native-lib sizes
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.
Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
|
|
|
| APK | 28,038,401 B | 34,445,514 B |
|
|
|
|
|
| AAR | 10,377,416 B | 15,728,039 B |
|
|
|
|
|
|
|
|
|
|
The **first** feature-on build is the expensive one: run 406, against a volume that
|
|
|
|
|
did not yet hold the cuprated graph, took `BUILD SUCCESSFUL in 44m 7s` and a
|
|
|
|
|
47m 44s job — the ~152-crate graph plus the C++ RandomX cross-build, with a single
|
|
|
|
|
cargo job on the runner. After that it settles to roughly **+2 minutes over the
|
|
|
|
|
feature-off build** (7m 14s vs 6m 10s), because only this repo's own crates
|
|
|
|
|
recompile.
|
|
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
`android-ci.yml`'s job `timeout-minutes` is **120**; `android-release.yml`'s
|
|
|
|
|
Android job is **90**. Even the 44-minute first build fits both with room to
|
|
|
|
|
spare, and the volume grew to 5.6 G on a runner filesystem with 37 G free (the
|
|
|
|
|
`df -h` in the run log). The feature is **not** gated on a build variant, a label
|
|
|
|
|
or a manual dispatch — the release path builds exactly what CI verifies.
|
android-ci: echo the artifact digests and the deflated native-lib sizes
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.
Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
2026-09-18 17:51:11 -04:00
|
|
|
|
|
|
|
|
`android-ci.yml` prints `du -sh /cargo-target`, the length/method/deflated size of
|
|
|
|
|
every native lib, and both artifact digests, and the workflow echoes
|
|
|
|
|
`build_wall_clock_seconds`: the next person changing this graph reads the cost and
|
|
|
|
|
the artifact's identity out of the run log rather than re-deriving either.
|
2026-09-18 17:30:20 -04:00
|
|
|
|
2026-09-20 00:52:43 -04:00
|
|
|
## What has not been proven
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
|
|
|
|
The daemon was **not executed on a device or an emulator**. There is no
|
2026-09-20 00:52:43 -04:00
|
|
|
`arm64-v8a` AVD on the build host (the same gap [MONERO_BINARIES.md](MONERO_BINARIES.md)
|
|
|
|
|
records), and no aarch64 Android sysroot to run it under `qemu-user`. What is
|
|
|
|
|
proven: it cross-compiles and links against the NDK's C++ runtime, the feature is
|
|
|
|
|
in the shipped `.so`, the artifact packages, and the Kotlin that drives it
|
|
|
|
|
compiles and passes its unit tests. What is not:
|
|
|
|
|
|
|
|
|
|
* that `cuprated` starts, opens its fjall store and answers on loopback under
|
|
|
|
|
Android's runtime;
|
|
|
|
|
* **mainnet remains unvalidated.** Cuprate itself is pre-production and its own
|
|
|
|
|
user book says not to use `cuprated` for serious purposes. The Android screen
|
|
|
|
|
can store a mainnet-pruned or mainnet-full mode; that is not a claim this build
|
|
|
|
|
has run either. Core still surfaces `testnet only — mainnet is unvalidated`
|
|
|
|
|
(`cuprate::TESTNET_ONLY`);
|
|
|
|
|
* **a daemon that dies after the wallet child came up cannot be reported
|
|
|
|
|
`exited`.** The in-process node is a value this app owns, not a process with a
|
|
|
|
|
pid. The SDK derives `node_state` from the wallet-child state
|
|
|
|
|
(`crates/onionwire-sdk/src/lib.rs`, `node_state`). If the daemon dies after its
|
|
|
|
|
wallet child is up, the chain probe fails and the state stays `syncing`. It is
|
|
|
|
|
never reported `ready` from that failure. `exited` still means what it says:
|
|
|
|
|
the `monero-wallet-rpc` child is gone.
|
|
|
|
|
|
|
|
|
|
To close the device gap, on an arm64 device or a software-emulated arm64 AVD:
|
android: build the SDK with cuprate-daemon and offer the on-device node
Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the
wallet screen can pick it.
Build (android/sdk/build.gradle.kts)
- `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features
cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay
feature-free, because the host cdylib exists only so `uniffi-bindgen --library`
can dlopen it and the UniFFI surface does not fork on a cargo feature.
- The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is
C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub
`libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the
whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global
`RUSTFLAGS` would break the host build scripts. The linker is the NDK clang
driver at the app's API level, named explicitly, because the dev machines pin
the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link.
- `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it
`cmake-rs` aborts and `randomx-rs`'s build script panics.
- The task logs the feature it builds with, so CI carries the request, not just
the task name.
Wallet screen
- Third chain source, **On-device node (Cuprate)**, beside the daemon field and
Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty
`monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing
Save daemon / Receive-only / Start / Stop behaviour is unchanged.
- The status line grows `· node <word>` from `WalletChildStatus.node_state` for
this source only, fail-closed on an unrecognised word. No sync height: the SDK
exposes none, so the screen does not show a number it cannot get.
- Storage honesty: free space on the chain store's filesystem, and Start is
refused below a 3 GiB floor or when that filesystem cannot be read. The floor is
a floor, not a sync estimate — nothing here exposes one.
- The pre-production warning (quoted user book, testnet only, Cuprate issue #278)
is a sentence above Start, assertable in a test. Opt-in, never a default.
- The daemon field's hint no longer suggests a loopback daemon on the phone.
CI
- `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and
fails the job unless it contains `target_max_memory`, a rodata literal compiled
only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this
separates "in the artifact" from "requested".
Docs
- `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and
an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at
it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sdkmanager "system-images;android-35;google_apis;arm64-v8a"
|
|
|
|
|
avdmanager create avd -n ow-arm64 -k "system-images;android-35;google_apis;arm64-v8a"
|
|
|
|
|
emulator -avd ow-arm64 # software-emulated on an x86_64 host: slow
|
|
|
|
|
adb install -r dist/onionwire-<version>-android-arm64-v8a.apk
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
then unlock the node, open Wallet, tap **On-device node (Cuprate)**, read the
|
|
|
|
|
warning, press **Start wallet**, and watch the status line for
|
|
|
|
|
`connecting → syncing · in-process node · node starting → node syncing`. A wallet
|
|
|
|
|
balance needs the chain synced, which on a phone is a long wait — the status line
|
2026-09-20 00:54:57 -04:00
|
|
|
is the thing to watch, not the balance. After the first cached paint, the APK
|
|
|
|
|
loop probes live every 2 s, so `sync h/t` should move once the daemon answers.
|