Duongöndro

Started October 2026 · Live on TestFlight (iOS) and GitHub Releases (Android)

An open-source, end-to-end encrypted meditation and ngöndro tracker for iOS and Android, with opt-in friend streaks and passkey-unlocked sync.

  • End-to-end encrypted
  • Passkey PRF unlock
  • Native iOS & Android
  • Open source
Role
Architecture, iOS & Android apps, Go backend, cryptography
Stack
  • SwiftUI
  • GRDB / SQLite
  • CryptoKit
  • Kotlin
  • Jetpack Compose
  • Go
  • Echo v5
  • PostgreSQL 18
  • sqlc
  • OpenAPI
  • WebAuthn / PRF
  • FreeBSD
Five Duongöndro screens in light and dark mode on Android, showing the Today screen with a 42-day streak, Dorje Sempa and Refuge (Prostrations) counters, and Settings. Demo data.

Prologue

In Tibetan Buddhism, ngöndro (Tib. སྔོན་འགྲོ, ‘that which goes first’) is a set of four foundational meditation practices. Each of those contains a part that is repeated: prostrations, a hundred-syllable mantra, a seven-point mandala of colored rice and semi-precious stones, or a seven-verse aspiration prayer to the guru. Each practice is traditionally repeated 111,111 times. At 300 repetitions every day, each practice takes about a year. At a more casual pace, the entirety of ngöndro can take several decades to conclude.

The primary bottleneck for a swift ngöndro practice is that an overwhelming majority of practitioners are human (a bummer innit) and, as such, subject to the vicissitudes of conditioned existence. Duongöndro constitutes a heroic endeavor to weaponize modern humans’ dopamine-seeking behavior against the very forces that keep us up scrolling TikToks at 4 AM on a Wednesday.

You may be familiar with the questionable owl mascot of The Most Overrated Language Learning App on the App Store™. I’ve personally seen people pull out their phones and repeatedly shout mundane phrases like We hebben een serieus probleem (or its equivalent in Amharic, Xhosa, Hmong, or whatever the hot new langue de jour might be) at the app, often in the most socially awkward situations. What, you may ask, would motivate an otherwise serious human being to perform such an act? ’Tis the streak mechanics. (Mind you, even many months into their streaks, I am yet to observe progress in their actual language skills.)

Duongöndro borrows a prefix from The Owl App™, but instead of AI-generated exercises and avian-borne threats, you get a way to track your ngöndro streaks with your friends. The app has been meticulously crafted in a Claude Opus 5.5–fueled frenzy to be tightly interwoven into the rich tapestry of our time-constrained earthly existence.

Duongöndro supports iOS 16 or later and Android 9 or later, covering most phones released in or after 2018. Both apps are fully native, built with SwiftUI and Jetpack Compose respectively. The apps can be used offline or synchronized between devices through a backend service written in Go and hosted on my US$5-a-month “side project graveyard” FreeBSD VPS on Vultr.

No personal details are collected by default: a user may choose to sign up with just a passkey, without entering so much as their email address. A user may optionally provide their email address, a display name, and a gender. All of these are encrypted at rest using XChaCha20-Poly1305, with a keyed HMAC blind index on the email address for lookups. The email address can be used in conjunction with a pre-generated recovery code to recover an account and its data encryption keys in case the user loses access to all of their passkeys. The gender is used to conjugate verbs in Slavic languages.

As of this writing, four users have signed up for Duongöndro Cloud Sync™, all of them Android users. At least one other person uses the TestFlight build in local mode. There is no member directory and no public feed. Users who already know each other from elsewhere may connect in the app using a Friendship Code™, distributed as a link or a QR code. The app may optionally notify your friends after each practice session, and a friend may poke you once a day if worried that you will succumb to the forces of saṃsāra.

How?

Local-first storage and streaks

Every sitting writes to SQLite on the phone first, using GRDB on iOS and SQLiteOpenHelper on Android. If you spend a week on retreat with no reception, nothing gets lost; turn on sync later and the phone marks existing rows dirty and uploads them. Supporting Android 9 ruled out INSERT ... ON CONFLICT DO UPDATE because Android 9 ships with SQLite 3.22, so the Android store runs an UPDATE first and inserts only if no row matched.

