Introducing The Habit: Sovereign Screen Time & Nostr Telemetry

Quantify your digital focus, anchor your app habits to Nostr, and cross-correlate screen time with bandwidth consumption, all with zero centralized telemetry.

Introducing The Habit: Sovereign Screen Time & Nostr Telemetry

Quantify your digital focus, anchor your app habits to Nostr, and cross-correlate screen time with bandwidth consumption, all with zero centralized telemetry.


🕒 1. The Need for Sovereign Screen Time

Most smartphone users are intimately familiar with Digital Wellbeing or Screen Time summaries. Every Sunday, our devices tell us how many hours we spent staring into glowing rectangles.

However, existing solutions share three major flaws:

  1. Centralized Silos: Your usage habits live behind proprietary cloud walls (Google, Apple, OEM services).
  2. No Data Portability: You cannot easily export, own, or cryptographic proof your digital minimalism or deep work streaks.
  3. Isolated Metrics: Screen duration is tracked completely separately from network consumption, battery drain, and personal device telemetry.

The Habit solves this by bridging native Android application usage directly to the Nostr protocol.


⚙️ 2. Architecture & The Protocol

The Habit runs a lightweight, persistent background service that queries Android’s UsageStatsManager once an hour to build an immutable, tamper-resistant log of your daily focus.

Event Specification (Kind 30345)

Data is published to Nostr as Parameterizable Replaceable Events (Kind 30345):

  • Kind: 30345 (Parameterized Replaceable Telemetry)
  • Tag: ["d", "YYYY-MM-DD"] (Clean date tag ensuring exactly one unique event per user, per day)
  • Content: NIP-44 encrypted JSON summary of app usage:
{
  "com.android.settings": {
    "id": "com.android.settings",
    "name": "Settings",
    "duration": "14m"
  },
  "com.google.android.youtube": {
    "id": "com.google.android.youtube",
    "name": "YouTube",
    "duration": "1h 15m"
  },
  "com.termux": {
    "id": "com.termux",
    "name": "Termux",
    "duration": "45m"
  }
}

⚡ 3. 2-Stage NIP-65 Micro-Relay Discovery

The Habit does not just broadcast blindly into public noise. It implements our 2-stage NIP-65 micro-relay discovery flow:

  1. First, it queries your NIP-65 (kind: 10002) outboxes to locate your active relay hubs.
  2. Next, it queries those hubs for your specialized Wellbeing Micro-Relay (kind: 10323) markers specifically targeting the "thehabit" micro-relay.
  3. If no markers are declared, it falls back seamlessly to your preferred default or self-hosted relays (wss://thehabit.scuba323.com/relay/).

🔗 4. The Killer Feature: Cross-App Correlation with Cell-ibacy

The true power of an open telemetry standard is interoperability.

Because both The Habit and Cell-ibacy index daily activity by packageName and ISO 8601 date, they automatically cross-correlate with each other:

When you open the Detailed Day Breakdown in either app:

  • In The Habit: You see your top applications ranked by screen time, with an instant badge showing how much Wi-Fi and Cellular bandwidth that application consumed on that exact day (e.g. YouTube: 1h 15m • 850 MB (750 MB Wi-Fi • 100 MB Cell)).
  • In Cell-ibacy: You see your data-hungry apps paired directly with their foreground Screen Time, making it effortless to identify background data hogs vs active media consumption!

🎨 5. Cyberpunk Glassmorphism UI & Instant History

Built from the ground up to match the Wellbeing 2.0 design standard:

  • Ambient Glowing Canvas: Edge-to-edge system window inset rendering over deep space violet gradients.
  • Hero Screen Time Tracker: Massive real-time clock readout with hourly sync status.
  • 7-Day Paginated History: Interactive archive with breakdown stats (Total Screen Time, Daily Average, Peak Day).
  • Zero-Latency Past Caching: Historical records (date < today) are cached to disk so opening history is instantaneous, while today’s active focus metrics stay live.
  • 1-Click d-Tag Migration: Includes built-in legacy tag scanning and one-click re-signing in Settings, automatically disabling once all records conform to the clean YYYY-MM-DD specification.

📜 6. Open Source & Unlicense

The Habit is 100% Free and Open Source software licensed under The Unlicense / Public Domain:


Write a comment