Cryptocurrency

Introducing BCoin, Purse's Bitcoin Javascript Library

Bitcoin Core has a reputation problem among developers. The software works, but navigating it is laborious. Purse, the popular bitcoin wallet service, grew frustrated with the status quo. They built B

By Ray Crawford··3 min read
Introducing BCoin, Purse's Bitcoin Javascript Library

Key Points

  • Bitcoin Core has a reputation problem among developers.
  • The software works, but navigating it is laborious.
  • Purse, the popular bitcoin wallet service, grew frustrated with the status quo.

Bitcoin Core has a reputation problem among developers. The software works, but navigating it is laborious. Purse, the popular bitcoin wallet service, grew frustrated with the status quo. They built BCoin, a new bitcoin library written in Javascript, and claim it operates with less friction than Core.

BCoin is a complete bitcoin node implementation, not a simple wallet or toolkit. Purse constructed it from the ground up. This distinction matters. Most wallet software offloads significant work to external parties. Web wallets hand over your private keys and blockchain verification to their servers. Even desktop wallets that give you control of your private keys depend on servers run by other people to confirm which blockchain is the real one. Service providers handle transaction broadcasting as well.

Advertisement

728×90

For most users managing modest amounts of bitcoin, this arrangement works. You keep your private keys under your thumb, and you can export them elsewhere if a service closes or disappoints you. Merchants, casinos, and exchanges managing thousands of other people's coins face a different problem. They can't afford to rely on third parties. Running your own node eliminates attack vectors. It also protects the network. If miners were the only ones validating transactions, the system would slow and become vulnerable to attacks by dominant pools. Developers building sophisticated applications need direct network access too. APIs exist, but they limit what's possible. You can't account for every use case someone dreams up through an intermediary.

Before BCoin, only two full node implementations existed. Bitcoin Core remained cumbersome and slow. BTCD, written in Go, proved useful for some developers but had limitations. BCoin brings a third option. It runs on Node.js, speaks REST, and supports Bitcoin Core's JSON API. This matters for web development. Javascript has existed far longer than Go. It accumulated mature libraries and frameworks that web developers already know how to use. More developers code in Javascript than Go, which means more available talent.

Chris Jeffery leads the BCoin project. He came from Bitpay, then joined Purse as CTO in 2015. "Re-implementing bitcoin is difficult, however not impossible," he said. "There has been a mentality since the early days that re-implementing the consensus protocol is infeasible. I hope to prove that mentality wrong. There might be hiccups along the way, but it's worth it in order to have an easily hackable version of bitcoin that any developer can quickly get up to speed with and start building."

BCoin includes support for SegWit, MAST, Version Bits, BIP70, BIP150, BIP151, and BIP152. Purse is developing Lightning Network functionality as well. The software can mine bitcoin, validate transactions, store the blockchain, and perform every other function Bitcoin Core performs. Developers find it easier to work with. Purse outlined their vision in a blog post: "Our goal is to accelerate the development of the protocol, solve some scaling issues by implementing Lightning, and enable cool features that will allow for new use cases, like for instance, smart contracts. We want to make Bitcoin great again."

Purse decided they were tired of depending on external services to run their operation. Starting today, they are migrating their entire wallet backend to BCoin. As one of the most-used bitcoin wallets around, the move could encourage other companies to build their own nodes instead of relying on outside providers. Anyone interested can explore the code on Github or follow updates on Twitter.

MiningPool content is intended for information and educational purposes only and does not constitute financial, investment, or legal advice.

Advertisement

728×90

Related Stories

Stay informed

Verifiable crypto journalism, delivered to your inbox.

Weekday mornings. No hype. No financial advice. Just what happened and why it matters.

No spam. Unsubscribe anytime. Read our privacy policy.