Skip to content

Commit b44bd52

Browse files
JOHNJOHN
authored andcommitted
docs: update paykit paths for v0 protocol
1 parent f10a5f5 commit b44bd52

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

docs/BITKIT_PAYKIT_INTEGRATION_MASTERGUIDE.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,14 @@ Reference implementations:
13371337

13381338
#### 8.2.1 Publishing a payment request (sender flow)
13391339

1340-
Where it is implemented (iOS): `DirectoryService.publishPaymentRequest(_:)` stores at:
1341-
- `/pub/paykit.app/v0/requests/<requestId>` on the sender’s Pubky storage.
1340+
Where it is implemented:
1341+
- iOS: `DirectoryService.publishPaymentRequest(_:)`
1342+
- Android: `DirectoryService.publishPaymentRequest(...)`
1343+
1344+
Storage path (on the **sender's** Pubky storage):
1345+
- `/pub/paykit.app/v0/requests/{recipient_scope}/{requestId}`
1346+
1347+
Where `{recipient_scope}` = `hex(sha256(normalize(recipient_pubkey_z32)))`.
13421348

13431349
End-to-end steps:
13441350

@@ -1349,8 +1355,10 @@ End-to-end steps:
13491355
- Preferred: `PubkyRingBridge.requestPaykitSetup()` (session + noise keys)
13501356
3. Import/restore the session into the Pubky SDK layer.
13511357
4. Configure `DirectoryService` with the session.
1352-
5. Publish the request JSON to `/pub/paykit.app/v0/requests/<requestId>`.
1353-
6. Generate a receiver deep link:
1358+
5. Compute `recipient_scope` from the recipient's pubkey.
1359+
6. Encrypt request JSON with Sealed Blob v1 (recipient's Noise public key).
1360+
7. Publish the envelope to `/pub/paykit.app/v0/requests/{recipient_scope}/{requestId}`.
1361+
8. Generate a receiver deep link:
13541362
- `bitkit://payment-request?requestId=<requestId>&from=<senderPubkey>`
13551363

13561364
#### 8.2.2 Receiving + processing a payment request deep link (receiver flow)

docs/COMPONENT_ROLES.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,15 @@ User taps "Connect with Pubky-ring"
170170

171171
### Paykit Data (paykit.app namespace)
172172

173-
| Path | Purpose | Auth Required |
174-
|------|---------|---------------|
175-
| `/pub/paykit.app/v0/endpoints/{method}.json` | Payment endpoint | Write: Yes, Read: No |
176-
| `/pub/paykit.app/v0/requests/{requestId}` | Payment request | Write: Yes, Read: No |
177-
| `/pub/paykit.app/v0/subscriptions/{id}` | Subscription data | Write: Yes, Read: No |
173+
| Path | Purpose | Storage Location | Auth Required |
174+
|------|---------|------------------|---------------|
175+
| `/pub/paykit.app/v0/{method}.json` | Payment endpoint | Payee's storage | Write: Yes, Read: No |
176+
| `/pub/paykit.app/v0/noise` | Noise endpoint | Payee's storage | Write: Yes, Read: No |
177+
| `/pub/paykit.app/v0/requests/{recipient_scope}/{requestId}` | Payment request | Sender's storage | Write: Yes, Read: No |
178+
| `/pub/paykit.app/v0/subscriptions/proposals/{subscriber_scope}/{proposalId}` | Subscription proposal | Provider's storage | Write: Yes, Read: No |
179+
| `/pub/paykit.app/v0/handoff/{requestId}` | Secure handoff | Ring user's storage | Write: Yes, Read: No |
180+
181+
**Note**: `{recipient_scope}` and `{subscriber_scope}` are SHA-256 hashes of the normalized pubkey (not the raw pubkey).
178182

179183
---
180184

docs/SUBSCRIPTIONS_LOCAL_TESTING.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ adb shell am broadcast -a android.intent.action.RUN \
5858
**Expected Result:**
5959
- Toast shows "Proposal sent successfully"
6060
- The proposal is published to the Pubky directory at:
61-
`/pub/paykit.app/v0/subscriptions/proposals/{recipientPubkey}/{proposalId}`
61+
`/pub/paykit.app/v0/subscriptions/proposals/{subscriber_scope}/{proposalId}`
62+
63+
Where `{subscriber_scope}` = `hex(sha256(normalize(subscriber_pubkey_z32)))`.
6264

6365
### Scenario 2: Discover and Accept Proposal
6466

@@ -76,7 +78,7 @@ adb shell am broadcast -a android.intent.action.RUN \
7678

7779
**Expected Result:**
7880
- Subscription appears in "My Subscriptions" tab
79-
- Proposal is removed from Proposals tab
81+
- Proposal is hidden from Proposals tab (local-only; not deleted from provider storage)
8082
- If autopay enabled: AutoPayRule is created
8183

8284
### Scenario 3: Manage Subscription
@@ -113,18 +115,25 @@ adb shell am broadcast -a android.intent.action.RUN \
113115

114116
## Verifying Directory Operations
115117

116-
Use the Pubky homeserver API to verify proposals are correctly stored:
118+
Use the Pubky homeserver API to verify proposals are correctly stored.
119+
120+
**Important**: Proposals are stored on the **provider's** storage (the sender of the proposal), not the subscriber's.
117121

118122
```bash
119-
# List proposals for a recipient
120-
curl "https://homeserver.pubky.app/pub/paykit.app/v0/subscriptions/proposals/{recipientPubkey}/" \
121-
-H "pubky-host: {recipientPubkey}"
123+
# Compute subscriber_scope (in practice, use the same hashing as the app):
124+
# subscriber_scope = hex(sha256(normalize(subscriber_pubkey_z32)))
125+
126+
# List proposals addressed to a subscriber (query provider's storage)
127+
curl "https://homeserver.pubky.app/pub/paykit.app/v0/subscriptions/proposals/{subscriber_scope}/" \
128+
-H "pubky-host: {providerPubkey}"
122129

123130
# Fetch a specific proposal
124-
curl "https://homeserver.pubky.app/pub/paykit.app/v0/subscriptions/proposals/{recipientPubkey}/{proposalId}" \
125-
-H "pubky-host: {recipientPubkey}"
131+
curl "https://homeserver.pubky.app/pub/paykit.app/v0/subscriptions/proposals/{subscriber_scope}/{proposalId}" \
132+
-H "pubky-host: {providerPubkey}"
126133
```
127134

135+
**Note**: Proposals are encrypted with Sealed Blob v1. The response will be an encrypted envelope JSON.
136+
128137
## Troubleshooting
129138

130139
### Proposals Not Appearing

0 commit comments

Comments
 (0)