diff --git a/piper_standard.md b/piper_standard.md new file mode 100644 index 0000000..99e7771 --- /dev/null +++ b/piper_standard.md @@ -0,0 +1,37 @@ +From https://github.com/ethereum/EIPs/issues/948#issuecomment-376213214 + +

I think that price should be out-of-scope for this standard. This feels a lot like scope creep to me and doesn't need to be part of the core API. Ideally whatever protocol rules are decided allow for this type of behavior.

+

From the subscriber's side:

+ +

From the providers's side:

+ +

And to think a bit about protocol:

+

Building on the token ERCs seems valuable here since they already setup primatives for transferring and approving. What's missing is the concept of time based approvals. I think that we can get very close to hitting all of the use cases above with the following API

+

Subscription API

+

I think we need the following minimal API

+ +

These probably have Payment and Cancelled events that would get fired.

+

An ERC20 token based subscription contract.

+

With the above, we can now think about what a subscription paid in ERC20 tokens might look like. A minimal implementation would require the following fields.

+ +

The triggerPayment method would call token.transfer(provider, (now - last_payment_at) * tokens_per_time_unit / time_unit)`.

+

Closing Thoughts

+

Given the wide set of use cases for subscriptions and the wide array of different business requirements, I think this specification will be most useful if it sticks to trying to define an interface, and leaves the exact implementation up to the provider. A provider would either provide their own implementation of a subscription contract, requiring the user to fund the contract once it was created for them, or they might delegate to a 3rd party service which offers pre-built subscription contracts that fit their business requirements.

\ No newline at end of file