# Atomos Atomos is an adaptive, reactive, offline-first ATProto client for Android, iOS and the desktop. It reads and writes the same network as every other ATProto app, and treats that network as one network: an account can live on any instance, so the sign-in screen offers a few well-known ones and lets you type your own rather than assuming a single host. Atomos started as a fork of [Heron](https://github.com/tunjid/heron), and keeps Heron's architecture: Kotlin Multiplatform, Compose, Metro dependency injection, Mutator state production, treeNav navigation and the Tiler-paged timelines. On top of that it adds **W Social**, the ATProto instance run by W, and **W Identity**, the identity app W uses to sign people in without a password. The app is a work in progress, and is not affiliated with W, Bluesky or any other instance. ## Building The build needs JDK 21 and an Android SDK; Gradle is the wrapper. ```bash ./gradlew :androidApp:assembleDebug # Android ./gradlew :desktopApp:run # desktop ``` iOS builds from the `iosApp` Xcode project against the `composeApp` framework. Platform-specific setup (signing, push, publishing) is unchanged from Heron; the short version is that a debug build on Android or the desktop needs nothing beyond the SDK. ## W Social and W Identity W is an ordinary ATProto instance with an extra layer: a WID, issued by the W Identity app (`com.widentity.app`), which can sign a user in and which W treats as proof that the account is a verified person. Everything below was measured against production on 2026-10-19, on a phone and with plain HTTP calls; none of it is inferred from W's client bundle. ### Signing in with W Identity 1. The client starts a quick-login session on W's PDS: ``` POST https://pds.wsocial.network/xrpc/io.trustanchor.quicklogin.init {"allowCreate": true} -> {sessionId, sessionToken, qrCodeUrl, expiresAt} ``` `qrCodeUrl` is an image under `https://auth.widentity.eu/QR/`. The part after `/QR/` is a `tagsign:` link; it is that link, not the image, that asks W Identity to act. 2. W Identity reads the link, takes `Return` from its `?return=` parameter, and hands the flow to the contract orchestrator. It finishes by opening the return value with an `ACTION_VIEW` intent, so the return value has to be something the system can open: an `https` URL works, a custom scheme does not. 3. A custom scheme cannot carry the return, so the client runs a loopback server and returns `http://127.0.0.1:/callback`. That page sends the browser on to `atomos://widentity?…` with a ``, and offers a tappable link in case the refresh is refused. Script-driven redirects are refused by the browser; the meta refresh is not. 4. The user approves in W Identity and confirms with **biometrics**. Approval alone does not sign anything in: the session only advances after the fingerprint. 5. The client polls the same session while it waits: ``` POST https://pds.wsocial.network/xrpc/io.trustanchor.quicklogin.status {"sessionId": ..., "sessionToken": ...} -> {"status": "pending"} while waiting -> {"status": "completed", "result": {did, handle, accessJwt, refreshJwt}} when done ``` The account lives under `result`; the top level carries only `status` and `expiresAt`. 6. The two JWTs become an ordinary ATProto bearer session against W's PDS, and the W account is a first-class account afterwards: switchable, usable and indistinguishable from any other. Later re-authentication does not need the identity app. A signed-in W session can mint a re-auth token (`eu.wsocial.server.getReauthToken`, bearer, answering `{reauthJwt}`), and `eu.wsocial.quicklogin.silentReauth` trades that token for a new session with no user involved. A `400 InvalidToken` or `401 ExpiredToken` means the token is dead and the user must sign in again. ### Verification W publishes an account's verification as a label from its own labeler, so it can be read without any W session. Querying `com.atproto.label.queryLabels` on the labeler service for account DIDs returns `wsocial-personal` for a WID-verified human, and `wsocial-org`, `wsocial-service` or `wsocial-bot` for the other classes. That label is what the green ID mark in the client follows. The richer `eu.wsocial.actor.getVerificationDetails?did=` answers `{accountType, createdAt, widVerifiedAt, adminVerifiedAt}`, but it requires a bearer, so it is only reachable for an account the user is signed into W with. ### The hosts | Purpose | Host | |---|---| | PDS, `eu.wsocial.*` and `io.trustanchor.*` XRPCs | `https://pds.wsocial.network` | | QR code images, WID links | `https://auth.widentity.eu` | | Moderation labeler | `moderation.wsocial.eu` — `did:plc:am3r5ugi44s26fwouvel7mrz` | | Labeler service | `https://ozone.wsocial.cloud` | | Push | `https://push.wsocial.eu` | | Trends | `https://trend.wsocial.cloud` | The labeler lives at the labeler service host, not at the PDS. Trends authenticates with its own service token, separate from the user's session. ### Traps worth knowing - An `ACTION_VIEW` intent, not `resolveActivity`, is the only reliable way to test whether W Identity will take a link: package visibility makes the resolve return `null` even when the app is installed. Launch and catch the failure instead. - The app's own scheme is not a navigation route. Routing `atomos://` as a page produces "page not found"; the deep link has to be intercepted before navigation sees it. - Polling stops a couple of seconds after the app pauses, so the return to the app must be handled as a lifecycle resume; a pending session also has to outlive the recreation of the sign-in screen, which is why it is held outside the screen state. - `AuthMissing` from a W read means "sign in to W again", not "retry". ## Licence Apache 2.0, as inherited from Heron. See [LICENSE.txt](LICENSE.txt).