nostr-protocol / nips

Nostr Implementation Possibilities
2.39k stars 582 forks source link

NIP-113: Activity Events #1423

Open ebrakke opened 3 months ago

ebrakke commented 3 months ago

This nip aims to define activity events on NOSTR. The goal is to enable developers to create applications like Strava or Garmin Connect.

Example protocotol implementation: https://github.com/ebrakke/nostr-activities-sdk

Example client implementation: https://github.com/ebrakke/nostr-ava https://nostrava.xyz

View the changes here

fiatjaf commented 3 months ago

Aside from the comments above this looks pretty good. Thank you for your work!

ebrakke commented 2 months ago

@pablof7z my intention with making it one generic summary event is that there are a ton of ways one could actually want their event or events summarized, and I figured it would be annoying to have to create a new kind for every single summary view.

The two I currently use in my client is 1) The summary stats that the JS library I'm using spits out for gpx files. It's useful for a lot of aerobic activities (like running and cycling), but wouldn't make much sense for an activity like surfing or paddleboarding. 2) geoJSON summary of the GPX file. Used to display a map of the activity.

My hope is that others create DVMs that can further summarize the activities. Meta summaries about groups of your activities, summaries about specific routes (like heatmaps). All useful things that strava does in their app.

So I wanted to leave it flexible at the protocol level to allow for these things. I guess the alternative would be reserving a range of types for summaries that could pop up?

Sebastix commented 3 weeks ago

@ebrakke Just checking in, are you still working on https://nostrava.xyz/ and this NIP? I have some plans to build a PoC (in https://github.com/nostrver-se/nuxstr) using your NIP proposal. As a fanatic Strava user / cyclist I really would like to have a Nostr native client for sharing my activities ;)

ebrakke commented 3 weeks ago

@Sebastix I haven't touched it in a little while. Been busy / other projects have pulled my interest, but I do plan on getting back to it at some point. Would love more input / POCs of this nip as well!

Sebastix commented 2 weeks ago

@ebrakke FYI while I'm fetching 30100 kind events (from my personal relay wss://nostr.sebastix.dev) I noticed this kind is also used by the Yakihonne client (or was used in the past), for example:

{
  "kind": 30100,
  "id": "2dc8fef6b470b6de26707b5af7abecea9a1bee4f12bb9069c52193cbda9cf3a6",
  "pubkey": "06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71",
  "created_at": 1698328201,
  "tags": [
    [
      "d",
      "MyFavoriteTopicsInYakihonne"
    ],
    [
      "t",
      "Webdevelopment"
    ],
    [
      "t",
      "Drupal"
    ],
    [
      "t",
      "PHP"
    ],
    [
      "t",
      "Nostr"
    ]
  ],
  "content": "",
  "sig": "7ac91fb2bad98a6ec31c04af0d33f81faf5eff7f80e43adcb101b6c1215fa65138ab05608fea5d332a4ebb9131badd1e2e63b7d014c87742dde139cb0bebbb7e"
}

The latest created 30100 event with this structure I could fine is from 1714230783 (2024-04-27) so my guess Yakihonne is not using this event kind anymore since that period.

vitorpamplona commented 2 weeks ago

We should consider renaming NIP-53 from "Live Activities" to "Live Event" or something similar to avoid confusion with this one.

Sebastix commented 2 weeks ago

@vitorpamplona These types of activity are always physical based, so I think it's even better also include that in the name in someway for this NIP. Like sport activities or physical activities.

Sebastix commented 2 weeks ago

@ebrakke Work in progress, this PoC: https://nostrver.se/nostrides

Sebastix commented 2 weeks ago

@ebrakke nostrava.xyz is giving me 308 http responses. Any chance to fix this? I would like to fetch the GPX files attached to the events which are stored on https://blossom.nostrava.xyz

ebrakke commented 2 weeks ago

@Sebastix the infrastructure that I was using I ended up repurposing for something else since nostrava.xyz wasn't getting used much. I can probably get it back up and running at some point, maybe this weekend.

nostrides looks sweet! Excited to see another alternative out there to strava.

ebrakke commented 1 week ago

@Sebastix I was doing some thinking on this nip and wondering if I was initially trying to do too much with the meta "summary" types. I made a pass to try to vastly simplify the NIP down to the essentials of what you would need for a strava alternative. One that could still evolve to encompass more functionality, but stays simple to implement. Curious your thoughts on something like this. https://github.com/ebrakke/nip113/blob/main/NIP.md