Go to file
Matias Alejo Garcia 20d4d279b7 Update LICENCE 2015-03-05 10:34:18 -03:00
db . 2015-02-24 14:43:46 -03:00
lib Merge pull request #120 from matiaspando/fix/changeName 2015-03-04 14:30:05 -03:00
test replace with github repo 2015-03-04 12:44:28 -03:00
.coveralls.yml Create .coveralls.yml 2015-02-20 12:13:02 -03:00
.gitignore . 2015-02-24 14:43:46 -03:00
.travis.yml add coveralls to travis 2015-02-21 15:27:30 -03:00
LICENCE Update LICENCE 2015-03-05 10:34:18 -03:00
Makefile add phony 2015-02-20 13:59:42 -03:00
README.md Update README.md 2015-03-05 10:30:48 -03:00
app.js Change copay to bitcore wallet service 2015-03-04 14:05:32 -03:00
index.js export storage 2 2015-03-03 19:33:29 -03:00
package.json bump to version 0.0.3, npm bwc dep 2015-03-04 16:23:49 -03:00

README.md

bitcore-wallet-service

NPM Package Build Status Coverage Status

A Multisig HD Bitcore Wallet Service.

Description

Bitcore Wallet Service facilitates multisig HD wallets creation and operation thru a (hopefully) simple and intuitive REST API.

BWS can usually be installed within minutes and acommodates all the needed infrastruture for peers in a multisig wallet to communicate, and operate with minimun server trust.

See [Bitcore-wallet-client] (https://github.com/bitpay/bitcore-wallet-client) for the official client library that communicates to BWS, and verifies its responsed. Also check [Bitcore-wallet] (https://github.com/bitpay/bitcore-wallet) for a simple CLI wallet implementation that relays on BWS.

BWS have a extensive test suite but have not been tested on production environments yet and have been recently released, so it it is still should be considered BETA software.

Security Considerations

  • Private keys are never sent to BWS. Copayers store them locally.
  • Extended public keys are stored on BWS. This allows BWS to easily check wallet balance, send offline notifications to copayers, etc.
  • During wallet creation, the initial copayer creates a wallet secret that contains a private key. All copayers need to prove they have the secret by signing their information with this private key when joining the wallet. The secret should be shared using secured channels.
  • A copayer could join the wallet more than once, and there is no mechanism to prevent this. See [wallet]((https://github.com/bitpay/bitcore-wallet)'s confirm command, for a method for confirming copayers.
  • All BWS responses are verified:
  • Addresses and change addresses are derived independently and locally by the copayers from their local data.
  • TX Proposals templates are signed by copayers and verified by others, so the BWS cannot create or tamper with them.

REST API

Authentication

In order to access a wallet, clients are required to send the headers:

  x-identity
  x-signature

Identity is the Peer-ID, this will identify the peer and its wallet. Signature is the current request signature, using requestSigningKey, the m/1/1 derivative of the Extended Private Key.

See Bitcore Wallet Client for implementation details.

GET Endpoinds

/v1/wallets/: Get wallet information

Returns:

/v1/txhistory/: Get Wallet's transaction history

Returns:

  • History of incomming and outgoing transactions of the wallet. The list is returned complete (Pagination and filter are ToDos) Each item has the following fields: https://github.com/bitpay/bitcore-wallet-service/issues/121
  • proposalId
  • creatorName
  • message
  • actions array ['createdOn', 'type', 'copayerId', 'copayerName', 'comment']

/v1/txproposals/: Get Wallet's pending transaction proposals and their status Returns:

/v1/addresses/: Get Wallet's main addresses (does not include change addresses)

Returns:

/v1/balance/: Get Wallet's balance

Returns:

  • totalAmount: Wallet's total balance
  • lockedAmount: Current balance of outstanding transaction proposals, that cannot be used on new transactions.

POST Endpoinds

/v1/wallets/: Create a new Wallet

Required Arguments:

  • name: Name of the wallet
  • m: Number of required peers to sign transactions
  • n: Number of total peers on the wallet
  • pubKey: Wallet Creation Public key to check joining copayer's signatures (the private key is unknown by BWS and must be communicated by the creator peer to other peers).

Returns:

  • walletId: Id of the new created wallet

/v1/wallets/:id/copayers/: Join a Wallet in creation Required Arguments:

  • walletId: Id of the wallet to join
  • name: Copayer Name
  • xPubKey: Peer's extended public key
  • xPubKeySignature: xPubKey signature with Wallet Creation private key

Returns:

  • copayerId: Assigned ID of the copayer (to be used on x-identity header)
  • wallet: Object with wallet's information

/v1/txproposals/: Add a new transaction proposal Required Arguments:

  • toAddress: RCPT Bitcoin address
  • amount: amount (in satoshis) of the mount proposed to be transfered
  • proposalsSignature: Signature of the proposal by the creator peer, using prososalSigningKey.
  • (opt) message: Encrypted private message to peers

Returns:

/v1/addresses/: Request a new main address from wallet

Returns:

/v1/txproposals/:id/signatures/: Sign a transaction proposal

Required Arguments:

  • signatures: All Transaction's input signatures, in order of appearance.

Returns:

/v1/txproposals/:id/broadcast/: Broadcast a transaction proposal

Returns:

/v1/txproposals/:id/rejections: Reject a transaction proposal

Returns:

DELETE Endpoinds

/v1/txproposals/:id/: Deletes a transaction proposal. Only the creator can delete a TX Proposal, and only if it has no other signatures or rejections

Returns:

`