The Subscription Model Comes to Smart Contracts


A new Ethereum Improvement Proposal, 1337, has now brought the subscription model to smart contracts whereby you agree to pay say $10 a month and the payment is automatically taken from the token account.

Austin Griffith of ConsenSys has built a pretty raw implementation which might need a bit more work around the edges, but works very smoothly from the end-users’ perspective.

We naturally gave it a quick test-run and we’re proud to say we have now published our very first smart contract without writing one line of code.

The front-end process is very simple, starting with entering the parameters. We went with the default one of ten DAI per month.

DAI because this works best with tokens. There is wrapped eth (WETH) which can be used, but with eth itself it would be a bit complicated as you’d have to send the eth to a smart-contract and then keep and eye on it, top it up and so on.

With tokens, the money can come out of the account automatically. That’s through the transfer from and the approve function.

We did little else than click deploy and paid about $2 worth in fees. So now we’re given links for the subscriber to give his or her approval.

The process there seems to be just as simple. You simply click sign and it’s all done, you’re now subscribed.

This can work fine if it’s donations. A charity, for example, can very easily deploy a smart contract for almost no cost, and now donors can give 10 a month until they change their mind and cancel the subscription through a cancel function in the smart contracts.

If, however, you expect something in return for the subscription then it might get a bit more complicated because the easiest way to incorporate it would be to sort of turn your website into a dapp, to connect it to the blockchain.

Meaning we here at Trustnodes are quite some way off from incorporating it for our paywall because it would require some reasonably significant coding resources to sort of connect web2 with web3 as well as to have crypto as just an option along fiat.

Making it all convenient – like requiring only crypto subscribers to have MetaMask – is an interesting and perhaps stimulating challenge for a coder (any volunteers are very welcomed). Andrew Redden of Groundhog, who was behind this leet EIP, says:

“TokenSubscription doesn’t activate other smart contract operations. It is a erc20 transferfrom proxy type contract system. It just leverages a meta transaction to enable a third party pay for gas.

For what you’re describing Groundhog can solve as it enables contract calls to be made on a recurring basis. Users own a non custodial wallet and in that wallet they manage their different subscriptions.

We have an iOS application users can use to manage their subscriptions and initiate any transactions or interact with dApps.”

They haven’t yet launched. “We’re close to releasing, we’ll be on Testnet for Demo Day, which is November 16, we’re building on Gnosis Safe, which hasn’t launched on mainnet yet.

As a dependency for our system we want to ensure they launch on main net first. Gnosis Safe should be launched in the coming days,” says Redden.

Gnosis safe has now launched an extensible multi sig wallet which is basically a smart contract that requires say two out of three private keys to sign, rather than just one.

Suggesting we’re still at the infrastructure stage as sort of the basic building blocks have been implemented with much more needed to be built on top.

What is interesting here is the ease of deployment from the end-user’s perspective especially as implemented by the token subscription smart contract and front-end.

That, however, falls quite short of a full implementation except for donations or subscriptions where nothing is expected in return.

An easy next step would be to have templates with some of the main use cases, with these templates then sold or given to devs who can just copy paste and modify if they wish.

In the early days of the internet, for example, every website had to be coded from scratch. Now you just copy paste or install code that is already written.

The same will probably be the case with smart contracts. Much of it is currently being written by hand because much of it doesn’t exist yet, but eventually you’ll probably be able to just copy paste it or add some js code as the token subscription does for donations.

What is also interesting is that tokens appear to be more flexible than eth itself. Tokens are of course just smart contracts so presumably you can code them with whatever functionality you want. While eth itself is a protocol token abiding by the rules of the protocol rather than any smart contract.

Eth itself can be turned into a weth token, but what is beginning to emerge is this synergy between smart contracts and thus between tokens.

As all of it is open source and as each smart contract “knows” the rules of all other smart contracts, they can basically hang out with each other, be best buddies sort of thing, they can create a network.

That can be a very powerful thing which we haven’t yet fully grasped because what is happening here is the creation of a new world where code effectively gains some sort of autonomy in being an “individual” while also being a “social actor.”

Some of this exists already, like bots typing words, but that’s at a very basic level compared to what could happen with smart contracts as there you can have bot functions or bot “businesses” take and give from each other.

Meaning you can have complexity upon complexity in an open commons where everyone knows each other and coordinates with each other based on the rule of code.



Leave a Reply

2 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
2 Comment authors
newest oldest most voted
Notify of

Its a true and right articsl.


Pretty cool. Chainlink should allow you to build recurring contracts that send e.g. $10 worth of ETH/other token every month, instead of a fixed amount of that token where the USD value might fluctuate. Integration could allow an API to call to e.g. Bloomerg, Reuters, and one or two other rate providers like INTL to get an average rate, & convert on the fly each month to the token you’ve specified.