Sponsored subscriptions
Every subscription has a sponsor which is the account paying the processing fee. By default, the creator of the subscription will be set as sponsor for example if the subscription is created with createSubscription
. However, the createSubscriptionWithSponsor
function allows creating a subscription with a given sponsor provided a valid signature from that address is provided.
The signature provided is an EIP-712 signature of the SponsorPermit
struct which takes the following form:
Inside SponsorPermit
are the parameters used to create the subscription, ensuring the sponsor that their signature can only be used to create a subscription they themselves have signed. Tools for creating and signing a SponsorPermit
can be found in the sub2 SDK.
Sponsored payments provide an abstraction for the protocol, allowing users to only pay the exact subscription amount. For instance, an online service provider may sponsor their customers' subscriptions by covering the fees. In this scenario, the service provider generates a signature over a SponsorPermit
struct, outlining the terms of the deal. This signature and permit are then used with the createSubscriptionWithSponsor
method upon creating the subscription.
Last updated