By Bernhard Mueller, a software security specialist at ConsenSys Diligence who was recently nominated for the “Best Resesarch” Pwnie Award for his work on the Mythril/MythX smart contract security analyzer.

The idea of Internet cash has a long history, starting from David Chaum’s early “Digital Cash” proposals in the 1980’s and culminating in the invention of Bitcoin, which marked the dawn of truly decentralized digital currencies. The original Bitcoin blockchain recently celebrated its 10th anniversary, chugging along just fine despite having been declared dead 340 times. However, for a number of reasons, blockchain-based currencies haven’t yet gained a lot of traction in e-commerce — the “Internet of Money” has clearly failed to materialize.

What are the Benefits of Trustless E-Commerce?

Given that credit cards and Paypal work perfectly fine, why replace our trusty established e-commerce infrastructure in the first place? Nobody explains it better than Sathoshi Nakamoto himself in his introduction to the Bitcoin whitepaper:

Trustless P2P transactions eliminate costs and payment uncertainties between parties and enable anyone with an Internet connection to instantly participate in global e-commerce. It doesn't require much imagination to see that this is truly disruptive tech (if you lack imagination however, check out Andreas M. Antonopoulos’ excellent The Internet of Money series).

Eliminating the Intermediary: Upwork vs. Bounties Network

A comparison between traditional apps such as Upwork and decentralized apps such as Bounties Network and Gitcoin nicely shows the emerging paradigm shift between web 2.0 and the decentralized web:

Upwork provides a fully featured, proprietary web app that implements escrow, messaging and many other features. Users always interact via the Upwork web application and payments must be performed through the platform (in fact, users are warned to report any requests for bypassing its system immediately). This is an example for a hierarchical architecture.

provides a fully featured, proprietary web app that implements escrow, messaging and many other features. Users always interact via the Upwork web application and payments must be performed through the platform (in fact, users are warned to report any requests for bypassing its system immediately). This is an example for a hierarchical architecture. Bounties Network is a lightweight web 3.0 dapp that connects freelancers to funders. It is open-source and re-using the code for building similar dapps is encouraged. Escrow and payment is mediated by smart contracts on the Ethereum blockchain. This is an example for a flat or peer-to-peer architecture.

The services provided by Upwork and other intermediaries such as credit card providers and payment processors come at a cost. In the Upwork system most of this cost is carried by the “working class”. The project funder only pays a 2.75% payment processing fee while the freelancer pays a variable fee of up to 20%. While part of the fees are likely passed on to funders in the form of higher prices it’s clear who is holding the short end of the stick.

In contrast, since all interactions on Bounties Network are peer-to-peer and mediated by smart contracts, there are no transaction fees besides the gas fees paid for interacting with the Ethereum blockchain. For a project priced at $1,000 the numbers work out as follows:

A freelancer who gets paid $1,000 on Upwork receives $850 and the funder pays a processing fee of $25. The total amount extracted by intermediaries is $175 (17.5%).

The total amount extracted by intermediaries is $175 (17.5%). A freelancer who gets paid 1,000 Dai on Bounties Network receives $1,000. The funder pays Ethereum transaction fees of a few cents.

Of course, the fact that Upwork runs a successful business isn’t a bad thing per sé. After all, Upwork creates jobs, its employees are reasonably happy, and the business presumably pays dividends to its shareholders. That being said, the key question is whether the value provided by Upwork justifies the costs and restrictions it imposes on its users.

From the user’s point of view, the most important difference is that Upwork offers dispute resolution and arbitration services and carries at least some of the counterparty risk. In comparison, Bounties’ escrow smart contract will always behave as programmed. Bounties Network cannot guarantee that project funders will behave fairly (on a side note however, Bounties Network is currently working on integrating Delphi Arbitration).

This tradeoff is not unique to Bounties Network but inherent to decentralized systems: Code is law and there’s no trusted third party to call on if things go wrong (e.g., if you transfer Bitcoin to a merchant and they don’t deliver the goods you can’t call the Bitcoin support line to request a chargeback). On the other hand, by eliminating trusted third parties, transaction cost is reduced to near-zero and users don’t become “products” to be locked into the system and monetized. The net result is higher freedom to transact, less restrictions on users, and less value extracted from each transaction (note that in Gitcoin, users even are actively encouraged to bypass the system and enter long-term agreements).

Roadblocks

If peer-to-peer e-commerce is truly that disruptive, how come that there’s very little adoption so far? The short explanation is that blockchain tech is still in its infancy and that the expectations of an instant paradigm shift that prevailed during the 2017 bubble were vastly overblown. There are still many technical and practical hurdles to overcome:

User experience is sub-par compared to centralized services. It is still far easier to pay with credit card or Paypal.

Scaling issues lead to clogged networks and high transaction fees. The Ethereum base layer can process only 15 transactions per second, not nearly enough to support widespread use.

High volatility that creates unquantifiable risks for both retailers and users.

80% of crypto holders see crypto as an investment. Nobody wants to spend a deflationary asset that’s expected to always increase in fiat value.

During the ICO craze, many projects prioritized a quick money grab over building sustainable business models.

