SNIP-07: Geo-Location Context

⚡tephen

published

draft optional

This SNIP defines the standard for interacting with physical locations on Nostr. It introduces two event kinds: kind:31986 for reviews and kind:31987 for business claims.

Both events rely on Geohashes as the primary identifier, ensuring compatibility with SNIP-02 (Check-ins).

Business owners SHOULD choose a geohash precision appropriate for their venue size (typically 6-8 characters). Clients MAY implement their own logic for matching nearby geohashes and determining location proximity.

Part 1: Reviews (kind:31986)

Motivation

To create a censorship-resistant, decentralized reputation map that layers perfectly on top of check-in data. This allows users to leave persistent feedback on a location defined by a geohash.

Event Structure

This SNIP proposes kind:31986.

This kind is in the 30000-39999 range, designating it as a parameterized replaceable event according to NIP-01. The d tag MUST use the format <geohash>:<unix_timestamp> to allow multiple reviews per location by the same user.

Tags

  • d (required): Unique identifier in format <geohash>:<unix_timestamp>. Example: 9q8yyz:1765152000
  • geo (required): The geohash only (for indexing and map queries). Example: 9q8yyz
  • rating (required): A score tuple in the format ["rating", "<score>", "<max_score>"]. Score and max_score MUST be integers. The max_score SHOULD be 5 for consistency. Example: ["rating", "4", "5"]
  • l (optional): Labels or tags describing the venue. Example: ["l", "wifi"], ["l", "pizza"]
  • e (optional): A reference to a SNIP-02 Check-in event. This serves as Proof of Visitation. See "Integration with SNIP-02" below.
  • language (optional): ISO 639-1 language code. Example: ["language", "en"]

Content

The content field contains the text body of the review.

Integration with SNIP-02

Reviews can reference SNIP-02 check-in events using the e tag to provide proof of visitation. This creates a verifiable chain showing the reviewer was physically present at the location. When a review includes a check-in reference, clients MAY display a "Verified Visit" indicator to distinguish reviews from users who have demonstrably been to the location.

Example flow:

  1. User checks in at location (SNIP-02 kind:29238)
  2. User writes review and includes check-in event ID in e tag
  3. Clients can verify the check-in geohash matches the review geohash
  4. Review gains credibility as a verified visit

Privacy Warning

⚠️ Linking reviews to check-ins via the e tag creates a public, permanent record of your presence at a specific location and time. Consider the privacy implications before including check-in references.

Example Review

{  
  "kind": 31986,  
  "id": "e8d47265a88701831d1023730704764951152341951508200877983633630656",  
  "pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",  
  "created_at": 1765152000,  
  "tags": [  
    ["d", "9q8yyz:1765152000"],  
    ["geo", "9q8yyz"],  
    ["rating", "5", "5"],  
    ["l", "pizza"],
    ["l", "cheap_eats"],
    ["language", "en"],
    ["e", "<snip_02_checkin_event_id>"]  
  ],  
  "content": "Best slice in the city. The crust is thin and the sauce is tangy.",  
  "sig": "f07331ff1bdb2a2a4a07212acd164620bed557420cdc75bcd5485358050995f98345d922fbc2c885cc1f74d87cefea15c7cd9f5fc6fd71f08d4baf7c8e26b188"  
}

Aggregating Ratings

Clients SHOULD:

  • Only aggregate ratings with matching max_score values
  • Convert non-standard scales to 5-point scale: normalized = (score / max_score) * 5
  • Apply web-of-trust filtering to reduce sybil attacks
  • Weight reviews by author reputation (follows, WoT distance, historical activity)
  • Display edit indicators when reviews have been updated

Part 2: Business Claims (kind:31987)

Motivation

Allows business owners to claim a geohash, provide metadata (hours, website), and moderate the conversation around their venue.

Privacy Warning

⚠️ PUBLIC DATA ONLY: This event is intended for publicly accessible businesses (restaurants, parks, shops). DO NOT use this to claim private homes or residences.

Event Structure

This SNIP proposes kind:31987.

This kind is in the 30000-39999 range, designating it as a parameterized replaceable event. The d tag MUST be the geohash of the location.

