NIP-105 API Service Marketplace#780
NIP-105 API Service Marketplace#780CoachChuckFF wants to merge 2 commits intonostr-protocol:masterfrom
Conversation
Why NIP-105 and not NIP-90 Data Vending Machines?Someone asked me what are the advantages of NIP-105 over NIP-90 (https://github.com/nostr-protocol/nips/blob/vending-machine/90.md). That is a great question. Allow me to dig in. Let's start by saying there are many ways to approach the problem and we encourage competition and different approaches with different trade offs. Let a thousand flowers bloom. At the same time, there are significant upsides to API Marketplace (we call them Data Buffets) over Data Vending Machines that are worth noting:
|
|
seen here: https://www.youtube.com/watch?v=pAomJ_k7KZU |
|
I'll just comment on a few points that caught my eye on the comparison of this approach vs DVMs because I think there are many misconceptions (e.g. DVMs are NOT bid based).
Service Providers in DVMs are explicitly showing their hand when/if they provide a bid for a job and can provide different bids on a per-job basis if they so choose. Instead of requiring having a single price they can create a price (again, if they so choose) that is specific to the peculiarities or risk profile of the job/customer. Furthermore, each DVM is creating a price history of it's jobs and this transparency brings competition by wildly reducing information asymmetry.
This is the entire design of Nostr. Communication happens through relays, and the byproduct of the data can be useful to others or permit others to build job chaining based on other DVMs outputs (as is already happening)
There is no encryption in the DVM spec as I think it's a bad idea.
There is no frontend to DVMs 🤔 My skeleton DVM is probably less than 300 LOC. And I think this gets to the crux of the main difference between this proposal and DVMs, which I don't think it's whether this is bid-vs-ask based (again, a misunderstanding of NIP-90 since the I see many issues with this proposal, but the main one is that the payload to generate a request is really hard to reliably compute and very specific to each endpoint, which means that there is little difference between using this or just hardcoding integration with a very specific endpoint. What's the upside of doing this vs just integrating against specific endpoints? There is no discoverability. Integrating with a specific endpoint has the benefit that implementation complexity remains bounded to the particular endpoint, whereas doing this requires at least one higher level of abstraction for no added benefit. |
This is the first step in the DVM spec:
This is commonly called a RFP or Request for Proposal in my industry. The purpose of an RFP is to solicit bids, which also seems to be the purpose of this first step in the DVM spec. Can you better explain your position here? How are DVMs not bid based?
Websockets are not that great for chaining services together. There is no transaction guarantee (async protocols are not good for this) and no spec for status / error states. Relays are already unreliable and not very communicative when message delivery fails. This problem compounds with every job in the pipeline, and the client has to shoulder the burdens of these problems since everything is coordinated through them. I think it's better to chain APIs together the old fashioned way. HTTP is a robust spec and it works great. Nostr is great for discovery. We designed NIP-105 to leverage the strengths of both Nostr and traditional HTTP / REST. Also I am incredibly lazy and do not want to reinvent the wheel.
I agree. I believe this is a reversal of your suggestion here which is why it was brought up by @uncleJim21, but pr comments aren't gospel so I don't feel it's worth debating imo.
I believe any client-side logic can be fairly categorized as 'front-end', and logic meant to solicit one-to-many rounds of communication for a bidding process (or compute request or w/e you want to call it) sounds quite heavy and a big ask from the client-side developer. If you want to compare apples-to-apples, I would compare LOC for a client library that implements the proposed spec in its intended use-case. In regards to NIP-105, we are only using offers to discover service endpoints, everything after that uses standard HTTP requests which doesn't require anything fancy.
I'm not sure what you mean by this. JSON schemas are a very common standard. Everybody uses them and there are tons of libraries for generating type-safe API calls with them. For example, zod has several libraries for consuming JSON schemas. I can't imagine why you wouldn't want to use a schema to define your API. I plan to add a hash of the schema to the NIP-105 spec so that it is easy to search for standardized endpoints that can directly plug into another service. Thank you for the feedback, and also thank you for your many contributions to nostr. We may disagree on a few things but I don't think we are competing, so it would be great to hear more feedback on both NIP-90 and NIP-105 and share ideas. |
|
We've been building on kind 31402 independently and have 8 implementations in production:
Our spec uses a different tag schema: We will be submitting a PR for our NIP soon, but are happy to chat / collaborate if you are interested. Cheers, The Crypto Donkey |

NIP-105 defines kind:31402 for broadcasting API services, endpoints and their costs in mSats.
It was written, implemented and placed in the 2023 TABconf Hackathon.