swaponline / MultiCurrencyWallet

Bitcoin, Ethereum, ERC20 crypto wallets with 0x and atomic swap exchange.
https://swaponline.github.io
MIT License
479 stars 491 forks source link

SOIP 2491: WebApp/Plugin API framework #2491

Open vladiuz1 opened 4 years ago

vladiuz1 commented 4 years ago

Problem

Absense of API to integrate swaponline into other services. Bascially one of huge pushes to marketing could be integrations.

Similar to oauth, and other similar interfaces, we could provide a range of APIs for CMS, CRMs and other Web engines.

Examples:

OAuth based on swaponline API.

How?

Easy, one way to authenticate yourself on a different website could be using your swaponline keys stored in cookies.

Not only that, some addresses are passwordless - this means:

But wait... Multisigs, if we make bitcoin-based OAuth, and it is done on multisig wallets:

Wallet creation API.

Why?

Well let's say you are a website that needs to assign a bitcoin address to each user, including users who don't have a bitcoin wallet. Or this website wants to make users bitcoin-enabled semi-automatically. There will be use cases like this for sure. It could prompt user to enter bitcoin address, and if the user doesn't have it, it could make a very easy process for user to create bitcoin address, and assign it to her/him in a semi-automatic way:

Multi-signature wallet creation API.

Ok, let's say you want to make an innovative escrow system, it doesn't exist yet but the presense of such wallets as swaponline.io could spark this industry of creating semi-automatic, free, and very simple escrow system.

Let's say you are running a forum, and you are looking to create an escrow for your users. Under each user who connected a swaponline.io wallet to her forum profile, under the avatar you place an "Escrow" button.

image

Now the user who clicks other user's "Escrow" button can create a 2/3 multi signature wallet. The follwing 3 sigs will have authority over the wallet:

  1. The forum's escrow agent, or owner.
  2. The user with the escrow button.
  3. The user who clicked the button.

Those users who click the button, but don't have a swaponline wallet will be prompted to create one automatically. Finally a multisig will be created in 3 users' profiles, and named accordingly.

In order to make such escrow, a plugin must be created for every CMS that may be intersted in such functionality: xenforo, ipb, smf, wordpress, etc.. But in order to make such plugins, we must have API available.

This API need to start with WebApp authentication engine. Very much like other google auth, facebook oauth register web apps that are allowed to user their APIs to authenticate, and do many other things, swaponline should have a framework for webapps that can use thair Web and JSON APIs, including Oauth, wallet creation, atomic swap initialization and other things.

Potential

Promotion through integrations is a very strong push to marketing. Permalinks is to get people share links to their wallets and transaction statuses - this help multiply marketing efforts.

But integrations into different CMSes and engines, by providing plugins for freee, available in our github repo is going to get those first users.

vladiuz1 commented 4 years ago

Advanced User Configs

In order to implement the above, we will need a WebApp registrar - to keep all connected apps unique, and may be to approve apps before user can connect them to Swap.online.

The registrar URL should be configured by default in swaponine.io instance, but could be changed by user in his settings pannel.

By the way the URL of 2FA must also be both server and user-configurable.

For example if someone cloned this repo on his server he could have his own 2FA server by defualt, and WebApp registrar URL also.

But user could go in, edit his advanced settings and change URLs of both Web App registry and 2FA server.

vladiuz1 commented 4 years ago

By the way 2FA could be just one of the connected WebApps. Doesn't matter if its fingerprint, or google auth or sms. Its all connected apps, they, ideally should be designed as plug-ins into swaponline wallet.

vladiuz1 commented 4 years ago

Another WebApp (plugin) that could be added in the future to SwapOnline is Atomic Swap Assistant.

  1. To keep your orders in OrderBook when you are offline (for a fee).
  2. To help execute atomic swap while you are offline.

For all of these things we need to create the right hooks for plugins to use and we need WebApp/Plugin registrar.

vladiuz1 commented 4 years ago

Another WebApp / Plugin idea is to let people connect their own "buy" bitcoin app, where they can offer to buy bitcoin in their interface landing user on SO as a result with balance.