Skip to content

reset the DVM spec #1903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

reset the DVM spec #1903

wants to merge 2 commits into from

Conversation

fiatjaf
Copy link
Member

@fiatjaf fiatjaf commented May 1, 2025

No description provided.

@vitorpamplona
Copy link
Collaborator

Never delete, just deprecate.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 1, 2025

This NIP doesn't specify anything, so what am I deleting?

None of the events supposedly covered by the NIP are even following their own spec anyway, so who cares?

@alexgleason
Copy link
Member

What is your thinking?

When I first saw the DVM spec I thought it was atrocious. Then I settled into the reality, and recently I have been planning to build something kind of big with it even though it's ugly.

Are you looking to rework the whole request->feedback->response flow, or to improve the data model, or what?

@fiatjaf
Copy link
Member Author

fiatjaf commented May 1, 2025

My thinking is that the current spec isn't helping anyone. If you want to do something pick some kinds and do it in a way that you think makes sense. If more people implement it and it makes sense we write down the spec here -- or in another NIP, it depends, I don't know.

I believe sometimes we don't need the "request" part (for example, a translator bot may react to every note under certain conditions, you don't need to call it manually, or a "trending feed" may be published every x minutes, without anyone asking for it);

Other times we don't need the "response" -- or the respons may be a kind that already exists, doesn't have to be a new special kind (for example, my unfinished DVM that creates WARC files of webpages and saves them to Blossom, or that thing that downloads videos from YouTube and publishes them as a kind:22, or the DVM I have running -- which wasn't called a DVM before because it didn't fit the requirements here but under a more flexible definition it is -- that creates opentimestamps events of every note published to my relay);

Other times we don't need a request nor a response, and so on.

Also, forcing all these DVMs to adhere to a certain tag format that includes "input", "output", "param" etc doesn't help anything. I learned that when I tried to build a nak dvm command and learned that the specs were all misaligned and couldn't really be read programmatically, but also -- what does an input that is an event id has to do with an input that is a URL or an input that is a freeform string? You'll have to write custom code for each DVM anyway, so let's at least make them in a way that makes sense. Even the Vertex DVM has nak event examples teaching you on how to call it -- this would work regardless of a unified DVM spec (not to mention the fact that the Vertex DVM doesn't follow the canonical DVM spec that I'm trying to get rid of anyway).

@mikedilger
Copy link
Contributor

I am in favor of separately documenting each service that is to be open and implemented by multiple pieces of software, and that they don't have to be doing it in this DVM spec way which I concur didn't really bring about uniformity.

But I'm also not sure how DVMs are better than REST APIs that use nostr auth, and can offer their own custom ways of payment as DVMs already have to (AFAIK).

My opinion means little however because I've not done any DVM coding and I don't intend to.

@dtdannen
Copy link

dtdannen commented May 2, 2025

"You'll have to write custom code for each DVM anyway" - that's not what we're seeing, especially with kinds 5300, the first big use case of DVMs. DVMs can have custom specs but they converge around kinds.

Have you seen https://stats.dvmdash.live/kind-stats ?

@dtdannen
Copy link

dtdannen commented May 2, 2025

Reasons why we should keep the DVM spec and reject this PR:

  • Reserving kinds 5000-7000 is extremely helpful to avoid cluttering the kind space. 20-30 of these are being used or actively developed as can be tracked here: https://stats.dvmdash.live/kind-stats, and many people are planning to add new DVMs under new kinds in this range.
  • this PR is removing kind 5300 which is a major feature supported by many nostr clients right now - algorithmic feeds, supported by: Amethyst, Primal, Coracle, Nostrudel, Noogle, if not more
  • "My thinking is that the current spec isn't helping anyone." - this is not true. we have many DVMs running that people are using, see https://stats.dvmdash.live/dvm-stats
  • "If you want to do something pick some kinds and do it in a way that you think makes sense." - yes, the existing spec supports this. It includes a whole section:

Notes about the protocol flow

The flow is deliberately ambiguous, allowing vast flexibility for the interaction between customers and service providers so that service providers can model their behavior based on their own decisions/perceptions of risk.

Some service providers might choose to submit a payment-required as the first reaction before sending a processing or before delivering results, some might choose to serve partial results for the job (e.g. a sample), send a payment-required to deliver the rest of the results, and some service providers might choose to assess likelihood of payment based on an npub's past behavior and thus serve the job results before requesting payment for the best possible UX.

