Thinking out loud how we can easily support Nostr 402 (payment required) and 401 (unauthorised). Good news — I think we can just use a WWW-Authenticate header to indicate supported auth methods - which can double as a way to prove payment.

Basically, for 402 Payment Required, we can return a mime/type suitable response.

For an image we can return a blurred/masked image and maybe some kind of indicator it’s paywalled with two HTTP headers. An invoice header to optionally pay and a WWW-Authenticate with something like Nostr-NIP-98.

Doesn’t solve the issue of knowing if you’ve already paid. If you get 402, do you automatically try auth to see? Privacy issues exist. Do you try auth once before invoice payment as a sense check? Also doesn’t solve normal web browser inter-op. Maybe closer to an approach.. but lots to solve still.

One possible approach is to whitelist domains you are happy sending HTTP AUTH events for accessing the content - paid or private.

Reply to this note

Please Login to reply.

Discussion

WWW-Authenticate docs are worth a read. I didn’t know about this part.. apparently it’s a MUST to include.

“A server using HTTP authentication will respond with a 401 Unauthorized response to a request for a protected resource. This response _MUST_ include at least one WWW-Authenticate header and at least one challenge, to indicate what authentication schemes can be used to access the resource (and any additional data that each particular scheme needs).”

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate

It's great to see you actively thinking about ways to easily support Nostr 402 and 401. Utilizing a WWW-Authenticate header seems like a good approach, allowing for authentication methods while also proving payment.

Returning a different mime/type for paid content could help differentiate and blur images with headers indicating those as paywalled is a more feasible option. Nevertheless, maintaining privacy would still remain an issue if confidentiality pertaining paid content isn't cohesive yet optimal affecting monetary concerns exclusively

For knowing whether the service has already been paid, there are several ways you can solve this problem ranging from creating unique tokens that can be used indefinitely to maintaining records of user payments tied with wallet addresses making authorized access checks worth pursuing.

Having specified domains that are eligible through HTTP AUTH events seems appropriate, however it relies on web bots being programmed meticulously sensitive towards validation feasibility based on categorization enhancement mandates providing scalable functionality hiding identifyers uncencoring any possible contingences arising amidst concurrent global distributions being noticed expediently scaling effectively techniques targeting compatibility matrix strengths highly impactfully expliting analytics technologies presently advances online delivery platforms cooperating intelligible effects conferring more satisfactions yielding goodwill spearheaded communicatve stanches having larger online outcomes riling youth contributed markedly versatile attention-seeking tasks sharpen dialectic confurations sharpening movement study proliferation ignited broadminded demographies formatted toward dissemination twinning literary entities homogenizing relationship patterns bestowing accesibl emergent digital authoritativeness namely rights equally endowned accessible futures grounding open-available education-driven initiatives enlargening impactful sociojhistoric guidance counselling vibrant nichodemocracies hypothetically emerged impacting international relations towards high-level positive communual beneficial contents initiating dreamful destinations bearing specifically high resultant interaction levels promoting prospective realities created around amicable potential consumer resurgenced stakeholders engaging existing fragmentations transversally provisioning idealized systemic governance restructuring stakes optemum benefits crafted out logistical systemic rethinking exponentially-owned environments inducing emanipatory pursuits attributed alongside relevant task specifications segmenting specialized steps towards effective human responses connoting supplementary evolutionary outbreaks

What I keep seeing is new protocols falling into the grooved road of older protocols.

I hasted to add… This is OK, because there is a lot of wisdom in those grooves.

But just be mindful of this when you see it.

There’s the fabulous anecdote (best told by Buzz Aldrin) that the solid rocket boosters of the space shuttle were limited in size by the width of a horses ass. All because Romans standardised chariot design around using 2 horses spaced 4ft 8.5in, this then became the root decision that specified every carriage, road, railroad, tunnel, bridge, etc for the next 2,000+ years.

Now if they hadn’t all standardised on optimal horse dimensions, maybe we wouldn’t have progressed so fast? But if trains had standardised for trains and cars for cars maybe things could have gone faster / better? It’s hard to know, but the compromise is really early growth v’s late growth.

If you are following grooves for interface reasons, that’s probably a good thing. If you are following grooves only for convenience then that’s a risk to future growth and you should state in public and seek to revisit at earliest opportunity as cost of fixing only grows.

There’s a lot of convenience decisions in MVP, and it’s that tech debt that often kills a lot of otherwise excellent ventures.

… not being critical at all, I assume you posted it for this kind of feedback?

I would certainly build for convenience and then seek to refactor for immediate optimisations as soon as you feel the case is made.

I’m almost sold on it. Yep, I’m really just experimenting - however fighting for adoption of new is largely harder than using existing like functionality even if not great.

nostr:note1clk67fp29mea0ldldpqn7a8c8p3cdxvg3r899q38t75m34mq89hs8q2skn

I almost died of boredom while reading this.

😂

I almost died by testing my idea more and I think the web is too fucked to make some of this actually work 🫠.

Still trying to make browsers have some reasonable inter-op.. anyway.. one can dream.

Browser JS APIs don’t allow websockets to open with connection (auth) headers 😳

You can’t get http status code or response headers from an img tag (without manual JS requests), to interact with JavaScript and show custom UI, or dynamic send AUTH or pay an invoice 😵

These are decade+ old gaps that still exist today. Maybe web browsers fade out of existence sooner than I thought.

You can’t even make this stuff up..