bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
2.98k stars 811 forks source link

bitcoinjs-lib / bitcore for bitcoin primitives? #56

Closed mvayngrib closed 7 years ago

mvayngrib commented 8 years ago

one of the things that makes me wary of using this library is that it hasn't been tested in the wild. What is the main reason not to use something like bitcoinjs-lib or bitcore for the bitcoin primitives: tx, block, chain, etc? I can think of one - bitcoinjs-lib uses ecurve vs elliptic (and soon vs secp256k1-node i hope. bitcore uses elliptic i think), but a fork of bitcoinjs-lib or bitcore with the EC implementation swapped out would still feel more reliable.

chjj commented 8 years ago

Well, you're right. Bcoin in its current form is not yet stable. I wouldn't recommend using it in production yet. It's still under rapid development, but I want to get v1.0.0 out soon. We will be using bcoin in production at purse.io eventually, so I hope you can take comfort in that we will battle test it for everyone. I will mark it stable at that point.

Even if I wanted to use objects from other libraries, I feel like it would cause more instability than it resolves. It would require a massive rewrite of a lot of the codebase.

It might sound strange coming from a former bitpay employee, but I'm much more comfortable using bcoin than bitcore (or bitcoinjs). I think it's designed in a much more understandable way. It's what drew me to bcoin (and actually bitcoin itself) in the first place. I could have messed around with bitcore or bitcoinjs, and I had seen them before, but the API seemed incomprehensible to me at the time. Bcoin seemed to be designed in a much saner way, by someone whose code I was familiar with, and who also happens to be one of the best node.js devs around. The night I looked at the bcoin code 2 years ago was the first time I actually started to understand how bitcoin worked. I think bcoin is the right way to do bitcoin for that reason, but I'm biased.

Just rest assured that I have a huge incentive to maintain this code and make sure it works. We will be using bcoin for our new wallet server, which is why bcoin now has a full block database, a mempool, and a bip44/45 wallet built-in.

mvayngrib commented 8 years ago

@chjj thanks for taking the time to write that. You addressed one of my main concerns, namely that big libraries that rebuild everything from scratch die from lack of maintenance, shortage of maintainers, and testing by the real world. I have enormous respect for @indutny's work, and it's great to hear that this library makes bitcoin more comprehensible. I remember the days of not comprehending all too clearly :) Glad to hear you have a big incentive to maintain this, and looking forward to using and hopefully contributing to this project.

chjj commented 7 years ago

Closing now. BCoin's primitives have matured quite a bit, and are the only JS implementation of bitcoin primitives in existence that conform to consensus (they're really the only option here).