bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.6k stars 2.08k forks source link

Address generation is slow (BIP32) #1110

Closed silence-may closed 6 years ago

silence-may commented 6 years ago

"bitcoinjs-lib": "^3.3.2" excuse me : I need to check the balance and transaction through the address. So I need to query the information of 20 addresses at a time(API:https://blockchain.info/multiaddr?active=$address|$address), but the generation address is very slow, which takes about 20 seconds. How can I improve efficiency? my way : 1.first , Generate node from m / purpose' / coin_type' / account'/change 2.derivePath(0-20) Please give me some advice ,Thanks a lot!

dcousens commented 6 years ago
  1. Generate node from m / purpose' / coin_type' / account'/change
  2. derivePath(0-20)

Probably use derive, not derivePath, but, even then, this is the generally advised (and efficient) algorithm that you are using.

I suspect your issue will go away with 4.0.0 being released very soon (this week, or next). As we are using libsecp256k1 (native) and bn.js in that release, and you can be assured they are nearly 10x as fast.

silence-may commented 6 years ago

Thank you for your answer and look forward to the release of the new version.

silence-may commented 6 years ago

hello,When will the new version be released? I have been waiting!

junderw commented 6 years ago

Very soon! We are just ironing out a few details.

silence-may commented 5 years ago

Hello, I see that the latest release is 4.0.1. Will the efficiency of this version be significantly improved? When can I install the latest version with npm?

junderw commented 5 years ago
  1. Yes.
  2. Soon, we just need to publish to npm.