Tags

  • d (required): The geohash
  • geo (required): The geohash (redundant for indexing)
  • name (required): The display name of the business (e.g., "Sal's Pizza")
  • about (optional): A short description of the venue
  • website (optional): The official URL. This is critical for NIP-05 domain verification
  • hours (optional): Opening hours in OSM-format (e.g., "Mo-Fr 10:00-22:00")
  • proof (optional): A URL to a verification image (e.g., a photo of the owner holding a sign with their NPUB)
  • language (optional): ISO 639-1 language code for name and about fields
  • p (optional): Used for Staff Delegation. Appending the marker "staff" designates other pubkeys who can manage the page. Example: ["p", "<pubkey>", "staff"]
  • list (optional): Used for Moderation. Points to a kind:10000 (Mute List). Clients SHOULD hide reviews from authors found in this list. Example: ["list", "<event_id>", "mute"]
  • claim_date (recommended): Unix timestamp when claim was first published. Example: ["claim_date", "1765155000"]

Staff Management

To revoke staff access, the business owner MUST publish an updated kind:31987 event with the staff member's p tag removed. Clients SHOULD only recognize staff privileges from the most recent claim event.

Verification Levels

Clients SHOULD display claims with the following verification indicators:

  1. Unverified (⚪): No external proof. Display as "Claim Pending"
  2. Domain Verified (✓): The pubkey has a NIP-05 identifier matching the website domain in the claim
  3. Proof Provided (📸): A proof image URL is included
  4. Community Vouched (⭐): The proof image or claim event has received zaps/reactions from high-reputation users in the local area

Handling Conflicting Claims

When multiple claims exist for the same geohash, clients SHOULD:

  1. Prioritize claims with higher verification levels
  2. For equal verification, prioritize the earliest claim_date
  3. Display all competing claims and let users report conflicts
  4. Consider implementing a dispute resolution process via community voting or trusted moderators

Claims older than 2 years without updates SHOULD be marked as "Stale" and deprioritized.

Sybil Attack Mitigation

Clients SHOULD implement one or more of the following:

  • Web-of-Trust filtering: Only show reviews from users within N degrees of separation
  • Proof-of-Work requirements: Require minimum difficulty for review events
  • Reputation scoring: Weight reviews by author's follower count, account age, and activity history
  • Time-based throttling: Limit review display to one per author per 24 hours per venue

Example Business Claim

{  
  "kind": 31987,  
  "id": "764951152341951508200877983633630656e8d47265a88701831d1023730704",  
  "pubkey": "<owner_pubkey>",  
  "created_at": 1765155000,  
  "tags": [  
    ["d", "9q8yyz"],  
    ["geo", "9q8yyz"],  
    ["name", "Sal's Pizza"],  
    ["about", "Family owned since 1985"],
    ["website", "https://salspizza.com"],  
    ["hours", "Mo-Fr 10:00-22:00; Sa-Su 12:00-24:00"],
    ["language", "en"],
    ["claim_date", "1765155000"],
    ["p", "<manager_pubkey>", "staff"],  
    ["list", "<mute_list_event_id>", "mute"]  
  ],  
  "content": "We serve the most authentic NY style pizza.",  
  "sig": "bed557420cdc75bcd5485358050995f98345d922fbc2c885cc1f74d87cefea15c7cd9f5fc6fd71f08d4baf7c8e26b188f07331ff1bdb2a2a4a07212acd164620"  
}  

Implementation Notes

Client Responsibilities

Clients implementing this SNIP SHOULD:

  • Cache verified claims to reduce relay load
  • Display edit timestamps and "edited" indicators for updated reviews
  • Allow users to report fraudulent claims or abusive reviews
  • Implement at least basic WoT filtering to reduce spam
  • Respect moderation lists from verified business claims
  • Provide clear UI for privacy implications of linking check-ins to reviews

Relay Considerations

Relays MAY:

  • Implement specialized indexes for geohash queries
  • Set rate limits on review publication per pubkey
  • Require proof-of-work for review events
  • Provide separate feeds for claimed vs. unclaimed locations

Discussion

Connect a key to comment.