Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Project: Muliti-Coin API #33

Open
skycoin-manager opened this issue Feb 11, 2018 · 5 comments
Open

New Project: Muliti-Coin API #33

skycoin-manager opened this issue Feb 11, 2018 · 5 comments

Comments

@skycoin-manager
Copy link
Contributor

skycoin-manager commented Feb 11, 2018

Create a folder called coin-api

This is a command line application.

  • it will launch a web-server on local host and expose a JSON HTTP interface
  • will have two executables, a server and a command line RPC
  • will have a simple minimal web front end or dash board

https://godoc.org/github.com/skycoin/skycoin/src/cip

We will define an interface that implements 5 functions for each coin

  • generate address, private keys, pubkeys from deterministic seed
  • check the balance (and get unspent outputs) for an address
  • sign a transaction
  • inject transaction into network
  • check the status of a transaction (tracks transactions by transaction hash)

For generating addreses, see


For Bitcoin

Only implement

  • generating addresses, private keys, secret keys
  • checking balance

The can come back and focus on

  • creating transactions
  • injecting transactions
  • monitoring the status of transactions later

For Skycoin, implement all of the above, using the golang CLI command.


Later we may want to implement "Watch Address" functionality, which allows us to add an address as a "watch address" and get events (deposits) to that address.


Each coin will have one or more implementations of the interface

  • Bitcoin will have an implementation that uses https://godoc.org/github.com/skycoin/skycoin/src/cipher for address generation and which gets outputs from blockchain.info
  • Bitcoin will have an interface that uses https://godoc.org/github.com/skycoin/skycoin/src/cip for address generation and which gets outputs and address balances from the bitcoin scanning wallet in the services repo (in this repo)
  • Bitcoin may have another implementation that connects to a BCTD node directly (like the scanning wallet does)
  • Skycoin will have one interface implementation that connects to a Skycoin node over the CLI

There will be a CLI with a command for

  • listing the coins supported by the wallet API
  • listing the coins and implementations supported by the API
  • instantiating an instance of a coin interface (an instance of BTC, scanning wallet) on the multi-coin API server

There will be a JSON HTTP api that includes

  • a ping command (just responds to ping, used for checking server status and returning stats)
  • a url that returns a list of the interfaces (coin and type) instantiated on the multi-coin server instance (and the status of the interface, etc whether it is connected to the server and working).
  • a url for checking the balance of an address for a given coin, against a given interface
  • a url for injecting a transaction for a particular coin and interface (with transactions encoded in hex)
  • a url for checking the status of a transaction
  • a url for checking the validity of a transaction for a given coin and interface (optional, may not be needed)

  • applications will be able to use the multi-coin server from an HTTP JSON API

  • we may have a command line interface (CLI) for doing operations against the coin api server (will jus call the JSON HTTP API)

  • The coin API server will have a golang api, that can be imported and allow applications in golang to generate public keys, private keys and addresses for each supported coin, from a deterministic seed (supported for Bitcoin and Skycoin in the cipher library).


There will be a web-interface, showing which scanning wallet implementations have be instantiated.

The web-interface will also show the connection status of instantiated interfaces (is the coin-api server connected to the skycoin node? is the coin api-server successfully connected to a BCTD node, etc).


Note:

Architecture Choices

  • we can have one server that supports multiple coins (BTC, SKY, etc) with one server and multiple interface instantiations (one for BTC, one for SKY)
  • OR we can create a server that exposes the coin-api, but which requires the coin/interface type specified at startup and only allows one instantiation
@nutmix
Copy link
Contributor

nutmix commented Feb 11, 2018

@Sigma-Software This is one for consideration for implementation by Sigma.

@AlexSugak
Copy link
Contributor

@skycoin-manager @nutmix how is this related to #29 ? Looks like a similar task.

@sKudryashov
Copy link
Contributor

sKudryashov commented Feb 12, 2018

@AlexSugak @skycoin-manager @nutmix yes, seems #29 has to be turned down in favor of this task

@AlexSugak
Copy link
Contributor

@sKudryashov you already working on this, right?

@sKudryashov
Copy link
Contributor

@AlexSugak yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants