ABV Nexus home

>> Notes /

Luxel: sync where you hold the key

This note is about Luxel, the task app with a heatmap at its heart, and its optional sync between devices. Sync is built into the app and in testing, and arrives with the first Google Play release.

Offline first, sync optional

Luxel is complete without an account. Tasks, history and settings live in a database on the phone, and everyday use never waits for a server. Sync is a layer on top of that same database, for people who want their year on more than one device.

A key instead of an email

Luxel offers two ways to sign in for sync: a one-time code sent to your email, or a sync key account, which needs no email and no personal details.

  1. The app creates 16 random bytes and shows them as a key in the form LXL1-XXXX-XXXX-..., with a checksum so a typo is caught, and as a QR code.
  2. From that one key, the phone derives three separate values: an account id, a login secret and an encryption key.
  3. Only the account id and the login secret ever reach the server. The encryption key never leaves the phone.
  4. Every synced row is encrypted on the phone before it is uploaded. The server stores ciphertext.

On a new phone, scanning the QR code or typing the key derives the same three values, downloads everything and decrypts it.

The key uses an alphabet without the letters I, L, O and U, so it cannot be misread as 1 or 0 when copied from paper.

Each row bound to its place

Each encrypted row carries its table and row name as authenticated data. That means a row cannot be moved, swapped or tampered with on the server without decryption failing. A wrong key fails the same way, loudly, instead of producing garbage.

How changes merge

The sync engine treats each task, each day's completion and each setting as one row, identified by its table and key.

  • Last write wins per row. The newest change to a row is the one that stays.
  • Deletions travel as tombstones, small markers that say "this row was deleted at this time", so a deleted task does not come back from another phone.
  • Changes are found by timestamp, kept up to date by database triggers, so ticks made from a home-screen widget are captured too.

Ticking the same task on two phones on the same day writes the same row, so it never doubles up. Tests run two simulated phones against an in-memory server and check that they converge.

Some things never sync on purpose: Pro status comes from the app store, not from another device, and one-time prompts stay per phone.

The trade-off

There is no recovery. If the key is lost, the synced copy is gone, because nobody else can decrypt it. The data on the phone itself is unaffected, but a new phone cannot get it back.

That has to be stated plainly when someone chooses this account type. The other sign-in options remain for anyone who prefers a recoverable account. For the people who want it, a server that only stores what it cannot read is the strongest privacy promise I can make.