"xpub.deriveChild is not a function" when trying to generate wallet address


#1

1. Problem description:
I’m trying to create wallets on the testnet. The process of creating the wallet itself works just fine, however, whenever I try to create addresses to wallets (whether using the terminal or Copay), the server simply shuts down and that error is thown:

2. Creating the wallet and trying to generate the address:

$ wallet-create -h http://127.0.0.1:3232/bws/api --testnet 'testwallet' 1-1
 * Testnet Wallet Created.
 * Saving file /home/me/.wallet.dat

$ wallet -h http://127.0.0.1:3232/bws/api address #THAT'S WHEN THE ERROR IS THROWN BOTH HERE AND IN THE TERMINAL RUNING BITCORED.
{ Wallet service connection error.
Error
    at NodeError (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/bitcore-wallet-client/lib/errors/index.js:20:41)
    at /home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/bitcore-wallet-client/lib/api.js:799:17
    at Request.callback (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/superagent/lib/node/index.js:688:3)
    at ClientRequest.<anonymous> (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/superagent/lib/node/index.js:615:10)
    at Object.onceWrapper (events.js:293:19)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:191:7)
    at Socket.socketOnEnd (_http_client.js:394:9)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:188:7)
  message: 'Wallet service connection error.',
  stack: 'Wallet service connection error.\nError\n    at NodeError (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/bitcore-wallet-client/lib/errors/index.js:20:41)\n    at /home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/bitcore-wallet-client/lib/api.js:799:17\n    at Request.callback (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/superagent/lib/node/index.js:688:3)\n    at ClientRequest.<anonymous> (/home/me/.nvm/versions/node/v7.8.0/lib/node_modules/bitcore-wallet/node_modules/superagent/lib/node/index.js:615:10)\n    at Object.onceWrapper (events.js:293:19)\n    at emitOne (events.js:96:13)\n    at ClientRequest.emit (events.js:191:7)\n    at Socket.socketOnEnd (_http_client.js:394:9)\n    at emitNone (events.js:91:20)\n    at Socket.emit (events.js:188:7)' }

3. Terminal running ‘bitcored’. (error is thrown when I try to run ‘wallet -h http://127.0.0.1:3232/bws/api address’).

error: uncaught exception: TypeError: xpub.deriveChild is not a function
at /home/me/testnetnode/node_modules/bitcore-wallet-service/lib/model/address.js:50:17
at arrayMap (/home/me/testnetnode/node_modules/bitcore-wallet-service/node_modules/lodash/index.js:1406:25)
at Function.map (/home/me/testnetnode/node_modules/bitcore-wallet-service/node_modules/lodash/index.js:6710:14)
at Function.Address._deriveAddress (/home/me/testnetnode/node_modules/bitcore-wallet-service/lib/model/address.js:48:22)
at Function.Address.derive (/home/me/testnetnode/node_modules/bitcore-wallet-service/lib/model/address.js:72:21)
at Wallet.createAddress (/home/me/testnetnode/node_modules/bitcore-wallet-service/lib/model/wallet.js:155:25)
at createNewAddress (/home/me/testnetnode/node_modules/bitcore-wallet-service/lib/server.js:868:26)
at /home/me/testnetnode/node_modules/bitcore-wallet-service/lib/server.js:899:16
at /home/me/testnetnode/node_modules/bitcore-wallet-service/lib/server.js:389:12
at /home/me/testnetnode/node_modules/bitcore-wallet-service/lib/storage.js:119:12

4. What I have tried already:

  • Reinstalling everything.

Any thoughts on how to solve this?


(Chen Wang Bor) #2

Same errors to me, anyone can help to fix it?


(Mathew Cormier) #3

Same thing here. Did you find a solution?


(Hideoussquid) #4

Also asking, did anyone find a solution to this?
Oddly enough, I get this using a variant of the bitcore-wallet-service rewritten for zcash.