solid-contrib / webmonetization

Discussions about Solid + Web Monetization
MIT License
7 stars 2 forks source link

Hosting a payment pointer on your pod #1

Closed michielbdejong closed 3 years ago

michielbdejong commented 4 years ago

I started documenting how one could host a payment pointer on their pod.

Since it can be any URL at a domain you control, Solid users could just use any file on their pod.

It would be nice if they could use $username.solidcommunity.net. For that, maybe the server could reply to requests for https://username.solidcommunity.net/.well-known/pay with the contents of https://username.solidcommunity.net/settings/paymentPointer.json or something similar. -> created an NSS issue about this.

We can also create a UI dialog in Solid OS that allows users to edit their /settings/paymentPointer.json file. -> created a MoneyPane issue about this.

michielbdejong commented 4 years ago

Sure, then the server would just have to translate it. Or maybe we can do it as json-ld? The JSON should look something like

{
  "id": "https://wallet.example/alice",
  "accountServicer": "https://wallet.example",
  "assetCode": "USD",
  "assetScale": 2,
  "auth" : {
    "authorization_endpoint": "https://auth.wallet.example/authorize",
    "token_endpoint": "https://auth.wallet.example/token",
  }
}

but maybe we can produce that by adding @context in a smart way

joepio commented 4 years ago

Nice work, Michiel!

Some Approaches for finding a resource in a pod:

  1. Adding a .well-known definition. Easy to implement, takes a single request. But does not solve this domain of problems, as it requires hard-coding and standardizing .well-known paths for ever time this kind of problem appears.
  2. Manual selection by User. Easy to implement, but takes a set of extra steps. Makes solid too hard to use.
  3. Adding path traversal logic. From a standardized starting point (e.g. profile of the user, such as Ruben mentions), we traverse a (set of) predicate(s), which brings us to the desired resource (e.g. the Payment Pointer). A Path Definition is a resource with a starting point (e.g. profile) and an ordered set of predicates.

I think something similar to option 3 has the most potential, since it is fully automated and can be extended by anyone. But I'm assuming something like this has been discussed / considered before in Solid context.

michielbdejong commented 4 years ago

@joepio Hi! I realised I'm making a few assumption here:

michielbdejong commented 3 years ago

Looking at e.g.

curl -ki -H 'Accept: application/spsp4+json' https://ilp.uphold.com/z7rXWqEwUBrf
curl -ki -H 'Accept: application/spsp4+json' https://coil.xrptipbot.com/aazhMbgMTheUPbwj58SqVQ

It seems that most currently existing payment pointers only work for SPSP, not for Open Payments. Since we don't want to implement a full SPSP server in NSS, I'll just make it configurable as a redirect, so that if your payment pointer is e.g. $coil.xrptipbot.com/aazhMbgMTheUPbwj58SqVQ you can redirect $michielbdejong.solidcommunity.net to it as a simpler ('vanity') payment pointer.

ianconsolata commented 3 years ago

So I've thought about the $username.pod.host format before, and as far as I know the spec doesn't guarantee that other pod host implementations will use the subdomain format. What would my payment pointer be if my web-id was https://example.org/ianconsolata/profile/card#me? Or just https://ianconsolata.com/#me? (I assume they would be $example.org/ianconsolata and $ianconsolata.com, but that is a little unclear?). In general, I like the idea of supporting the username.pod.host/.well-known/pay format, since it's part of the ILP spec: https://paymentpointers.org/syntax-resolution/#examples, but it seems like that only works with pod hosts that use the subdomain format.

However, I also agree that we will need a more general solution for other integrations with non-Solid systems that don't have a dedicated .well-known url. We'll want somewhere to store lots of different wallet ids, not just interledger pointers, as well as external accounts like Facebook. It would be great to have both .well-known support for ILP, as well as list it in whatever other account integrations system we develop.

michielbdejong commented 3 years ago

There are two ways in which a pod server can provide payment pointers: implement SPSP itself, or implement a http redirect to a server that does, and where the pod user already has a payment pointer that works. I did the latter in NSS and this doesn't give the user much functionality other than that alias being easier to remember, and the vanity of having a payment pointer that resembles your Solid pod domain. The user still has to tell the pod server what their existing, working payment pointer is.

And the way we can link a webid with a payment pointer is with RDF. :) I started using this as follows:

@prefix : <#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix pp: <http://paymentpointers.org/ns#>.
@prefix schema: <http://schema.org/>.

:me
    a schema:Person, foaf:Person;
    pp:PaymentPointer "$coil.xrptipbot.com/aazhMbgMTheUPbwj58SqVQ".

NSS will read that from your profile and give you a redirect to it, which is a nice-to-have.

But maybe more importantly, a Solid app like Darcy can discover my payment pointer and include it in html pages that display content of which I'm the author.

michielbdejong commented 3 years ago

Will discuss in today's Solid OS meeting.

Screenshot 2021-01-13 at 16 00 55
michielbdejong commented 3 years ago

Done! \o/