Add NIP-101e: Workout Events#1816
Conversation
|
I'm working on a run tracking app on Nostr and love the NIP-101e proposal. I'd like to suggest some additional running-specific extensions that would enhance the proposal's utility for cardio activities while maintaining compatibility with the established framework. Suggested Additions to NIP-101e for Running ActivitiesRunning Exercise TemplateFor running activities, I suggest a standardized exercise template format: {
"kind": 33401,
"content": "Easy pace run on flat terrain. Focus on maintaining consistent effort.",
"tags": [
["d", "<UUID>"],
["title", "Easy Run"],
["format", "distance", "duration", "pace", "gps_data", "elevation_gain"],
["format_units", "km", "seconds", "min/km", "polyline", "m"],
["equipment", "cardio"],
["difficulty", "beginner"],
["t", "running"],
["t", "cardio"]
]
}Running-Specific Workout RecordRun tracking records could then be represented as: {
"kind": 1301,
"content": "Morning run felt great. Perfect weather conditions.",
"tags": [
["d", "<UUID>"],
["title", "Morning 5K"],
["type", "cardio"],
["start", "1706454000"],
["end", "1706455800"],
["exercise", "33401:<pubkey>:<UUID-running>", "<relay-url>", "5", "1800", "4:52", "encoded_polyline_string", "125"],
["cadence_avg", "172", "spm"],
["heart_rate_avg", "142", "bpm"],
["weather_temp", "18", "c"],
["weather_humidity", "65", "%"],
["weather_condition", "partly_cloudy"],
["completed", "true"],
["t", "running"]
]
}Split DataFor analyzing portions of runs: {
"kind": 1301,
"tags": [
["split", "1", "1000", "m", "3:45", "155", "bpm"],
["split", "2", "1000", "m", "3:52", "158", "bpm"]
]
}These additions would enhance the practical utility of NIP-101e for run tracking applications while maintaining compatibility with the core structure of the original proposal. They extend the "Additional parameters" flexibility mentioned in the NIP while providing standardized tags for the running-specific metrics that matter most to runners. |
|
We need this for other GPX based activities too, like cycling See #1423 |
|
@erskingardner had some ideas for storing gpx data on blossom servers that we can then reference in the workout record event |
|
@Sebastix How do Activity events and Work outs fit together then? Can we just implement work-outs in Zpachat / Cahchi and get Activities for free? |
|
@NielLiesmons Good question, let me take some time to think more deeply on this. To me workouts are an activity event type so if you implement activity events correctly you get all types for free (in theory). Here are some activity types from the more famous platforms. Strava (https://support.strava.com/hc/en-us/articles/216919407-Supported-Sport-Types-on-Strava) Cycle Sports Water Sports Winter Sports Other Sports: Whoop (https://support.whoop.com/s/article/List-of-WHOOP-Activities?language=en_US) Komoot (https://support.komoot.com/hc/en-us/articles/360024733031-Sport-types-on-komoot) |
|
Ah ok, so in the opposite sense. Gotcha! |
|
I want to use NIP101e for building fitness communities and events. Would it be alright to add new kinds to the NIP for challenges, teams, and events. I'd want to include optional tags in kind 1301 to help filter. Enhanced NIP-101e: Building Fitness Communities on NostrCore ArchitectureThree-Tier System:
New Event Kinds for Community FeaturesKind 33403 - Fitness Challenge {
"kind": 33403,
"content": "Complete 100 miles of running in 30 days. All paces welcome!",
"tags": [
["d", "<challenge-uuid>"],
["name", "100 Mile Challenge"],
["start", "1706454000"],
["end", "1709046000"],
["goal_type", "distance_total"],
["goal_value", "100", "miles"],
["activity_types", "running", "walking"],
["rules", "GPS verification required"],
["public", "true"],
["t", "challenge"],
["t", "running"]
]
}Kind 33404 - Fitness Team {
"kind": 33404,
"content": "A community of runners training together for marathons",
"tags": [
["d", "<team-uuid>"],
["name", "Marathon Training Squad"],
["type", "running_club"],
["location", "New York, NY"],
["captain", "<pubkey>"],
["member", "<pubkey1>"],
["member", "<pubkey2>"],
["public", "true"],
["t", "team"],
["t", "running"]
]
}Kind 33405 - Fitness Event {
"kind": 33405,
"content": "Annual 5K charity run through Central Park",
"tags": [
["d", "<event-uuid>"],
["name", "Central Park 5K"],
["date", "1709046000"],
["location", "Central Park, NYC"],
["distance", "5", "km"],
["registration_deadline", "1708700000"],
["max_participants", "500"],
["t", "event"],
["t", "race"]
]
}Linking SystemEnhanced Kind 1301 with Community Links: {
"kind": 1301,
"content": "Great team run today! Feeling strong for the upcoming race.",
"tags": [
["d", "<workout-uuid>"],
["title", "Team Training Run"],
["exercise", "33401:<pubkey>:<exercise-uuid>", "<relay>", "10", "3600", "6:00"],
// Community connections
["challenge", "33403:<pubkey>:<challenge-uuid>", "<relay>"],
["team", "33404:<pubkey>:<team-uuid>", "<relay>"],
["event", "33405:<pubkey>:<event-uuid>", "<relay>"],
// Data quality
["accuracy", "exact", "gps_watch"],
["client", "NostrFit", "v1.0.0"],
// Verification
["gps_polyline", "<encoded_data>"],
["device", "Garmin Forerunner 945"]
]
}Smart Aggregation TagsProgress Tracking: ["challenge_progress", "<challenge-id>", "45.5", "miles", "45.5%"]
["team_contribution", "<team-id>", "10", "km", "weekly"]Discovery and FilteringREQ Filter Examples: // Find all workouts for a specific team
{
"kinds": [1301],
"tags": {
"team": ["33404:<pubkey>:<team-uuid>"]
}
}
// Find all active challenges
{
"kinds": [33403],
"tags": {
"end": [">", "<current_timestamp>"]
}
}
// Find workouts contributing to a challenge
{
"kinds": [1301],
"tags": {
"challenge": ["33403:<pubkey>:<challenge-uuid>"]
}
}Implementation Benefits
Privacy Considerations
This structure creates a complete ecosystem for fitness communities while maintaining the decentralized nature of Nostr and building on the solid foundation of NIP-101e. |
NIP-101e: Workout Events
This NIP proposes a standardized way to represent fitness and workout data in Nostr, including:
The format provides structured data for fitness tracking while following Nostr conventions for data representation.
Rationale
Many fitness applications use proprietary formats, locking user data into specific platforms. This NIP enables decentralized fitness tracking, allowing users to control their workout data and history while facilitating social sharing and integration between fitness applications.