Sync uses PostgreSQL 18 transaction IDs (pg_snapshot_xmin) paired with a database generation ID. If the server is ever restored from a backup, the generation ID changes and clients automatically run a full resync instead of missing writes.

Streak math across time zones is full of edge cases: DST jumps, crossing the International Date Line, sessions logged at 1:30 AM that should count for the previous day, and manual count corrections that fix lifetime totals without inflating a streak. The rules live in one specification with a shared hand-computed test suite (streak-cases.json) run against Go, Swift (DuongondroCore), and Kotlin (:core), so all three compute the exact same answer.

End-to-end encryption and passkey unlock

Duongöndro extends the end-to-end encryption from CodeShare and closes a hole left open there: stopping a hijacked session or rogue server from slipping an attacker’s device into your account.

It splits device encryption from user identity across two curves. Each phone generates a non-exportable NIST P-256 key in hardware (Secure Enclave on iOS, StrongBox or TEE Keystore on Android) to receive ECDH-wrapped secrets. Because a hardware key cannot leave its chip, each user also gets a software Ed25519 identity key whose seed travels between phones inside those wraps. That identity key signs your device list, public streaks, invites, key wraps, and recovery boxes. Even if someone steals an email magic-link session, they cannot add their device to your signed device list or overwrite your recovery boxes.

Practice sessions (including deletions, which are written as tombstones) are padded to 256-byte multiples and encrypted on the phone with ChaCha20-Poly1305, binding the session ID, user ID, and key version into the AAD.

When moving to a new phone, passkey sign-in uses the WebAuthn PRF extension to unwrap an intermediate user key (U) directly on the device, which in turn unwraps your practice key and identity seed without typing a recovery code. The PRF output never leaves the phone (the server rejects any request containing prf.results), and the account’s Ed25519 public key is bound into the box’s AAD so the server cannot substitute a fake identity on a fresh device. If a password manager lacks PRF support, the word-based recovery code does the same job. Go, CryptoKit on iOS, and Tink on Android are all verified against the same byte-for-byte test vectors (vectors.json).

Backend and automated privacy guards

The server is a single Go binary behind Caddy on FreeBSD, with 51 HTTP routes generated as a strict Echo v5 server from an OpenAPI spec (oapi-codegen) and backed by PostgreSQL 18 (pgx, sqlc, embedded goose migrations). The same binary serves the static landing page and generates apple-app-site-association and assetlinks.json at runtime.

For the column-level XChaCha20-Poly1305 encryption mentioned above, each cell’s AAD binds the table name, column name, and row primary key so ciphertext cannot be transplanted across rows. Rather than trusting code review alone as tables grow, four tests enforce the privacy and GDPR rules against PostgreSQL’s information_schema:

  • TestEveryColumnIsClassified fails the build if a new text, bytea, or JSON column is neither encrypted, blind-indexed, nor explicitly whitelisted as plain.
  • TestDumpRevealsNoSealedPlaintext runs pg_dump on a populated test database and verifies zero plaintext values appear in the dump.
  • TestExportCoversEveryTable checks that GET /api/me/export covers every table in the schema.
  • TestPurgeLeavesNoTrace scans every UUID column after DELETE /api/me, while a hashed purge_log lets reapply-purges strip deleted accounts again if a backup is ever restored.

Friendship codes and push notifications

Friendship links use the format HTTPS://DUONGONDRO.APP/I/<id>#<secret> and expire after seven days. Keeping the secret in the URL fragment keeps it out of server logs while letting the recipient’s phone verify an HMAC over the inviter’s Ed25519 public key. Uppercase Crockford base32 and mixed-segment QR encoding (with Nayuki’s generator) pack the entire URL into a Version 3 (29×29) QR code that scans reliably in dim lighting.

Push notifications over APNs and FCM send only localization keys and arguments, never raw practice text. A discreet lock-screen setting can also replace practice names with “A friend practiced”.