It's not up to this NIP to define how individual vending machines should choose to run their business."

  • yes, it is easy to envision some DVMs not needing the response part or the request part - DVMs will function just fine without that. This is such a minor issue, and it's per KIND. For example, DVMDash already tracks requests and responses, and clients interacting with DVMs can just look for requests only or responses only. This is an easy update to the DVM spec. It is a terrible reason to remove the entire spec
  • "Also, forcing all these DVMs to adhere to a certain tag format that includes "input", "output", "param" etc doesn't help anything" - let's just amend the spec then? See above the section on the flow being optional.
  • In reality, for any DVM kind that is not super early (i.e. has a few DVMs using that kind) when you say this "You'll have to write custom code for each DVM anyway, so let's at least make them in a way that makes sense", it is actually true that you have to write custom code FOR EACH KIND - which is fine. The spec mentions each DVM / Kind can have it's own flow.

Why the DVM spec is good as it is:

  • keeps kinds 5000-7000 reserved for computational services
  • is flexible in allowing DVMs to operate how they need to

TL;DR

  • the complaints above could be easily solved with some minor updates to the existing spec; deleting the spec will only create massive confusion for new DVM devs and more than 1000 existing users and DVM runners

@aljazceru
Copy link

aljazceru commented May 2, 2025

as @dtdannen pointed about above I don't think throwing the baby out with the bath water is the right approach.

Is DVM spec far from the greatest thing on earth? Yes, noone disagrees there. But there is a non trivial amount of work, clients and dvms out there following it (to various degrees of success) so just abandoning everything doesn't really accomplish anything since it is out there, it is being used etc.

Given the fact that there is a decent amount of momentum with DVMs now (dvmcp, vertex, various feeds etc) it would make sense to improve on the spec or create a v2, not throw it away on a whim. There is a decent amount of people who have put effort into developing things around it that likely wouldn't want their efforts go to waste.

also @vitorpamplona has a point:

Never delete, just deprecate.

there are things in the wild following this spec, lets take this opportunity to not make more of a mess in the nostr ecosystem but instead improve the protocol governance

@believethehype
Copy link
Contributor

Every attempt in improving the spec got stalled in the PRs. At some Point, at least I stopped trying for that reason. Its wild that now you want to delete something that is used every day by a lot of people. At least for the content feeds, multiple people somehow managed to follow a spec that allegedly is not there. Just removing it without an alternative is not the way.

@melvincarvalho
Copy link

Agree with @fiatjaf

The core issue with DVMs is they try to be all things to all people, and that’s confusing devs. Every time a machine-to-machine use case comes up, the answer is “just use DVMs” — you had one problem. Now you have two problems.

They’ve grown so broad they probably don’t belong in NIPs. And in reality, they already have their own site, spec, and PR process. I found with did-nostr that sometimes it’s better to decouple like this than keep tweaking NIPs. So while I’m not usually for deletion, this path might actually be healthier for both DVMs and nostr.

@gzuuus
Copy link
Contributor

gzuuus commented May 2, 2025

Im going to be pragmatic here and write a starting point for a rewrite of this spec, from there we can shape it if we find it valuable, if not someone else would have to propose a different rewrite and so on until we find the spot.

@vitorpamplona
Copy link
Collaborator

vitorpamplona commented May 2, 2025

I agree that DVMs are too generic.

But we don't need to delete this. Turn this one into deprecated guidance and let's start working on new NIPs that can replace it. It is a similar process that we navigated from NIP-94 to Picture, Long Video, and Short Video kinds, NIP-04 to NIP-44, NIP-59 and then NIP-17.

Specialization in NIPs is good.

But, we shouldn't rug pull existing devs by changing the definition of the NIP by this much.

At the end of the transition, no DVM should implement NIP-90. They will all have their own NIPs to reference.

@gzuuus
Copy link
Contributor

gzuuus commented May 2, 2025

I just wrote a draft spec to rewrite of the nip90, its a starting point #1904

@fiatjaf
Copy link
Member Author

fiatjaf commented May 2, 2025

I fail to see how this is a rugpull if the specs were already not in this NIP anyway. Also what about all the other people who are doing DVMs that aren't even in the DVM repo, are they rugpulling themselves?

