πŸ’°πŸ•°οΈπŸ“‹[EIP 1337 POC] Recurring subscriptions on the Ethereum blockchain powered by meta transactions.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
SomeStableToken merge Aug 30, 2018
Subscription working Sep 1, 2018
backend working Sep 1, 2018
public clevis init Aug 26, 2018
src clean up the title page Aug 30, 2018
tests all manual tests are passing, time for testnet Aug 26, 2018
.gitattributes merge Aug 30, 2018
.gitignore clevis init Aug 26, 2018
.soliumignore merge Aug 30, 2018
.soliumrc.json merge Aug 30, 2018
LICENSE LICENSE Sep 4, 2018
README.md Update README.md Sep 3, 2018
attach.sh clevis init Aug 26, 2018
clevis.json patch up frontend Aug 26, 2018
contracts.clevis working for most tests but broken with contract tries to pay gas in t… Aug 26, 2018
package.json merge Aug 30, 2018
run.sh clevis init Aug 26, 2018
stop.sh clevis init Aug 26, 2018
yarn.lock clevis init Aug 26, 2018

README.md

πŸ’°πŸ•°οΈπŸ“‹ EIP 1337 POC - Token Subscriptions on Ethereum

Subscribers sign a single off-chain meta transaction that is periodically resubmitted to the blockchain to create a trustless set-it-and-forget-it subscription model on Ethereum.

https://sub.metatx.io

Demo

screencast.png

Abstract

A publisher provides an ongoing service to multiple subscribers and wishes to receive compensation on a periodic interval. The publisher can deploy a lightweight subscription contract to represent their service. Then, the publisher sends subscribers a link to terms which they sign as a single, off-chain meta transaction. This meta transaction is sent to the publisher and/or a third party network that is incentivized with a gasToken.

Immediately, and repeatedly after the agreed upon the period, the single meta transaction becomes valid using a timestamp or block number nonce (instead of a traditional replay attack nonce). The single, signed meta transaction can be submitted, proven valid through ecrecover(), and the transferFrom() of the pre-approved erc20 token from subscriber to publisher is executed.

The subscriber is in full control of the flow of tokens using the approve() function built into the ERC20 standard. They must pre-approve the subscription contract that represents the service before any transfer can happen and they can revoke the allowance at any time to pause or cancel the subscription without touching the original meta transaction. Further, the terms of the subscription are explicitly signed in the meta transaction and can't be manipulated.

The subscription contract also holds logic representing the subscription status for a given account so other smart contracts can verify on-chain that a subscriber is actively paying the publisher.

Since this model works with any token that follows the approve() and transferFrom() standard, a stable token might serve as the best option for long running, monthly subscriptions. This shields both publisher and subscriber from price fluctuations.

Meta transactions can be submitted by any relayer and the relayer can be incentivized with a gasToken. This token can be paid by the publisher, the subscriber, or the subscription contract. The subscription contract can also reimburse the relayers directly with Ethereum. If funds are to be paid from the subscription contract, the subscriptionHash must be signed by the publisher.

 β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•—β•šβ•β•β•β•β–ˆβ–ˆβ•—β•šβ•β•β•β•β–ˆβ–ˆβ•‘
β•šβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•    β–ˆβ–ˆβ•”β•
 β–ˆβ–ˆβ•‘ β•šβ•β•β•β–ˆβ–ˆβ•— β•šβ•β•β•β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•”β• 
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘  
 β•šβ•β•β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•    β•šβ•β•  -EIP-

https://github.com/ethereum/EIPs/pull/1337