multisig HD Bitcore Wallet Service
A Multisig HD Bitcore Wallet Service.
Bitcore Wallet Service facilitates multisig HD wallets creation and operation through a (hopefully) simple and intuitive REST API.
BWS can usually be installed within minutes and accommodates all the needed infrastructure for peers in a multisig wallet to communicate and operate – with minimum server trust.
See Bitcore-wallet-client for the official client library that communicates to BWS and verifies its response. Also check Bitcore-wallet for a simple CLI wallet implementation that relies on BWS.
BWS is been used in production enviroments for Copay Wallet, Bitpay App wallet and others.
More about BWS at https://blog.bitpay.com/announcing-the-bitcore-wallet-suite/
git clone https://github.com/axerunners/bitcore-wallet-service-axe.git
cd bitcore-wallet-service-axe && npm start
This will launch the BWS service (with default settings) at http://localhost:3232/bws/api
.
BWS needs mongoDB. You can configure the connection at config.js
BWS supports SSL and Clustering. For a detailed guide on installing BWS with extra features see Installing BWS.
BWS uses by default a Request Rate Limitation to CreateWallet endpoint. If you need to modify it, check defaults.js’ Defaults.RateLimit
BWS can be used with PM2 with the provided app.js
script:
pm2 start app.js --name "bitcoin-wallet-service"
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.
/v1/wallets/
: Get wallet information
Returns:
/v1/txhistory/
: Get Wallet’s transaction history
Optional Arguments:
Returns:
skip
& limit
params. Each item has the following fields:/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:
/v1/txnotes/:txid
: Get user notes associated to the specified transaction.
Returns:
txid
as a string./v1/fiatrates/:code
: Get the fiat rate for the specified ISO 4217 code.
Optional Arguments:
Returns:
/v1/wallets/
: Create a new Wallet
Required Arguments:
Returns:
/v1/wallets/:id/copayers/
: Join a Wallet in creation
Required Arguments:
Returns:
/v1/txproposals/
: Add a new transaction proposal
Required Arguments:
Returns:
.id
is probably needed in this case./v1/addresses/
: Request a new main address from wallet
Returns:
path
is returned so client can derive the address independently and check server’s response./v1/txproposals/:id/signatures/
: Sign a transaction proposal
Required Arguments:
Returns:
.status
is probably needed in this case./v1/txproposals/:id/broadcast/
: Broadcast a transaction proposal
Returns:
.status
is probably needed in this case./v1/txproposals/:id/rejections
: Reject a transaction proposal
Returns:
.status
is probably needed in this case./v1/addresses/scan
: Start an address scan process looking for activity.
Optional Arguments:
/v1/txconfirmations/
: Subscribe to receive push notifications when the specified transaction gets confirmed.
Required Arguments:
/v1/txnotes/:txid/
: Modify a note for a tx.
/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:
.id
is probably needed in this case./v1/txconfirmations/:txid
: Unsubscribe from transaction txid
and no longer listen to its confirmation.
Recomended to complete config.js file:
/v1/pushnotifications/subscriptions/
: Adds subscriptions for push notifications service at database.
/v2/pushnotifications/subscriptions/
: Remove subscriptions for push notifications service from database.