API payment protocol

Assumptions

Possible protocol

Service discovery

Unfunded anonymous access

Establishing funding

API usage

Channel management

Channel operation

  1. The wallet creates a non-final prefunding transaction.
  2. The service runs a spent balance ideally less than or equal to the current prefunding.
  3. Each request from the wallet is accounted to the spent balance and a receipt returned in the response. If there are insufficient funds to complete the request, it may incur a 402 response or interrupt any streamed data.
  4. When the wallet wishes to finalise the prefunding transaction, it does so through an API on the hosting service.
  5. If the last prefunding transaction is finalised, the wallet needs to create a new one. This will ideally happen before the previous funding is completely spent to avoid 402 or more ambiguous interrupted responses.

More bits and pieces

Multiple balances?

Service discovery

Final thoughts

--

--

--

ElectrumSV developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Blockchain Rock Tower

Top 50 Blockchain Interview Questions

Why blockchain gaming needs a transformation now

Ethereum: The Largest Altcoin

CRYPTOGRAPHIC PROOF OF POOP WILL SAVE THE WORLD!

Introducing the RiveX Mobile Wallet, RX Mobile — Access all your assets and RiveX Dapps on the go!

Decentralized Finance

Hic Et Nunc Smart Contracts (Part 1)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Roger Taylor

Roger Taylor

ElectrumSV developer

More from Medium

Move and Solidity Full Range Features Comparison | Starcoin

OnFinality provides Hosting and API Services to Unique Network

How to Create BEP20 Token? BEP20 Token Create Tool

QuickSwap’s New UI Alpha $50,000 Bug Bounty