Author

Topic: How reliable is this browser based full node? (Read 756 times)

newbie
Activity: 2
Merit: 0
Maintainer of bcoin here. Running it in the browser was my proof of concept. I always thought it would be cool to say "just visit this web page and you have a full node." Its target platform is node.js, but I will keep it compatible with the browser in case anyone wants to do some cool browser stuff. (The web app I made is garbage and looks terrible, but I just wanted to prove it was possible).

A few things about how it works in the browser:

It uses IndexedDB to store the blockchain in the browser. Unfortunately, IndexedDB has varied limits depending on the browser. Storing the mainnet blockchain is probably unrealistic unless it is pruned: as long as the browser can allow a ~2gb database (1288 blocks + 415k headers + 38 million utxos), you should theoretically be able to sync main in the browser.

It uses Web Workers when executing scripts, so transaction verification is parallelized and also will not block the main browser thread.

In order to connect to the p2p network, it uses websockets to connect to a server which proxies the websockets to tcp sockets (if someone were to make a chrome extension with bcoin, this part wouldn't be necessary since the chrome api allows raw tcp access).

As far as reliability/stability goes, it's hard to say. What I _can_ tell you is that I've had bcoin running on a server for several weeks now, fully synced. It's running on main, testnet, and segnet4. It's validated all three of those blockchains. It's been verifying/serving blocks, maintaining its mempool, relaying txs, etc. The tough little bastard is holding up.

I can also tell you that during the last 6 months, my time has been spent painstakingly reimplementing consensus code. BCoin passes all of the bitcoin unit tests for scripts and transactions, but at the end of the day, it's tough to test all consensus rules and edge cases. The only way to really test its reliability is to run it, which I've been doing. I hope others find the time to play around with it if they're interested.

Just a warning, it is in an alpha state. The API might change over time.
hero member
Activity: 521
Merit: 522
Developer - EthicHacker - BTC enthusiast

you need to read through the source and do proper test to answer this question. Its nodeJS based and fully browserifiable. I think it will use a lot of RAM and diskmem and maybe overload your browser (it has full block database). But i have not tested this yet. Anyway seems to be a very interesting project from researchers point of view. Thank you for pointing out - Will watch the progress.

#edit: i see, other people may abuse this project.. i hope not.
Jump to: