{"id":15647801,"url":"https://github.com/austintgriffith/delegated-execution-subscriptions","last_synced_at":"2025-07-04T21:07:14.287Z","repository":{"id":78713731,"uuid":"147236266","full_name":"austintgriffith/delegated-execution-subscriptions","owner":"austintgriffith","description":"🕰️⚙️Recurring delegated execution through an identity proxy with meta transactions","archived":false,"fork":false,"pushed_at":"2018-09-05T02:24:15.000Z","size":137,"stargazers_count":43,"open_issues_count":2,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-30T13:29:13.233Z","etag":null,"topics":["delegated","eip1337","eip948","ethereum","execution","meta","subscriptions","transactions"],"latest_commit_sha":null,"homepage":"https://byoc.metatx.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austintgriffith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-03T17:45:11.000Z","updated_at":"2022-11-27T13:58:36.000Z","dependencies_parsed_at":"2023-05-22T02:30:51.111Z","dependency_job_id":null,"html_url":"https://github.com/austintgriffith/delegated-execution-subscriptions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/austintgriffith/delegated-execution-subscriptions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fdelegated-execution-subscriptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fdelegated-execution-subscriptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fdelegated-execution-subscriptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fdelegated-execution-subscriptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austintgriffith","download_url":"https://codeload.github.com/austintgriffith/delegated-execution-subscriptions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fdelegated-execution-subscriptions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263619803,"owners_count":23489562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delegated","eip1337","eip948","ethereum","execution","meta","subscriptions","transactions"],"created_at":"2024-10-03T12:21:11.910Z","updated_at":"2025-07-04T21:07:14.268Z","avatar_url":"https://github.com/austintgriffith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🕰️⚙️ Delegated Execution Subscriptions [EIP1337/EIP948]\n\n\u003e Recurring Ethereum transactions executed through an identity proxy using a single, replayed meta transaction.\n\nA 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.\n\nThis project is the culmination of months of research and two previous POCs:\n\n[**Bouncer Proxy**](https://github.com/austintgriffith/bouncer-proxy)\n    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.\n\n[**Token Subscriptions**](https://github.com/austintgriffith/token-subscription)\n    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.\n\n\u003e **Delegated Execution Subscriptions** bring these two concepts together.\n\nAn 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.\n\n## Demo\n\n[![screencast.png](https://user-images.githubusercontent.com/2653167/45005225-6d23cb00-afaf-11e8-9ce1-874dd8cb1980.jpg)](https://youtu.be/g0o2jEkyYKw)\n\n[https://byoc.metatx.io](https://byoc.metatx.io)\n\n## Development\n\nSee full development history on [this byoc branch](https://github.com/austintgriffith/token-subscription/commits/byoc).\n\n## Abstract\n\nA _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.\n\nThe 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_.\n\nThe _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.\n\nMeta 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.\n\n\n```\n ██╗██████╗ ██████╗ ███████╗\n███║╚════██╗╚════██╗╚════██║\n╚██║ █████╔╝ █████╔╝    ██╔╝\n ██║ ╚═══██╗ ╚═══██╗   ██╔╝\n ██║██████╔╝██████╔╝   ██║  \n ╚═╝╚═════╝ ╚═════╝    ╚═╝  -EIP-\n ```\n\n [https://github.com/ethereum/EIPs/pull/1337](https://github.com/ethereum/EIPs/pull/1337)\n\n\n## Standard\n\n\n```SOLIDITY\n    enum SubscriptionStatus {\n        ACTIVE,\n        PAUSED,\n        CANCELLED,\n        EXPIRED\n    }\n    enum Operation {\n        Call,\n        DelegateCall,\n        Create\n    }\n```\n\n\n```SOLIDITY\n  event ExecuteSubscription(\n      address from, //the subscriber\n      address to, //the target contract or account\n      uint256 value, //amount in wei of ether sent from this contract to the to address\n      bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)\n      Operation operation, //ENUM of operation\n      uint256 periodSeconds, //the period in seconds between payments\n      address gasToken, //the address of the token to pay relayer (0 for eth)\n      uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)\n      address gasPayer //the address that will pay the tokens to the relayer\n  );\n```\n\n\n```SOLIDITY\n    function updateWhitelist(\n        address _account,\n        bool _value\n    )\n        public\n        onlyOwner\n        returns (bool)\n```\n\n\n```SOLIDITY\n    function isSubscriptionPaid(\n        bytes32 subscriptionHash,\n        uint256 gracePeriodSeconds\n    )\n        external\n        view\n        returns (bool)\n```\n\n\n\n```SOLIDITY\n    function getSubscriptionStatus(\n        bytes32 subscriptionHash\n    )\n        public\n        view\n        returns  (uint256)\n```\n\n\n\n```SOLIDITY\n    function getSubscriptionHash(\n        address from, //the subscriber\n        address to, //the target contract or account\n        uint256 value, //amount in wei of ether sent from this contract to the to address\n        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)\n        Operation operation, //ENUM of operation\n        uint256 periodSeconds, //the period in seconds between payments\n        address gasToken, //the address of the token to pay relayer (0 for eth)\n        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)\n        address gasPayer //the address that will pay the tokens to the relayer\n    )\n        public\n        view\n        returns (bytes32)\n```\n\n\n```SOLIDITY\n    function getSubscriptionSigner(\n        bytes32 subscriptionHash, //hash of subscription\n        bytes signature //proof the subscriber signed the meta trasaction\n    )\n        public\n        pure\n        returns (address)\n```\n\n\n```SOLIDITY\n    function isSubscriptionReady(\n        address from, //the subscriber\n        address to, //the publisher\n        uint256 value, //amount in wei of ether sent from this contract to the to address\n        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)\n        Operation operation, //ENUM of operation\n        uint256 periodSeconds, //the period in seconds between payments\n        address gasToken, //the address of the token to pay relayer (0 for eth)\n        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)\n        address gasPayer, //the address that will pay the tokens to the relayer\n        bytes signature //proof the subscriber signed the meta trasaction\n    )\n        public\n        view\n        returns (bool)\n```\n\n\n\n```SOLIDITY\n    function isValidSignerTimestampAndStatus(\n        address from,\n        address signer,\n        bytes32 subscriptionHash\n    )\n        public\n        view\n        returns (bool)\n```\n\n\n\n\n```SOLIDITY\n    function getModifyStatusHash(\n        bytes32 subscriptionHash,\n        SubscriptionStatus status\n    )\n        public\n        view\n        returns (bytes32)\n```\n\n\n\n```SOLIDITY\n    function isValidModifyStatusSigner(\n        bytes32 subscriptionHash,\n        SubscriptionStatus status,\n        bytes signature\n    )\n        public\n        view\n        returns (bool)\n```\n\n\n\n```SOLIDITY\n    function modifyStatus(\n        bytes32 subscriptionHash,\n        SubscriptionStatus status,\n        bytes signature\n    )\n        public\n        returns (bool)\n```\n\n\n\n```SOLIDITY\n    function executeSubscription(\n        address from, //the subscriber\n        address to, //the target contract or account\n        uint256 value, //amount in wei of ether sent from this contract to the to address\n        bytes data, //the encoded transaction data (first four bytes of fn plus args, etc)\n        Operation operation, //ENUM of operation\n        uint256 periodSeconds, //the period in seconds between payments\n        address gasToken, //the address of the token to pay relayer (0 for eth)\n        uint256 gasPrice, //the amount of tokens or eth to pay relayer (0 for free)\n        address gasPayer, //the address that will pay the tokens to the relayer\n        bytes signature //proof the subscriber signed the meta trasaction\n    )\n        public\n        returns (bool)\n ```\n\n\n\n## Acknowledgments\n\nOriginal Proposal: [https://gist.github.com/androolloyd/0a62ef48887be00a5eff5c17f2be849a](https://gist.github.com/androolloyd/0a62ef48887be00a5eff5c17f2be849a)\n\nDirectly extended from: [https://github.com/austintgriffith/token-subscription](https://github.com/austintgriffith/token-subscription)\n\nHuge thanks to [Owocki](https://twitter.com/owocki) \u0026 [Seagraves](https://twitter.com/captnseagraves) of [Gitcoin](https://gitcoin.co/) and [Andrew Redden](https://twitter.com/androolloyd) of [Groundhog](https://groundhog.network) for the guidance!!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustintgriffith%2Fdelegated-execution-subscriptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustintgriffith%2Fdelegated-execution-subscriptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustintgriffith%2Fdelegated-execution-subscriptions/lists"}