What is Nostr?
NVK / DETERMINISTIC OPTIMISM NVK 🌞⚡️
npub1az9…m8y8
2025-03-07 11:57:22

NVK on Nostr: GM another DVM for People Discovery kind 5301 ...

GM another DVM for People Discovery kind 5301

Check out the People Discovery (kind 5301), done on the terminal because clients don't support it yet.

This DVM searches for pubkeys that another pubkey might want to follow based on its existing follows. If the "source" pubkey is not specified in the job input, the results are returned for the pubkey who signed the job request.

Example request:

```json
{
"content": "",
"kind": 5301,
"tags": [["p", "f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124"]]
}
```

Example using nak:

```shell
# create kind 5301 job request to get follow recommendations for the dataMachine pubkey, and send to a relay
EVENT=$(nak event -k 5301 --tag param="f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124;p" wss://relay.primal.net)

# extract event ID
EVENT_ID=$(jq -r '.id' <<< $EVENT)

# query relay for the response
nak req --stream -k 6301 --tag e="$EVENT_ID" wss://relay.primal.net | jq
```

## People Search (kind 5303)

This DVM searches for pubkeys by looking at the `name` and/or `display_name` fields in their profile metadata:

- It checks all profiles in our database, and calculates a similarity score based on the job input.
- To avoid returning spammy/scammy profiles, the similarity score is multplied by a ranking score derived from how many reputable profiles follow the matching profile.
- Given the input `jack`, there will be lots of perfect matches, but the first result will be Jack Dorsey's pubkey.

**Example request:**

```json
{
"content": "",
"kind": 5303,
"tags": [
["i", "jack", "text"],
["param", "max_results", "10"]
]
}
```

**Example using nak:**

```shell
# search for the dataMachine profile, add a typo on purpose
EVENT=$(nak event -k 5303 --tag i="datamchaine;text" wss://relay.primal.net)

# extract event ID
EVENT_ID=$(jq -r '.id' <<< $EVENT)

# query relay for the response
nak req --stream -k 6303 --tag e="$EVENT_ID" wss://relay.primal.net | jq
```
Author Public Key
npub1az9xj85cmxv8e9j9y80lvqp97crsqdu2fpu3srwthd99qfu9qsgstam8y8