๐ŸŽฏ Goal

Only relay or mark content that has been endorsed by a human via a zap (Nostr event kind:9735).

๐Ÿ—๏ธ Architecture Overview

Nostr Event --> Relay Pre-Processor
           |
           โ”œโ”€ Check if event has a corresponding zap (kind:9735)
           |    โ”œโ”€ If yes โ†’ Relay and optionally mark on-chain
           |    โ””โ”€ If no  โ†’ Drop or queue event, awaiting a zap
           |
           โ””โ”€ Store event and its zap linkage (via 'e' tag) in a cache

Implementation Steps

1. Parse Incoming Event

When a standard note event (kind:1) arrives at the relay:

2. Scan for Corresponding Zap Events

Continuously or on-demand, the system must scan for zap events (kind:9735) that reference pending notes:

// Example Zap Event Structure
{
  "kind": 9735,
  "tags": [
    ["e", ""],
    ["p", ""],
    ["relays", "wss://..."]
  ],
  ...
}

3. Associate Zaps to Original Events

Maintain a simple, fast-lookup map to validate events:

This map is used to make a filtering decision:

4. Expose Zap Info in Event Pipeline

Before writing an event to the blockchain or relaying it, perform a final check:

5. Optional User Experience Tools

On front-end clients like xmark.cc or linkmark.xyz, you could display the status of a post:

๐Ÿงช Testing Protocol

  1. Inject a known kind:1 event into the system. Verify it is placed in the pending queue.
  2. Send a valid kind:9735 event that zaps the event from Step 1.
  3. Ensure the original event is released from the queue and successfully passes through the filter only *after* the zap is processed.