For the impatient, don’t hesitate to head over to the demo site and try it out: https://satoshipay.tangle.works/
You will be given 400 Testnet IOTAs to get started right away. 400i are currently less than €0.0002, and yes, it is possible to transact amounts this small and even lower on IOTA. Simply click “Fund the Channel” in the SatoshiPay panel, which opens when clicking the round orange button at the bottom right of the screen. From there simply follow the instructions on screen and experience IOTAs fee-free transactions on the web.
David Sønstebø, founder IOTA Foundation commented: “We are excited at the arrival of the live demo for the public to interact with both the IOTA and SatoshiPay technology and vision of a true decentralized micropayment ecosystem. This is a hallmark towards a true on-demand economy.”
How does it work?
While the demo looks simple and straightforward at the surface, some complex tasks are performed by your web browser in the background. Here is a step-by-step description of a payment session.
In the demo you will encounter the term “channel” a lot. It is used to describe a temporary payment session established between two parties, with shared trust. Typically a certain amount of funds are moved into the channel’s escrow and the funds can only be moved with the consent of both parties. While the funds are locked inside a channel, the conditions of unlocking the funds are negotiated. Typically it is the split of funds between the parties that will be renegotiated during the channel lifetime. For example: If party A delivers a good or service outside the channel to party B, party B will agree to allocate some of their funds in the channel to party A.
Channels are necessary, because cryptocurrency ledgers take some time to settle transactions. This can vary between a few seconds and a few hours, depending on the underlying ledger or cryptocurrency. In some situations instant or near-instant settlements are needed, and payment channels allow for this happen by aggregating payments before they get settled on the ledger. The settlement of funds closes a channel.
Flash Channels are payment channels on IOTA’s tangle. SatoshiPay’s current production system was one of the first Bitcoin-based micropayment channel implementations on the web.
1. Funding the channel
In this step a pre-funded private key is used to commit funds to the channel. The browser calculates the necessary proof-of-work for the IOTA transaction that moves funds into the channel. Proof-of-work is needed to protect the IOTA network from transaction spam and to secure other transactions made on the network.
Once the proof-of-work is done, you will have 400i to spend:
2. Pay for content
Each time you click a “Pay” button, the amount to be paid, e.g. 50i is allocated from your part of the channel to the recipient’s part of the channel. In a real-world scenario the recipient would be the content publisher. Each channel renegotiation uses cryptographic keys to sign a new version of the final split of funds in the channel and submits the signatures to the content server. The content server verifies the signatures and releases the content.
All purchases are recorded in the browser’s local storage and the purchase signatures will be resubmitted to the content server if the page is reloaded. This way it is ensured that previously paid items do not need to be paid again by the same user:
3. Closing the channel
When closing the channel, a final IOTA transaction is created which splits the channel funds between the sender and recipient. In most cases the split allocated to the recipient is larger than the split that is returned to the sender as “change”. Hence many nanopayments to the recipient are settled in one single IOTA transaction to the recipient’s wallet. The IOTA transaction needs proof-of-work done by the browser again to secure the network.
Once the proof-of-work is done, the IOTA transaction is sent to the network via a broadcasting server and after a few moments the transaction bundle is available for review on public IOTA ledger explorers:
4. Resetting the demo
After pressing “Reset the demo” in the previous screen, the used wallet’s private key is discarded, previous purchases are deleted from the browser’s local storage, and a fresh private key with an empty balance is created:
The road ahead: Stage Three
While working on the proof-of-concept we learned a lot about the inner workings of the tangle, and the Flash Channel protocol, which was only implemented a couple of weeks ago, to make this proof-of-concept a reality. For SatoshiPay to be able to use IOTA in production a couple of things need to be done first:
- Transact on IOTA’s main net. Currently all transactions are done on IOTA’s testnet, with tokens that have no monetary value.
- Calculate proof-of-work on a GPU server farm or in a background process. Currently all proof-of-work is done by the local browser in a foreground process, making the browser unresponsive for a few seconds each time a transaction is sent or a payment is made.
- Fund channels from user wallets. Currently pre-funded private keys are used to fund channels in order to reduce confirmation time before the demo starts.
In addition to IOTA ledger related extensions, SatoshiPay also needs to take care of a few things:
- Allow for publishers to account in IOTAs and be paid out in IOTA or fiat currencies.
- Modify SatoshiPay’s web client, the widget that sits on top of websites and manages the wallet in the browser storage, to receive, hold and transact IOTAs and open/close Flash Channels.
- Build a backend that interacts with and monitors the IOTA tangle for relevant transactions.
Naturally, this becomes a long-term project, and we expect Stage Three of the proof-of-concept, the integration into SatoshiPay’s production system, to take at least a couple of months. Along with increasing maturity of the IOTA transaction and wallet ecosystem over the next months, we look forward to an ongoing partnership with the IOTA Foundation to bring our nanopayments to the masses by using a fee-free and scalable backend.
Working with IOTA has been extremely helpful to position us at the forefront of blockchain and Distributed Ledger Tech innovation, and has given us exposure to new potential clients for our web nanopayment product.
The big picture
Looking at distributed ledgers that go beyond block restrictions to achieve an even higher efficiency, stability and security than the first and second generations of blockchain technology, makes us appreciate the freedom of permissionless innovation that the cryptocurrency space has established. In an evolutionary process new ledgers are being invented for various use cases, each with its unique qualities for organisations and companies in various stages of their lifecycles. We are excited to be part of this fast-moving community and to be inspired to optimise our product with each new iteration of ledger technology.
For their tremendous support to get this demo released, we’d like to thank the great folks over at IOTA: David, Dominik, Lewis, Chris, Kevin, Matthew, Paul, Peter and the rest of the amazingly engaged IOTA community. And of course the SatoshiPay team that worked on this: Erasmus, André, Andy and Piotr. Great work, guys!
Meinhard Benn, CEO at SatoshiPay