0078 XLS-78d: Subscriptions #222
Replies: 24 comments 57 replies
-
Isn't this usecase already solved by payment channels? |
Beta Was this translation helpful? Give feedback.
-
Cool suggestion! I prefer the |
Beta Was this translation helpful? Give feedback.
-
Just got this ping and must say that both the idea of Direct Debit payments and the mechanism proposed is ideal for the development of other similiar related projects of which I have a few. Will give this a good read to see what else might be useful. Nice proposal of an essential requirement and at the protocol level too. 👏 |
Beta Was this translation helpful? Give feedback.
-
If feels very un-Web3 to me to allow someone to draw money directly from my account for a payment without me directly authorizing that interaction. I prefer the model of Checks, which are still signed by the original account, but theoretically could be issued for multiple months. This would require a minor modification to checks to allow them to be invalid before a certain time (like escrows), but I think that'd be a simpler way to go about it. |
Beta Was this translation helpful? Give feedback.
-
We believe this amendment is not only necessary but also transformative. It
will enable SaaS platforms to utilize Web3 and XRPL for payments, offering
a seamless alternative to the current model that often forces users to
purchase NFTs or tokens.
This feature will integrate XRPL directly into the use case, providing a
more efficient and user-friendly solution for businesses and consumers
alike. We are eager to help build a template to showcase this amendment and
welcome any opportunities for collaboration.
…On Fri, Aug 30, 2024 at 8:39 AM Chris Dangerfield ***@***.***> wrote:
Ok, so can I get something straight in my mind.
Is this an automated payment that is made from the user's account by the
user or is this an authorisation that's granted to the receiver to apply
for/collect X amount of funds on a certain day?
The later
—
Reply to this email directly, view it on GitHub
<#222 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASVZGDSHJXFTWMP24AEMEATZUCGZ3AVCNFSM6AAAAABNMRO2MSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANJQGA3TCNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Please forgive my poor English. In order to create a subscription, I would like to at least verify that the domain exists in the recipient account. |
Beta Was this translation helpful? Give feedback.
-
Why not allow users to change the amount on the subscription instead of needing them to cancel and recreate the subscription? You could refactor |
Beta Was this translation helpful? Give feedback.
-
Great idea and amendment proposal, Chris and Denis. Although I'm struggling with the term, "Subscription;" which implies receiving something. I wonder if AutomaticPayment might be better? |
Beta Was this translation helpful? Give feedback.
-
The SubscriptionID is generated from the following elements, but the last Sequence makes it difficult to obtain a specific Subscription. By using an ID field that can identify, for example, a Plan, it is easy to see if a user is subscribed to a Subscription for a certain Plan. Using the Sequence field could also lead to multiple subscriptions to the same plan.
|
Beta Was this translation helpful? Give feedback.
-
Hi @xrpl365 I tried to read everything very Carefully but here are my thoughts overall. I hope I absorbed it. I am not a developer but I hope my comments are valuable. Details around value tied to the subscription/Refunds for value not given:You answered this to a degree, but should the value given to the subscriber be tokenized in some way? Even if just required in the memo field of the transaction and named (EX. Chris Community Platinum Level) This would essentially tokenize and provide some account of the value the subscriber was promised. Management of Subscriptions:We live out life on subscriptions it seems, should we start with a better way to manage multiple subscriptions as part of the amendment? Is there any scenario where multiple subscriptions could hit and cause issues? If there was backup or batching for example? How does the value creator generate a list of subscribers for marketing or gain an understanding of how many active subscribers they have? This Brings me to my next topic. Subscription X Month Minimums.As a creator, I want the option to lock in and incentivize 2,3, or even 6-month minimum so someone will spend the time to understand the value of something I have created. How would this be handled? In my mind to accept the transaction it would be a one time payment or hold in escrow the amount. I understand this severely complicates things but I am sure someone may want the the option. Security and Time. LendingI know this is just for subscriptions but it seems like half the solution for lending as well. At the risk of adding to the scope, could there be some additional functionality added that would allow the lending of money or would that require smart contracts? |
Beta Was this translation helpful? Give feedback.
-
I like this proposal, a dedicated methof agreeing that party B can pull an agreed amount from party A once per period has a lot of comercial value to the ledger. |
Beta Was this translation helpful? Give feedback.
-
I like the proposal and I have been asking for a formal subscription service for some time now.
@dangell7 You mention ’’If you want to lock your user into a subscription then you should be using |
Beta Was this translation helpful? Give feedback.
-
does that mean an |
Beta Was this translation helpful? Give feedback.
-
On
This suggests that if I do not draw on the subscription for more than one period, I will be able to execute the What is the motivation for not introducing a Subscription expiration date or a total limit on the funds that can be drawn? |
Beta Was this translation helpful? Give feedback.
-
Great spec @xrpl365 and @dangell7 . |
Beta Was this translation helpful? Give feedback.
-
Hi @xrpl365, Great specs! Thank you for your work. Example In terms of implementations, it would require adding an int |
Beta Was this translation helpful? Give feedback.
-
I'm a fan of the idea. There is one question I have though that may make it even more useful. Crypto Conditions much like that which live on an Escrow. If one adds that as a possibility to claim on SubscriptionExecute. This can allow for an automated claim framework to be build by the business executing these, instead of executing these against possibly multiple accounts. my 2 cents, thank you for your time on this @xrpl365 |
Beta Was this translation helpful? Give feedback.
-
I am in favor of this proposal and I think it's a very needed feature that should already been done years ago. We need to bring Web2 features, that most internet users take for granted - such as subscriptions, into XRPL. Beyond the core subscription functionality, I believe this feature can be extended to support additional use cases, such as buying something with monthly payments or "Pay Now, Buy Later" options for merchants that accepts XRPL payments. This would provide users with more flexibility and convenience when making purchases. However, it's important to carefully consider the implications of allowing users to cancel subscriptions at any time. While this flexibility can be beneficial in certain scenarios, it may also lead to issues, especially in real-world scenarios. For example, if a user cancels a recurring monthly payment for a product they have bought and agreed to pay monthly payments (interest could also be added in the mix if we want to make it more advanced), it could disrupt the provider's business model and potentially lead to financial losses. To mitigate this risk, it might be necessary to implement a feature that prevents users from unilaterally canceling subscriptions under certain circumstances. This could include cases where the user has already received the full value of the product or service, or where the provider has incurred significant costs in fulfilling the subscription. It might also be good to explore options like: Grace periods: Allowing users to cancel subscriptions with a certain amount of advance notice. By carefully considering these factors, we can ensure that the subscription feature is both user-friendly and sustainable for businesses using the XRP Ledger. |
Beta Was this translation helpful? Give feedback.
-
There needs to be care taken in the design between the actual transaction i.e. debiting the account / initiating a payment and the contract that stipulates the conditions. As mentioned by @Panosmek there are a lot of edge cases where refunds etc. might occur, in most payment systems these would be separate transactions and any adjustments handled by the system that manages the subscription record. To provide some context, in most direct debit schemes, there is a system which manages the mandate setup, drives billing etc. When setting up there is a mandate request which is lodged against the recipients account (they have to agree to this lodgement) and then there are separate transactions for each direct debit. There is also a legal framework for these types of transactions covering items such as indemnity (regardless of whether this is a card transaction or direct debit), communication of the intent to take payment (i.e. normally this has to be communicated x days before taking the payment) - this is probably beyond the scope of this and I would recommend only focussing on the actual transactions not the subscription management or other workflows in any proposal. In the example of existing systems and direct debits, the mandate can normally be deleted from the account by the account holder, this will cause the next collection to fail. This would require a resubmission of the lodgement of the direct debit mandate before the next collection can occur. |
Beta Was this translation helpful? Give feedback.
-
This looks great! Nice work Chris and Denis. |
Beta Was this translation helpful? Give feedback.
-
After reviewing the XLS-78d proposal and community discussions, we find this feature would be beneficial for automating recurring payments within the TextRP unified messaging platform. Benefits:
Risks and Considerations:
TextRP supports adopting this amendment, recognizing its potential to enhance our operations by providing a more efficient and user-friendly solution for recurring payments. We are eager to see how this feature evolves and look forward to contributing to its development and/or implementation. |
Beta Was this translation helpful? Give feedback.
-
I think recurring subscription payments is a good idea. The frequency of payments if no minimum limit implemented could even be daily in some instances. I think its a sensible approach to funding web3 services. |
Beta Was this translation helpful? Give feedback.
-
Maybe we can build a hook 🪝 on evernode to demonstrate this amendment. |
Beta Was this translation helpful? Give feedback.
-
We believe the specification has now reached a "well-refined" state, incorporating the feedback received so far and making the necessary adjustments. (Note: Per the Contributing guidelines, moving a specification into DRAFT does not imply any formal endorsement or guarantee of adoption. It is simply a mechanism to improve the process of refining the specification.) |
Beta Was this translation helpful? Give feedback.
-
XLS-78d - Subscriptions
Updates
Updated: 09/09/2024
Abstract
This proposal introduces a subscription (re-occurring payments) mechanism to the XRP Ledger (XRPL), enabling functionality similar to direct debits, thus removing the need for users to sign a transaction for each payment. The account owner will define values that are used to protect against abuse.
Motivation and Rationale
Currently, payments on the XRP Ledger require the sender to initiate and sign each transaction. With the introduction of off-chain solutions like Xaman API, the concept of pull payments emerged, where a transaction can be generated by the destination address and signed by the sender. However, this method still requires the user to authorize each transaction individually, which is not practical for services requiring regular, recurring payments, ie: subscriptions.
This proposal addresses this limitation by introducing a subscription feature that allows for pre-authorized recurring payments, improving the user experience and enabling a broader range of services on the XRP Ledger.
The proposed subscription model is designed to balance user convenience with security. By allowing pre-authorized payments within defined parameters, the system reduces the need for frequent user interaction while maintaining control over the amounts and frequency of payments. This approach also allows businesses to automate billing processes, improving service delivery while ensuring that users retain oversight and control of their recurring payments. The subscription feature enhances the versatility of the XRP Ledger, making it more accommodating for services that rely on automated, regular payments.
This proposal will support both payments in XRP and issued assets.
Amendment
This feature enables account owners to authorize automated payments with predefined parameters such as amount, frequency, and destination, reducing the need for manual transaction signing each time.
The amendment adds the following:
Subscription
SubscriptionSet
SubscriptionCancel
SubscriptionClaim
New Ledger Entry:
Subscription
The
Subscription
ledger entry is a new on-ledger object that stores the details of the subscription, including the destination address, the maximum allowable amount, the frequency of the payments, and the start time of the subscription.Fields:
Example
Subscription
object:We compute the
Subscription
object ID, a.k.a., SubscriptionID as the SHA-512Half of the following values, concatenated in order:New Transaction Type:
SubscriptionSet
The
SubscriptionSet
transaction is used to create a new subscription. The account owner specifies the destination, amount, frequency, and optionally the start time.Fields:
SubscriptionSet
.Example
SubscriptionSet
Transaction (Create):Example
SubscriptionSet
Transaction (Update):Failure Conditions (Create)
Destination
is the same asAccount
.Amount
is invalid OR <= 0.Frequency
<= SYSTEM_MINIMUM (global value defining the minimum frequency: eg 1 hour or 1 day).Subscription
ledger entry exists.Account
does not have a valid Trustline (Limit, Frozen, Auth, Rippling).StartTime
is less than the current time.Expiration
is less than the current time.Expiration
is less than theStartTime
.Expiration
is less than theNextPaymentTime
.State Changes (Create)
Subscription
ledger entry, initializing all the fields.StartTime
field is included then theNextPaymentTime
is theStartTime
.StartTime
field is not included then theNextPaymentTime
is the current ledger time.Failure Conditions (Update)
Account
is not the same as the txnAccount
.Amount
is invalid OR <= 0.Subscription
ledger entry does not exists.Account
does not have a valid Trustline (Limit, Frozen, Auth, Rippling).Expiration
is less than the current time.Expiration
is less than theStartTime
.Expiration
is less than theNextPaymentTime
.SubscriptionID
submitted andAmount
not present or optionalExpiration
not present.State Changes (Update)
Amount
andExpiration
.New Transaction Type:
SubscriptionCancel
The
SubscriptionCancel
transaction is used to cancel an existing subscription. The transaction must be signed by the account that created the subscription.Fields:
SubscriptionCancel
.Example
SubscriptionCancel
Transaction:Failure Conditions
SubscriptionID
does not exist.Account
is not the owner of theSubscription
OR theDestination
on theSubscription
.State Changes
Subscription
ledger entry associated with the givenSubscriptionID
.New Transaction Type:
SubscriptionClaim
The
SubscriptionClaim
transaction is used by the destination (beneficiary) to pull the funds from the subscriber’s account according to the predefined rules.Fields:
SubscriptionClaim
.Example
SubscriptionClaim
Transaction with XRP:Example
SubscriptionClaim
Transaction with issued asset:Failure Conditions
Account
is not the destination (beneficiary) specified in theSubscription
OR the destination of theSubscription
.Amount
is < 0.Amount
is IOU and IOU is a "bad" currency.Amount
(type) does not equalSubscription
Amount
(type).Amount
exceeds the authorized amount in the subscription.Account
has insufficient fundsAccount
does not have a valid Trustline (Limit, Frozen, Auth, Rippling)Destination
does not have a valid Trustline (Limit, Frozen, Auth, Rippling) (Optional)Destination
does not have enough XRP to cover creation of Trustline (Optional)NextPaymentTime
.State Changes
Amount
from the subscriber’s account.NextPaymentTime
in theSubscription
ledger entry to theNextPaymentTime
plus theFrequency
.Amount
to the destination account.Destination
Trustline (Optional)Subscription
ledger object where time >Expiration
.Zero Value Claims
In this proposal a zero value claim is not a failure condition; no value is transferred but the
NextPaymentTime
field is updated.Transaction Fees & Reserves
It is assumed that all transactions related to subscriptions, including
SubscriptionSet
,SubscriptionCancel
, andSubscriptionClaim
, should incur standard transaction fees inline with regular payments.The
Subscription
ledger entry will require an increase in the account's reserve by the standard amount applicable to other ledger objects on the XRP Ledger. This ensures that accounts cannot create an excessive number of subscriptions without maintaining sufficient reserves.Key Points to Understand
NextPaymentTime
updates upon success, meaning only one pull payment can be successfully claimed within the period.NextPaymentTime
field in theSubscription
ledger entry ensures that payments cannot be claimed more frequently than specified by theFrequency
.Basic Flow Scenarios
User Onboarding
Service Pulls Payment
Payment Failure
Fee Increase
SubscriptionSet
transaction.Cancellation
Backward Compatibility
The introduction of subscription transactions is backward-compatible as it does not alter existing transaction types or the current operation of the XRPL. Users who do not opt into the subscription system will experience no changes. Additionally, the subscription settings will be added as a new ledger object.
Conclusion
The proposed subscription feature introduces a much-needed capability to the XRPL, enabling automated recurring payments in a secure and user-friendly manner. By allowing users to pre-authorize transactions within defined parameters, the system reduces the friction associated with recurring payments, enabling a broader range of services to be supported on the XRP Ledger.
FAQ
A.1 What is the logic/decision making behind only allowing one pull payment?
The primary reason for limiting pull payments to one per subscription period is to simplify the implementation and management of the subscription system. Allowing multiple pull payments within a single period would require maintaining or checking a running balance of how much has already been pulled within that period. This adds significant complexity to the system, as it would need to track multiple transactions, ensure they don't exceed the authorized limit, and adjust the remaining balance accordingly after each pull.
By restricting it to a single transaction per period:
A.2 Why can a payment be pulled that is less than the authorized amount?
The subscription model allows for flexibility in the amount that can be pulled during each payment cycle, provided it does not exceed the maximum authorized amount. This flexibility is important for several reasons:
A.3 Can the Receiver pull multiple transactions within a period?
No, the receiver cannot pull multiple transactions within the same subscription period. The subscription model is designed to allow only one transaction per defined period (e.g., monthly, weekly) as specified in the
SubscriptionSet
transaction.Once a payment is pulled, the system updates the
NextPaymentTime
field, ensuring that no additional payments can be claimed until the next period begins. This safeguard prevents the possibility of multiple deductions from the user's account within the same billing cycle, thereby protecting the user from unauthorized or excessive withdrawals.This mechanism ensures that the subscription operates predictably, aligning with the user’s expectations for regular, recurring payments and preventing potential abuse by the beneficiary.
A.4 Can the user modify the subscription settings after it has been created?
Yes, we have updated the specification to allow for dual use of the
SubscriptionSet
transaction. The account owner will be able to update the amount and optional expiration time fields. To adjust the destination, dTag, frequency or start time, the account owner should cancel the subscription and create a new one.A.5 What prevents a user from signing up for a 12-month subscription and then cancelling it prematurely?
There is nothing within the subscription mechanism itself that prevents a user from cancelling a subscription at any time, even if it was intended for a longer period, such as 12 months. This is similar to how traditional direct debits work in many financial systems, where users can cancel payments at any time.
To mitigate the risks associated with premature cancellation, service providers should enforce their terms of service to handle such situations. The XRP Ledger subscription model provides the technical foundation for recurring payments but does not enforce contractual obligations between the user and the service provider.
A.6 What happens if the user’s account cannot fulfil a subscription payment?
If the user’s account does not have sufficient funds to cover the subscription payment when a
SubscriptionClaim
transaction is submitted, the transaction will fail, and no funds will be transferred. TheNextPaymentTime
will remain unchanged, meaning the subscription will not reset until a successful payment is made.In such cases, the service provider is in a similar position as they would be with a failed direct debit payment in traditional banking systems. They would need to rely on their own policies, such as retrying the payment at a later time or taking action based on the terms of service agreed upon with the user.
A.7 Can the subscription be paused temporarily?
Currently, the subscription model does not include a specific "pause" feature. However, there are two ways to effectively pause a subscription:
Cancel and Recreate : The user can cancel the subscription using a
SubscriptionCancel
transaction and later recreate it with aSubscriptionCreate
transaction when they wish to resume payments. This method gives the user full control over their subscriptions but requires them to manage the timing manually.Pause the Service with the Provider : The user can also pause the service directly with the provider, leaving the subscription in place. In this case, the provider has two options:
Submit a 0-Value Claim : The provider can submit a
SubscriptionClaim
transaction with a 0-value amount, which would be considered valid and would update theNextPaymentTime
without transferring any funds. This allows the subscription to remain active while effectively pausing payments.Partial Payment : The provider could agree to a partial payment for the period (e.g., pausing the service for two weeks and submitting a claim for 50% of the maximum value). This allows the provider to reduce the payment amount based on the paused duration while still maintaining the subscription’s timing and validity.
These options provide flexibility while ensuring that the subscription mechanism can accommodate temporary service pauses without requiring users to fully cancel their subscriptions.
A.8 How is the subscription terminated?
A subscription can be terminated by the user at any time by submitting a
SubscriptionCancel
transaction. Once cancelled, no further payments can be claimed under that subscription, and the associated ledger entry will be removed. If the user wants to restart the subscription, a newSubscriptionCreate
transaction must be submitted. This specification has been updated to also allow the destination (beneficiary) on the subscription to cancel the subscription too.A.9 Can multiple subscriptions be created for the same beneficiary?
Yes, a user can create multiple subscriptions for the same destination, each with different parameters such as amount, frequency, and start time. Each subscription operates independently, allowing for flexible payment arrangements, such as different services or products billed separately by the same beneficiary.
A.10 What safeguards are in place to prevent unauthorized modifications to a subscription?
Subscriptions can be modified once they are created, but with very limited scope, only the amount and expiration time can be changed and this can only be claimed by the account owner.
SubscriptionSet
must be signed by the account owner, ensuring that only the account owner or an authorized delegate can setup or modify a subscription, thereby preventing unauthorized changes.A.11 What considerations have been given to this being used by a bad actor to create network spam?
Nothing would prevent an account owner from setting up hundreds of subscriptions, but this is true of any transaction that generates an account object and is mitigated by the cost of the object reserve.
A bad actor can only claim a subscription, if they are defined as the destination address on the subscription and a claim can only be submitted once during a period; as described above this prevents the potential for spamming of micro transactions within a period. The only other transaction a bad actor can submit would be a cancel but this can only be performed on a subscription to which they are the beneficiary and can only be performed once.
We do not consider this proposal to be open to any new form of spam, but remain open to further discussions should anyone have concerns.
Beta Was this translation helpful? Give feedback.
All reactions