Open earonesty opened 1 year ago
Could NIP 89 work for relay recommendations that clients can use, as well as client recommendations that users can use?
yes, of course, the client should also include a set of relays on the request and the advertisement should have relays as well. but this is not a client reco. it's an RPC service. like an AI or search engine. hopefully, by standardizing on RPC, and supporting gift-wrap we can prevent a plethora of NIP's around custom use cases. It's all just "RPC".
And as to "why on nostr", the answer is "nostr has state, is censorship resistant, and the provider doesn't need to operate a 'server'"
Suppose i want to build a search engine or ai engine on nostr. First, I index every note I can find, with the origin relay, and the keywords, and a some summary content (prunable).
Then I hang up a shingle "post your search requests to me!"
I accept NIP-59 structured encrypted requests (KIND 10444 Search) I reply with NIP-59 structured encrypted responses (KIND 10445 Search Response) Gift-wrap is a good way of standardizing for any NOSTR RPC.
But what does "hang up a shingle" mean? This is like NIP-28 - chat room. But for services.
Can be a very simple thing:
RPC Service Advertisement
Event Kind: 9121
Payments sent to the OPTIONAL LNURL MUST contain the RPC request event-id in the metadata.
Client events SHOULD be sent as encrypted gift-wrapped events of kind 1059 to the pubkey of the advertiser.
Content of your event should contain JSON formatted as requested:
Content of your response MUST contain JSON formatted as advertised, or be empty.
Tags on the response MUST contain the event id of the request, and MUST go to the requestor's NIP-65 recommended relays for responses.
Expiration should be obeyed on both the request and the response.
Responses should also be NIP-59 gift wrapped.
Errors can be sent in a tag with empty content, so there's no ambiguity
This will hopefully prevent lots of new NIPs from being needed for all the kinds of services built on NOSTR.