In fact this "reset" is a rugpush (what is the opposite of a rugpull?) because what we should actually do is to survey the ecosystem of DVMs that exist and write down the successful cases based on how they're being actually used.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 2, 2025

@vitorpamplona
Copy link
Collaborator

@fiatjaf your post mentions adding HTTP as DVMs, which was never here. If that's what you want to do (I still don't know what you want here), then this is changing the spec in some pretty massive ways.

Why not just do the HTTP stuff as their own NIPs? Just copy NIP-96 or Blossom APIs for that matter.

To me, our most successful DVM is NostrWalletConnect. Being spec'ed as a separate NIP helped all developers implement only this type of DVM.

@arkin0x
Copy link
Contributor

arkin0x commented May 2, 2025

If we agree that the DVM spec could be improved, then let's make a DVM 2.0 spec. This is what we did with direct messages. Leave the original alone; let people migrate when ready and willing.

@dtdannen
Copy link

dtdannen commented May 2, 2025

  • If we were to upgrade NIP-90 to be a bit more clear with the following flow, does everyone still have the same issues with it?

There are 3 possible flows, per kind in the DVM Range:

  1. the classic flow, both 5xxx and 6xxx
  2. only 6xxx
  3. only 5xxx

Each would use kind 7000 for any extra steps, including payment. The specific flow that a single DVM wants to use can be custom if needed. Good DVMs will publish documentation or you will be able to check DVMDash for the flow.

  • I disagree that we need a NIP per each DVM category - it will be too much of a burden on this repo to manage all the updates.
  • Is the real issue that you all want specs per DVM or kind defined prescriptively somewhere, like all the other nips, instead of querying relays to find out what the spec is dynamically? If yes, do you also think NIP-89 is problematic?

Longer response to some of fiatjaf's comments here: https://njump.me/nevent1qvzqqqqqqypzpkscaxrqqs8nhaynsahuz6c6jy4wtfhkl2x4zkwrmc4cyvaqmxz3qyghwumn8ghj7mn0wd68ytnhd9hx2tcpzemhxue69uhkyetkduhxummnw3erztnrdakj7qg7waehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2ap0qqsvxj5tksmq7c5lkdmtqxc2qyu2rm0u70wrhjtv855d4je572w3cqgtarzs8

@fiatjaf
Copy link
Member Author

fiatjaf commented May 2, 2025

  • I disagree that we need a NIP per each DVM category - it will be too much of a burden on this repo to manage all the updates.

Most DVM specs will be super small and fit in one or two lines. We can have them directly here on NIP-90. That's how NIP-51 works: one NIP defines a bunch of list kinds because they're very simple.

  • Is the real issue that you all want specs per DVM or kind defined prescriptively somewhere, like all the other nips, instead of querying relays to find out what the spec is dynamically? If yes, do you also think NIP-89 is problematic?

Either we have a standard or we don't. If we want a specific DVM to be interoperable then it's obvious that we need the specs written somewhere otherwise we'll go totally insane. But for some use cases we don't want an interoperable standard, then it's fine to not have one.

@dtdannen
Copy link

dtdannen commented May 2, 2025

You didn't answer my question about NIP-89, and it's not that the specs aren't written anywhere, it's just they are dynamic and you have to fetch it from another place (relays).

I agree that most DVMs will easily fall into one of the 3 protocol flows I mentioned and their specs can be described succinctly. Listing them in the NIP sounds fine.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 2, 2025

You didn't answer my question about NIP-89

I was going to, but I forgot. My answer is that I have no idea of how NIP-89 works so I don't use it and I don't touch it. I read the spec once years ago, then people started using it in a ton of different unexpected unspecified ways, so yes, I think it is problematic.

it's not that the specs aren't written anywhere, it's just they are dynamic and you have to fetch it from another place (relays)

Can you clarify this? You mean the spec is described in NIP-89 events? Or that the spec has to be inferred or reverse-engineered from event examples published somewhere?

@dtdannen
Copy link

dtdannen commented May 2, 2025

Yes, the spec is defined in NIP-89 events. It's the 'nip90Params' field in the top level 'content' field. Here's a big analysis I did over all NIP-89 announcements that DVMs have published (almost 13k now), that show the tags, parameters that the DVM takes, etc. Some of the smaller kinds don't use it.

https://wikistr.com/dvm-announcement-analysis*da18e9860040f3bf493876fc16b1a912ae5a6f6fa8d5159c3de2b8233a0d9851

