All Projects โ†’ austintgriffith โ†’ delegated-execution-subscriptions

austintgriffith / delegated-execution-subscriptions

Licence: MIT license
๐Ÿ•ฐ๏ธโš™๏ธRecurring delegated execution through an identity proxy with meta transactions

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to delegated-execution-subscriptions

token-subscription
๐Ÿ’ฐ๐Ÿ•ฐ๏ธ๐Ÿ“‹[EIP 1337 POC] Recurring subscriptions on the Ethereum blockchain powered by meta transactions.
Stars: โœญ 73 (+73.81%)
Mutual labels:  meta, transactions, subscriptions, eip948, eip1337
Harbour-MVP
Building a decentralised p2p meta-tx relayer network [MVP] Codename: Harbour ## We solved this problem: https://medium.com/tabookey/1-800-ethereum-gas-stations-network-for-toll-free-transactions-4bbfc03a0a56
Stars: โœญ 31 (-26.19%)
Mutual labels:  meta, transactions, execution, delegated
Bouncer Proxy
๐Ÿ‘ฎ๐Ÿป๐Ÿ›ฐ Ethereum identity proxy contract that bounces meta transactions of etherless accounts.
Stars: โœญ 142 (+238.1%)
Mutual labels:  meta, transactions
reference-client
*client* reference implementation of subscriptions on Ethereum
Stars: โœญ 15 (-64.29%)
Mutual labels:  subscriptions, eip1337
standard
the EIP and reference implementation which we will submit to the EIP repo.
Stars: โœญ 40 (-4.76%)
Mutual labels:  subscriptions, eip1337
beaker
A distributed, transactional key-value store.
Stars: โœญ 63 (+50%)
Mutual labels:  transactions
wp-term-meta-ui
A base UI class for a term metadata user interface
Stars: โœญ 23 (-45.24%)
Mutual labels:  meta
flashbots
Flashbots utilities in Go: Blocks & Transactions API, and tools to spot bundle and block irregularities
Stars: โœญ 32 (-23.81%)
Mutual labels:  transactions
meta-extractor
Super simple and fast html page meta data extractor with low memory footprint
Stars: โœญ 38 (-9.52%)
Mutual labels:  meta
unity-sdk
Unity SDK for cross-platform (iOS and Android) in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
Stars: โœญ 38 (-9.52%)
Mutual labels:  subscriptions
graphql-aws-iot-server
Serverless server for graphql queries, mutations and subscriptions using aws iot https://www.npmjs.com/package/graphql-aws-iot-server
Stars: โœญ 39 (-7.14%)
Mutual labels:  subscriptions
tg-inviter
Generate personal invite links for Telegram channels
Stars: โœญ 26 (-38.1%)
Mutual labels:  subscriptions
MetaCPP
C++ Reflection & Serialization using Clang's LibTooling
Stars: โœญ 44 (+4.76%)
Mutual labels:  meta
oge
Page metadata as a service
Stars: โœญ 22 (-47.62%)
Mutual labels:  meta
killbill-admin-ui
Kill Bill Administrative UI engine
Stars: โœญ 39 (-7.14%)
Mutual labels:  subscriptions
BulletproofJS
Set of JavaScript based tools and Ethereum Solidity contracts for BulletProof based range proofs and confidential transactions
Stars: โœญ 26 (-38.1%)
Mutual labels:  transactions
shell-agent
Agent program installed on remote host, help you to execute shell command on the remote host via HTTP. Also help to transport file to/from remote host.
Stars: โœญ 41 (-2.38%)
Mutual labels:  execution
process-handbook
๐Ÿ“— Contains our processes, questions and journey to creating ateam
Stars: โœญ 70 (+66.67%)
Mutual labels:  meta
netlify-stripe-subscriptions
An example of managing subscriptions with the Stripe Customer Portal and Netlify Identity.
Stars: โœญ 96 (+128.57%)
Mutual labels:  subscriptions
development
An Enterprise-ready Cloud Services Management Software
Stars: โœญ 38 (-9.52%)
Mutual labels:  subscriptions

๐Ÿ•ฐ๏ธโš™๏ธ Delegated Execution Subscriptions [EIP1337/EIP948]

Recurring Ethereum transactions executed through an identity proxy using a single, replayed meta transaction.

A subscriber deploys and funds a proxy (identity) contract. Then, any whitelisted etherless account signs a single off-chain meta transaction that will be periodically sent on-chain to trigger an Ethereum transaction. This transaction can be sending ETH, interacting with a contract, or even deploying a new contract.

This project is the culmination of months of research and two previous POCs:

Bouncer Proxy The bouncer-proxy POC demonstrated how an identity contract could be deployed as a proxy and then interacted with using meta transactions. Etherless accounts could be whitelisted and sign off-chain transactions which are then submitted on-chain by incentivized relayers, cryptographically proven, and used to execute typical Ethereum transactions.