Civil unrest in the Bitcoin ecosystem didn't do much to help accelerate adoption. After a history of complicated wars and chain splits, what remains of the community (specifically, the fraction that gained control of the “BTC” ticker) concluded that Bitcoin is destined to become the world’s dominant store of value, after which it will automatically become a medium of exchange by around 2045. As a consequence, it has become politically impossible to implement reasonable on-chain scaling updates. While there’s vibrant development on the Lightning Network which will enable many promising new use-cases, it’s far from clear if (and when) this will solve the fundamental issues (for instance, it doesn’t address the volatility problem).

In the meantime, Ethereum has established itself as a secure decentralized application platform with a large, enthusiastic community. Unfortunately, Ethereum’s major scaling updates will take longer than expected, but with a little smart contract magic we can already implement efficient and highly usable e-commerce apps on “legacy” Ethereum — it’s just a matter of putting the right pieces together.

Solving Volatility

One of the main reasons that cryptocurrencies aren’t yet widely used for e-commerce is the fact that they’re subject to large, unpredictable price swings in fiat value. Whether we like it or not, most people still think in fiat terms and prefer a coin that is proven to be stable with respect to the US Dollar.

Enter the Dai Stablecoin, a decentralized, crypto-collateral-backed token that is stable relative to the US Dollar. Dai is generated by taking out loans against Ether using the MakerDAO dApp. It has proven resilient in the face of the 2018 bear market, successfully keeping its value pegged to 1 USD despite the price of ETH falling from $1,400 USD in January 2018 to $80 in December 2018.

Thanks to Dai, addressing volatility is as easy as integrating an ERC-20 token. Dai is also a game-changer for a lot of other reasons. For example, a sustainable Dai revenue stream can tie a crypto project to the real-world economy and allow for realistic valuations of security tokens, distribution of dividends via Decentralized Autonomous Trusts, and many other DeFi applications (but let’s not get ahead of ourselves here).

Assuming that a sufficient supply of Dai and other Ethereum-based stablecoins becomes available, this will solve the volatility problem for Ethereum-based e-commerce apps.

Solving User Experience

User experience has been a major pain point for a variety of reasons — far too many to cover in this article. Suffice it to say that huge inroads are being made in terms of browser integration and light clients, both of which must reach maturity before any kind of mainstream adoption becomes possible. In this article I’ll focus on the specific use-case of recurring subscriptions, a very important building block for blockchain e-commerce.

EIP 1337 and Recurring Payments via Meta Transactions

Vanilla ETH transactions are too expensive and cumbersome to allow for small recurring payments, However, for this particular use-case, we can use the pre-commitments models where the user approves multiple recurring payments with a single transaction.

The first implementations of recurring payments on the Ethereum blockchain have emerged in 2018. EIP 1337, a standard that forms the basis of the the Groundhog payment platform, describes a model that works without requiring users to constantly and manually transfer tokens. Another implementation that enables recurring payments with ERC20 tokens is Austin Griffith’s token subscriptions which powers the Gitcoin Grants system.

Case Study: Gitcoin Grants

Gitcoin Grants is a decentralized Patreon that projects can use to get recurring funding for their work in open source software. It’s a straightforward implementation of recurring peer-to-peer payments: The user enters a payment period, amount per period, and number of recurring payments into a form and clicks a button. When the user submits the form, the dapp composes a meta transaction that can be replayed by the subscription smart contract to deduct the specified number of tokens once per payment period.

It is important to note that this is a direct agreement between the granter and grantee mediated by a smart contract. From an UX standpoint, the key improvement to normal crypto payments is that the user only needs to sign a single transaction to approve the recurring transfer. With grants denominated in Dai, this is equivalent to purchasing a monthly subscription plan with USD — but without the need for Visa or Paypal.

Case Study: MythX SaaS Subscriptions

The MythX subscriptions dapp goes one step further by linking recurring stablecoin payments to an AWS-style pay-per-use API subscription model. MythX is a smart contract security analysis service that integrates with developer tools such as Truffle and Visual Studio Code. Users sign up on the MythX website using Metamask and choose an API passsword. Once registered, users can access the API by authenticating with their Ethereum wallet address and the chosen password. Users start on a free license plan and can later upgrade to a paid plan using a familiar web interface.

Recurring subscription plans are priced in USD and can be purchased using Ether or Dai (paid plans are not yet available in the production system).

MythX subscriptions are priced in Dai but users can pay in other cryptocurrencies.

This concept allows MythX to implement a complete SaaS monetization and revenue sharing model on the blockchain, with a user experience that’s almost on par with centralized payment solutions.

Bouquet: Blockchain Subscriptions for the Masses

Writing long medium posts about how awesome blockchain tech could be in the future is great but it’s even better when the claims are backed by working code. To remediate this, we’ll follow up on this article with open source dapp that enables Dai-pegged recurring payments and provides a dapp frontend with a frictionless user experience. It’s called Bouquet and will be built by ConsenSys Token Foundry in collaboration with MythX and the 1337 Alliance.

The first release of Bouquet — Bluebelle — will be forked out of the MythX subscriptions system and provide vastly improved UX to enable e-commerce on Ethereum and foster real-world adoption.

TL;DR

Trustless P2P transactions eliminate costs and payment uncertainties between parties transacting over the Internet. By combining several novel blockchain primitives, such as decentralized stable coins and meta transactions, we can lay the groundwork for widespread trustless e-commerce on the Internet. Bouquet, an open-source reference implementation of recurring payments on Ethereum, will allow anyone to instantly start an online business and offer recurring subscriptions without the need for a trusted third party.