(I would have linked to njump here, but it doesn't work for me right now)

@fiatjaf
Copy link
Member Author

fiatjaf commented May 2, 2025

This is all still too abstract for me and I'm not sure those reports should have been published as wiki articles. This is unrelated, but can you tell me why you decided to do that instead of publishing a normal article?

Anyway, you can't possibly be telling me that there are actually 13k working DVMs on Nostr, right? If that was true then I would have to revise all my assumptions, but I'm pretty sure that isn't true otherwise for sure someone else would have at least mentioned them somewhere, right?

It would be nice to see some more concrete examples of people who are using these DVMs and see their code.

Anyway, you didn't answer me about that DVM website with specs. What is the point of such website if DVMs are publishing their own spec in NIP-89 events or websites? I think we are very close to agreeing here.

@dtdannen
Copy link

dtdannen commented May 2, 2025

Regarding the spec, I mean that yes the spec is defined in NIP-89 events. They aren't examples, it's exactly the parameters needed for the DVM, whether the parameter is optional, etc. What may not be currently in there is how the DVM flow works, like if the DVM wants payment first via kind 7000 with a lightning invoice or ecash, etc. I think we should add this into NIP-89 announcements, or at least a link to external documentation (like what Vertex provides).

I don't think we should be reverse engineering the specs at all. It should be defined by the DVM's operators, just like anyone who makes an API available should provide docs about how to use it. If someone wants to use a DVM and they can't, they should complain to the DVM operator for not providing documentation.

What is the point of such website if DVMs are publishing their own spec in NIP-89 events or websites?

If this is referring to my earlier comment, I really meant a website that's more a Nostr client and pulls the NIP-89 data from the relays, and displays it.

By 13k, I meant 13k kind 31990 events that have been published over the last 2 years by 610 unique DVMs. But some of these haven't been online for a while.

For example code, check out:

@believethehype
Copy link
Contributor

believethehype commented May 3, 2025

I tried to introduce examples for more concrete parameters in #1358 as a first step in July 24.

The nip90 params themselves are defined in the dvm Kinds repo but its not trivial.

The nip90 params also vastly depend on the Implementation. Its hard to define default ones when people use different tools in the background.
I remember the dvms for Image Generation. Some AI Tools / Apis in the Background wanted Ratio, others wanted height and width. Now decide for a unique param for all dvms for this kind with multiple people involved.

Btw in your Suggestion you add primal http API Access as an example while primal actually provides nip90 dvm acess to their feeds because this is an established standard.

Dvms are not Bots. Bots are Bots. Dvms are a very well defined generic Workflow in nip90 and more concrete in the dvm Kinds repo.

Could this be improved? Yes. Is it all undefined and chaos and as bad as some people talk it down?
Not at all.

@vitorpamplona
Copy link
Collaborator

vitorpamplona commented May 15, 2025

I've seen at least two examples of people who said they were very confused about NIP-90 and that they were thinking of making an HTTP API for some useful services, but since they saw NIP-90 they abandoned these plans and decided to do whatever NIP-90 was saying.

The issue with using a generic name is that devs expect that making a DVM automatically makes their stuff available in many clients. That is and will always be completely false. They only get any benefit if they make a DVM that re-uses an event kind with the exact same params as other DVMs of that kind, and even so, it only works on clients that support that specific kind. So, they do a lot of work and then get disappointed that their DVM is not compatible with anything. Reusing the name for other things (like HTTP/API calls) will only make the situation worse.

We had seven experiences with HTTP/JSON API specs:

  • NIP-05, which works really well even though users don't understand what it actually does.
  • Lightning, whose spec is so much of a mess that we need to create NIP-47 DVMs to fix it.
  • NIP-03 OTS, for which we gave up on making any specs for it and just decided to use a single implementation for it.
  • NIP-96, which worked, but it was clearly too complex for the service needed.
  • Cashu, which works quite well as a spec.
  • Blossom, which is the shiny, cool thing these days.
  • NostrNests (LiveKit), which Nostur implemented and I tried to use as well.

All seven are very different APIs from one another. I wouldn't call ANY of them DVMs. I wouldn't even group them into the same thing.

From those, I think the Blossom documentation model is the one to be copied, not the DVM one. If Vertex wants to build one, it should focus on itself, release opensource reference implementations, and create "BUD"-like specs. Just don't make redirections like on NIP-96.

There is no point in grouping things under the same name.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

Isn't an HTTP API also request/response though?

Yes, but HTTP is the ideal request/response vehicle, while Nostr events aren't. When you send a Nostr event you have no idea if anyone is listening on the other side. You may fail to find the correct relays, you may fail to connect to the relays you want, you may fail to send the event to the relay, or you may succeed in sending the event and then get no feedback about whether your event was read by whoever you wanted to reach.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

I wouldn't call ANY of them DVMs. I wouldn't even group them into the same thing.

It makes sense that you don't, because you are assuming that DVM is this request/response paradigm that happens with Nostr events being published forever on hardcoded relays. My entire point was to reframe that.

But also these examples are not anywhere near the kind of thing I would think of calling "DVM" myself either.

Here are some other examples that fit better:

  • a bot that listens passively for events that meet a certain criteria and timestamps them and publishes the OTS proof
  • an HTTP API that provides decent profile search based on a pagerank-like mechanism
  • an HTTP API that returns a list of trending notes for a given period
  • a service that monitors the public activity of a list of people and exposes a browseable relay feed of their favorite posts
  • a relay that returns the trending notes for a given period filtered by the interests of whoever is making the connection
  • an HTTP API that you can hit and it archives a webpage as WARC and publishes it to Blossom then publishes an event pointing to that
  • an HTTP API that you can hit and it downloads a YouTube video, uploads it to Blossom and publishes it as a kind:21 event
  • a bot that listens passively for events that meet a certain criteria and translates their content, publishes the translation as an event available to all

The first 5 exist today (ots_nbot, Vertex, nostr.wine and nostr.band APIs, relays.land, algo.utxo.one), the other 3 exist partially but could easily be finished in the way they're described above.

Anyway, I think these things all fit the general idea of a "DVM", but sure, if no one can see the possibility of a change like I'm proposing and wants to condemn the term "DVM" to only mean request/response via events then I guess we can have that too, except that now DVMs, instead of being something cool and automatic, will be synonymous with an unreliable inefficient API design that confuses everybody and is barely useful, not a great look for Nostr.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

  • NIP-03 OTS, for which we gave up on making any specs for it and just decided to use a single implementation for it.

I'm curious about this. What are you talking about here? What are the missing specs and what is that single implementation?

@vitorpamplona
Copy link
Collaborator

Yes, but HTTP is the ideal request/response vehicle, while Nostr events aren't.

Only if the connection is Sync. Many DVMs take a long time to run. Running Async and behind firewalls is what DVMs were about. Otherwise, the DVM framework wouldn't make any sense.

The way you wrote "It's important to notice that such definition of DVM encompasses basically everything in the world" basically renders this NIP useless. I don't even know why we need a name for that. What are we gaining with this NIP? Or is it just extra mambo jumbo that no one will ever read? This is like defining the WebSocket protocol inside our NIPs. We don't gain anything with it. The new text doesn't add or specify anything to anyone.

NIP-03 OTS... I'm curious about this. What are you talking about here? What are the missing specs, and what is that single implementation?

There are no specs for opentimestamps. It's just one implementation replicated into many languages, with major differences depending on which blockchain they are committing to. The calendar server is just one implementation.

@dtdannen
Copy link

"devs expect that making a DVM automatically makes their stuff available in many clients."

This is a failure of documentation. We should update the spec to make this clear.

DVMs do not encompass everything in the world. There's lots of use cases, which we are already seeing (https://stats.dvmdash.live/kind-stats) that fit nicely, especially for long running async jobs like @vitorpamplona mentioned.

@fiatjaf why not make a separate spec for everything else you want to do? I don't see any conflict with having existing DVMs (we all agree we need better documentation and explanations of the tradeoffs) and something else that uses http, or websockets, or whatever you want. Maybe you just need to invent a new NIP, explain how people announce those services, and you're all set. No one working on DVMs expect them to solve everything, and people aren't using them for everything.

@vitorpamplona
Copy link
Collaborator

If all you want to do is to specify something like nostr.wine HTTP translation services, just specify that as its own NIP. You don't need to call it a DVM to get an HTTP NIP in here. We don't even need to call the thing anything else but "translation API".

The DVM spec is about how translations get to you (async via relays) and not about how the service itself runs or what it does. It is just the transport layer. For instance, the same nostr.wine HTTP translation service can also reply as a DVM or can be running automatically as a bot. Bots != DVMs != HTTP calls.

@dtdannen
Copy link

The DVM spec is about how translations get to you (async via relays) and not about how the service itself runs or what it does. It is just the transport layer. For instance, the same nostr.wine HTTP translation service can also reply as a DVM or can be running automatically as a bot. Bots != DVMs != HTTP calls.

Well said!

@dtdannen
Copy link

DVM is this request/response paradigm that happens with Nostr events being published forever on hardcoded relays.

We should move to ephemeral events or expired-at tags, as @gzuuus suggested before. "Being published forever" is not a requirement

@vitorpamplona
Copy link
Collaborator

We should move to ephemeral events or expired-at tags, as @gzuuus suggested before. "Being published forever" is not a requirement

Each DVM type can make that choice. But IMO, we have made the opposite mistake on NIP-47 that everything is ephemeral, and because of that, some use cases of that specific DVM cannot be built. So, expired-at tags are preferred. And they can be added to any DVM that already exists today.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

@vitorpamplona you must decide if you're talking about things as they are or as they should be. If you keep switching it's impossible to have a conversation.

-- let's paint our house blue, the current white color is bad
-- I agree and I think we should decide on one color, I prefer green
-- I prefer blue because the sky is blue and I like the sky, what do you think?
-- you are completely wrong: our house is white

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

Either way, since no one here seems to get my idea I won't insist. If you want to keep the existing NIP as it is then fine, but we'll need it to be rewritten. It cannot possibly stay in the current form because it is ridiculously misleading.

Before opening this PR I didn't know half of what @dtdannen described about how DVMs work. What he calls DVMs is categorically different from what the current PR describes.

Someone has to volunteer to rewrite this NIP taking into account all the NIP-89 shenanigans and "dynamic specs", and it must be simple and clear such that it is possible to implement a DVM after reading the NIP.

If that rewrite doesn't happen then the next best course of action will be to clear the NIP text or write something like "if you want to learn how to do DVMs ask around".

Agreed?

@vitorpamplona
Copy link
Collaborator

vitorpamplona commented May 15, 2025

My position here is simple.

  1. Deprecate the DVM framework. Don't just delete this NIP. Don't change the text for now.
  2. Create a new NIP for each DVM type out there with custom fields to address ONLY the needs of that particular use case. No rules. The "DVMs" can be anything or use any structure they want. The new NIPs don't even need to be called DVMs.

Once we have "DVMs" clearly defined in their own NIPs, NIP-90 should be irrelevant and can be either deleted or just modified to serve as an Umbrella design pattern of the other NIPs, IF NEEDED (I don't think we will need it).

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

That's almost reasonable, I just don't like the idea of having a ton of NIPs, one for each badly-thought DVM idea that will only ever be implemented by one guy once and abandoned after 6 months. That would be very confusing for everybody who ever lands on the NIPs repo and is trying to make something solid and interoperable.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 15, 2025

Also the current NIP doesn't serve any purpose at all, it doesn't even describe the currently existing DVMs. So we really don't lose anything by either deleting it or rewriting it to reflect the current practices.

@vitorpamplona
Copy link
Collaborator

one for each badly-thought DVM idea that will only ever be implemented by one guy once and abandoned after 6 months

The same rules apply: Each DVM must have at least 2 implementations and 2 operators to be included.

I just don't like the idea of having a ton of NIPs

Separating them all is better because nobody will ever implement all DVMs. Each client can only support a few types at most. So, making sure whoever is implementing them can read just that NIP and get it done is key. Right now, the DVM NIP is stuck because we have too many people doing too many different things, and just one text that must match them all. That's why everything is stuck.

In that new world, @believethehype could have transitioned over to NIP-44 for his DVM kinds independent of everybody else, which might decide to stay in NIP-04.

We are trying to hard to join everybody into just one NIP.

@believethehype
Copy link
Contributor

@fiatjaf are you aware of this repo?
https://github.com/nostr-protocol/data-vending-machines/tree/master/kinds

Its one of 3 repos on the Nostr protocol.

@dtdannen
Copy link

dtdannen commented May 15, 2025

Myself and others are already working on a new NIP 90, that covers a lot of what is in this thread. Even if it doesn't become the new NIP, it can serve as a guide to the design pattern of DVMs.

One of the initial ideas of NIP-90 was to be a marketplace of services. I like the idea of specifying a particular "DVM" announcement kind (like what is suggested here: #1728) so that folks who wish to advertise their DVMs with other DVMs, can do so. In that case, maybe the only specific kind numbers in the new NIP-90 would be the announcement kinds, and everything else is up to the DVM creators.

I'd like to propose leaving this thread open until we share the new version.

@vitorpamplona
Copy link
Collaborator

My recommendation is to send the NIP for a specific implementation first. And only if it gets traction with users, try to generalize to a design pattern for DVMs.

We spent way too much time generalizing before any implementation is actually used.

@gzuuus
Copy link
Contributor

gzuuus commented May 16, 2025

I think the problem with this NIP is the overgeneralisation of the concept of a DVM, simply because it's cool. Some people have an idea of what a DVM is, while others tend to overgeneralise, so everything is confusing and the conversation is unproductive.

If we accept the term DVM as a generalisation of any interactive pattern between pubkeys, we should define subsets of DVM, such as DVM:RPC, DVM:HTTP, DVM:BOT, DVM:WHATNOT. This will at least clarify the pattern of interaction depending on the protocol/concept. If we don't like that, then we should narrow down and reach consensus on what a DVM is. If we deviate from the original idea of a marketplace of computational services, where each job type has a specific kind and uses an RPC-like interaction with requests and responses using a relay for coordination, then we should define that. I think this is the first question we should answer to move forward: are DVM anything or are DVM something specific? Then we can draft accordingly and see what people implement.

Another thing that happens in Nostr is that we consciously leave some standards as open as possible because we don't want to limit use cases. This is great, but I think striking the right balance is quite challenging since a standard should define something and provide implementation guidelines, etc. instead of just confusing you by being half-defined in order to allow any use case that fits that pattern, while it hasn't even been created or demanded yet. I think it would be beneficial for NIPs to be more structured and well-defined, without fearing that this would limit other possible implementations. If there is an implementation that is not defined in the standard, and someone wants to develop it and implement it, nothing will stop them. Secondly, you can update the spec or create a new one.

@toadlyBroodle
Copy link

Here's a proposed solution to many of the problems mentioned above: PR1929

@melvincarvalho
Copy link

Im going to be pragmatic here and write a starting point for a rewrite of this spec, from there we can shape it if we find it valuable, if not someone else would have to propose a different rewrite and so on until we find the spot.

Is there some missing context here? Has the DVM spec been abandoned by its original author, and is that why someone new is taking on a rewrite?

@believethehype
Copy link
Contributor

believethehype commented May 24, 2025

No. Instead of improving specific points of a working spec that was fine for two years, we have 8 different specs now, all doing the same thing. I really do not like how this discussion is happening, starting with "i just reset the thing" to "I just make something i like for the one thing I personally do". Nip90s Idea was to define a simple generic workflow for a multitude of tasks related to data processing. Every task has a kind with details and rough consensus about inputs/outputs/parameters. It is actively used by a majority of social clients and by specific dvm clients. Killing it or changing the very nature of it will take months for providers and clients to adapt, If they would at all. And this is the last thing i will add to the debatte.

@fiatjaf
Copy link
Member Author

fiatjaf commented May 24, 2025

@believethehype no one is asking anyone to adapt, and getting rid of this spec should have zero effect to existing DVMs because they are already not following this spec. I don't know how that is so hard to understand.

@believethehype
Copy link
Contributor

Because they are follwing the spec. I dont where the Idea that they don't comes from.

@dtdannen
Copy link

Myself and some others are working on a new draft of the spec and plan to share soon, FWIW.

@dtdannen dtdannen mentioned this pull request May 29, 2025
@dtdannen
Copy link

A few of us have iterated on a new spec that tries to address most of the comments here:

#1941

The major changes are:

  • moving from kinds 5000-7000 to ephemeral kinds 20000-29999
  • moving from NIP-89 to a new announcement scheme that includes support for providers who run multiple DVMs
  • the response kind can be set by a DVM to be anything, although we give a strong recommendation that this should be an ephemeral event equal to 1 + request kind (instead of the previous 1000+request kind)
  • we added guidance sections for DVM developers, Client developers, and Relay operators
  • we added an introduction that compares DVMs to APIs, and providers broader context about DVMs in general
  • concrete examples of all types of events
  • added a FAQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.