Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit df0b23f

Browse files
authored
add discovery topics to reorg (#117)
* add discovery topics to reorg * added PayID discovery to sidebar * Newline removed. I need to get actual names for scenarios that are legally approved. Will do so in the near future.
1 parent 08a6fd6 commit df0b23f

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

docs/payid-discovery.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
id: payid-discovery
3+
title: Discover a PayID
4+
sidebar_label: Discover a PayID
5+
---
6+
7+
The PayID Discovery endpoint facilitates finding the PayID URI for a given PayID.
8+
9+
## PayID discovery by a wallet application
10+
11+
Suppose Alice wants to send Bob some XRP from a web-based wallet provider that Alice has an account on. Alice logs in to the wallet provider and enter Bob's PayID, such as `bob$receiver.example.com`, into the wallet UI to start the payment. If the wallet application is set up to use the PayID Discovery endpoint, the wallet application performs a WebFinger query that looks for the PayID Discovery service provider, like this:
12+
13+
```
14+
GET /.well-known/webfinger?resource=payid%3Abob%24receiver.example.com
15+
HTTP/1.1
16+
Host: receiver.example.com
17+
```
18+
19+
If the server for Bob's exchange, where Bob receives currency, supports the PayID Discovery endpoint, it responds like this:
20+
21+
```
22+
HTTP/1.1 200 OK
23+
Access-Control-Allow-Origin: *
24+
Content-Type: application/jrd+json
25+
26+
{
27+
"subject" : "payid:bob$receiver.example.com",
28+
"links" :
29+
[
30+
{
31+
"rel": "https://payid.org/ns/payid-uri-template/1.0",
32+
"template": "https://receiver.example.com/users/{acctpart}"
33+
}
34+
]
35+
}
36+
```
37+
38+
Alice's wallet can then use the URL template found in the "template" property to assemble the specified PayId URL. Typically, this template might add a folder structure to the URL, such as `https://receiver.example.com/users/bob`. The server can be set up to use other URL formats, so long as the resulting URL is valid and represents Bob's PayID.
39+
40+
## PayID discovery with a default template
41+
42+
In this case, Alice's wallet application makes the same request as previously, but Bob's server does not support Webfinger, and returns `HTTP/1.1 404 NOT FOUND`.
43+
44+
The wallet application then uses a default template to transform `bob$receiever.example.com`
45+
to `https://receiver.example.com/bob`. The wallet then uses this URL to continue making the payment. Alice's wallet proceeds to make the payment.

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'payid-reference-overview',
2222
'payid-cli',
2323
'verifiable-payid',
24+
'payid-discovery',
2425
'payid-best-practices',
2526
'integrate-payid-users',
2627
'metrics',

0 commit comments

Comments
 (0)