Token Subscriptions Token subscriptions are a bare minimum POC to demonstrate how meta transactions can be used with a timestamp nonce trick to replay a single transaction on a periodic basis. We used the ERC20 approve/allowance to control the flow of tokens without the need of other complicated mechanics.

Delegated Execution Subscriptions bring these two concepts together.

An identity contract is controlled by whitelisted, etherless accounts to periodically interact with the blockchain signaled by a single meta transaction. A set it and forget it subscription periodically executes standard Ethereum transactions powered by an incentivized layer of meta transaction relayers.

Demo

screencast.png

https://byoc.metatx.io

Development

See full development history on this byoc branch.

Abstract

A subscriber can deploy a subscription contract to act as their identity and proxy their meta transactions. The subscriber must only sign a single, off-chain meta transaction to start the flow of recurring Ethereum transactions. This meta transaction is periodically sent to the subscription contract via an incentivized relayer network.

The single meta transaction becomes valid using a timestamp nonce (instead of a traditional replay attack nonce). The meta transaction can be submitted, proven valid through ecrecover(), and then a call(), delegateCall(), or create() is executed by the subscription contract.

The subscriber is in full control of the subscription contract but any account they whitelist can also create new subscriptions or pause existing ones without having to hold any ETH. Further, the terms of each subscription is explicitly signed in the meta transaction and can't be manipulated.

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.

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

ethereum/EIPs#1337

Standard

    enum SubscriptionStatus {
        ACTIVE,
        PAUSED,
        CANCELLED,
        EXPIRED
    }
    enum Operation {
        Call,
        DelegateCall,
        Create
    }
  event ExecuteSubscription(
      address from, //the subscriber
      address to, //the target contract or account
      uint256 value, //amount in wei of ether sent from this contract to the to address
      bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)
      Operation operation, //ENUM of operation
      uint256 periodSeconds, //the period in seconds between payments
      address gasToken, //the address of the token to pay relayer (0 for eth)
      uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)
      address gasPayer //the address that will pay the tokens to the relayer
  );
    function updateWhitelist(
        address _account,
        bool _value
    )
        public
        onlyOwner
        returns (bool)
    function isSubscriptionPaid(
        bytes32 subscriptionHash,
        uint256 gracePeriodSeconds
    )
        external
        view
        returns (bool)
    function getSubscriptionStatus(
        bytes32 subscriptionHash
    )
        public
        view
        returns  (uint256)
    function getSubscriptionHash(
        address from, //the subscriber
        address to, //the target contract or account
        uint256 value, //amount in wei of ether sent from this contract to the to address
        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)
        Operation operation, //ENUM of operation
        uint256 periodSeconds, //the period in seconds between payments
        address gasToken, //the address of the token to pay relayer (0 for eth)
        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)
        address gasPayer //the address that will pay the tokens to the relayer
    )
        public
        view
        returns (bytes32)
    function getSubscriptionSigner(
        bytes32 subscriptionHash, //hash of subscription
        bytes signature //proof the subscriber signed the meta trasaction
    )
        public
        pure
        returns (address)
    function isSubscriptionReady(
        address from, //the subscriber
        address to, //the publisher
        uint256 value, //amount in wei of ether sent from this contract to the to address
        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)
        Operation operation, //ENUM of operation
        uint256 periodSeconds, //the period in seconds between payments
        address gasToken, //the address of the token to pay relayer (0 for eth)
        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)
        address gasPayer, //the address that will pay the tokens to the relayer
        bytes signature //proof the subscriber signed the meta trasaction
    )
        public
        view
        returns (bool)
    function isValidSignerTimestampAndStatus(
        address from,
        address signer,
        bytes32 subscriptionHash
    )
        public
        view
        returns (bool)
    function getModifyStatusHash(
        bytes32 subscriptionHash,
        SubscriptionStatus status
    )
        public
        view
        returns (bytes32)
    function isValidModifyStatusSigner(
        bytes32 subscriptionHash,
        SubscriptionStatus status,
        bytes signature
    )
        public
        view
        returns (bool)
    function modifyStatus(
        bytes32 subscriptionHash,
        SubscriptionStatus status,
        bytes signature
    )
        public
        returns (bool)
    function executeSubscription(
        address from, //the subscriber
        address to, //the target contract or account
        uint256 value, //amount in wei of ether sent from this contract to the to address
        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)
        Operation operation, //ENUM of operation
        uint256 periodSeconds, //the period in seconds between payments
        address gasToken, //the address of the token to pay relayer (0 for eth)
        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)
        address gasPayer, //the address that will pay the tokens to the relayer
        bytes signature //proof the subscriber signed the meta trasaction
    )
        public
        returns (bool)

Acknowledgments

Original Proposal: https://gist.github.com/androolloyd/0a62ef48887be00a5eff5c17f2be849a

Directly extended from: https://github.com/austintgriffith/token-subscription

Huge thanks to Owocki & Seagraves of Gitcoin and Andrew Redden of Groundhog for the guidance!!!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].