You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to implement a flexible payment flow for Data Vending Machine (DVM) service providers, allowing them to optionally request payment upfront or after job completion. This implementation should follow the NIP-90 DVM flow and integrate with NIP-57 for Lightning Zaps.
Requirements
Service provider configuration:
Add a configuration option for each service provider to specify their preferred payment flow:
Upfront payment required
Payment after job completion
Flexible (allow both options)
Job request handling:
When receiving a job request (kind: 5600), check the service provider's payment configuration.
If upfront payment is required, send a kind: 7000 job feedback event with status: "payment-required" before processing the job.
Payment flow:
Implement NIP-57 Lightning Zaps for payment processing.
For upfront payments:
Include an amount tag in the kind: 7000 job feedback event.
Wait for payment confirmation before proceeding with job processing.
For payment after job completion:
Include an amount tag in the kind: 6600 job result event.
Optionally send a kind: 7000 job feedback event with status: "payment-required" after delivering results.
Payment verification:
Implement a system to verify Lightning Zap receipts (kind: 9735) as described in NIP-57.
Ensure that the payment amount matches the requested amount in the job feedback or job result event.
Job processing:
For upfront payments: Begin processing the job only after payment confirmation.
For payment after job completion: Deliver results and then request payment.
Description
We need to implement a flexible payment flow for Data Vending Machine (DVM) service providers, allowing them to optionally request payment upfront or after job completion. This implementation should follow the NIP-90 DVM flow and integrate with NIP-57 for Lightning Zaps.
Requirements
Service provider configuration:
Job request handling:
kind: 7000
job feedback event withstatus: "payment-required"
before processing the job.Payment flow:
amount
tag in thekind: 7000
job feedback event.amount
tag in thekind: 6600
job result event.kind: 7000
job feedback event withstatus: "payment-required"
after delivering results.Payment verification:
Job processing:
Error handling:
kind: 7000
job feedback events withstatus: "error"
and relevant error messages.Partial results and progressive payments:
kind: 7000
job feedback events withstatus: "partial"
to deliver partial results and request progressive payments.Implementation Steps
Testing
Documentation
Related NIPs
The text was updated successfully, but these errors were encountered: