<p>You could, but this is very ill-advised to do so.</p>
<p>Bitcoin consensus rules being implementation-defined rather than specification-defined re-implementation are unfortunately <em>insecure</em>.<br />
Thanks to <code>libbitcoinconsensus</code>, it has been made safer to build transactions with external tool. There <a href="https://github.com/search?l=JavaScript&amp;q=bitcoin&amp;type=Repositories" rel="nofollow noreferrer">might be a nodejs implementing transaction building</a> logic out there, but you really should not validate blocks with a nodejs (or any language for that matter) re-implementation of Bitcoin.</p>
<p>Regarding your desire to learn more about the inner working of a node you can learn from external Bitcoin tool in your favorite language but at the end of the day if you want to learn how the protocol is really defined, you'll have to dig into the <a href="https://github.com/bitcoin/bitcoin" rel="nofollow noreferrer">original implementation code</a>.</p>

CC BY-SA 4.0
2020-08-06T12:15:49.440Z
Yes, i was able to find some tutorials on creating bitcoin addresses and signing transactions in Node.js, creating raw transactions and then feeding them to the network.

I thought that bitcoin peers just interact on specific ports with something like websockets but any node can choose their own implementation and how they interact with the network. And that there can be implementations in different languages.

I guess I have to delve deeper into the Bitcoin protocol.
Ivelin 
CC BY-SA 4.0
2020-08-06T12:23:19.837Z
I see that the original implementation is mostly in C++ (which I don't know any of it unfortunately). Is there any specific reason for it to be in C++? What if I want to create a new cryptocurrency different from bitcoin with nodes running in Node.js? Is that a bad idea, running on Node.js and why? Perhaps mining will be slower in Node :)
Ivelin 
CC BY-SA 4.0
2020-08-06T12:31:21.380Z
Regarding the reason behind C++ i'm afraid you'd need to ask Satoshi :-). Regarding why is re-implement Bitcoin is a bad idea, well, see the answer above. Regarding a new copy of Bitcoin, I think it would be interesting that you post a new question like "why is it a bad idea to create my new '''cryptocurrency''' ? " I and many others would be thrived to answer as that comes up really often !
Antoine Poinsot
CC BY-SA 4.0
2020-08-06T11:04:16.417Z
2020-08-06T11:04:16.417Z
Antoine Poinsot
<p>Yes, bcoin:</p>
<p><a href="http://bcoin.io/" rel="nofollow noreferrer">http://bcoin.io/</a></p>
<p><a href="https://github.com/bcoin-org/bcoin" rel="nofollow noreferrer">https://github.com/bcoin-org/bcoin</a></p>
<p>bcoin is a modular Bitcoin library for nodejs with full node and SPV node functionality, as well as a scalable BIP44 wallet used in production by several Bitcoin businesses including Purse.io.</p>
<p>Bcoin has the second-fastest initial sync time out of all available full node implementations (after Bitcoin Core, of course): <a href="https://blog.lopp.net/bitcoin-node-performance-sync-tests/" rel="nofollow noreferrer">https://blog.lopp.net/bitcoin-node-performance-sync-tests/</a></p>

CC BY-SA 4.0
2020-08-06T12:27:41.053Z
2020-08-06T12:27:41.053Z
pinhead
<p>Are there bitcoin full node implementations running on Node.js?</p>
<p>Node.js is the server side language that I'm most familiar with so I was wondering if I can run a full bitcoin node on Node.js?</p>
<p>I just want to learn more about how a node works and possibly experiment writing my own cryptocurrency implementation in Node.js as that's what I'm most comfortable with.</p>

<bitcoin-core><full-node><nodes><node.js>
Can you run a full Bitcoin node on Node.js?
Ivelin 
# Can you run a full Bitcoin node on Node.js?

(Asked by: username_0 on 2020-08-06)

Are there bitcoin full node implementations running on Node.js?

Node.js is the server side language that I'm most familiar with so I was wondering if I can run a full bitcoin node on Node.js?

I just want to learn more about how a node works and possibly experiment writing my own cryptocurrency implementation in Node.js as that's what I'm most comfortable with.

**Tags:** bitcoin-core, full-node, nodes, node.js


---

## 2 answers

### Answer by username_2 on 2020-08-06. Score: 3 | Accepted answer

Yes, bcoin:

<http://bcoin.io/>

<https://github.com/bcoin-org/bcoin>

bcoin is a modular Bitcoin library for nodejs with full node and SPV node functionality, as well as a scalable BIP44 wallet used in production by several Bitcoin businesses including Purse.io.

Bcoin has the second-fastest initial sync time out of all available full node implementations (after Bitcoin Core, of course): <https://blog.lopp.net/bitcoin-node-performance-sync-tests/>


---

### Answer by username_1 on 2020-08-06. Score: 0

You could, but this is very ill-advised to do so.

Bitcoin consensus rules being implementation-defined rather than specification-defined re-implementation are unfortunately *insecure*.  
Thanks to `libbitcoinconsensus`, it has been made safer to build transactions with external tool. There [might be a nodejs implementing transaction building](https://github.com/search?l=JavaScript&q=bitcoin&type=Repositories) logic out there, but you really should not validate blocks with a nodejs (or any language for that matter) re-implementation of Bitcoin.

Regarding your desire to learn more about the inner working of a node you can learn from external Bitcoin tool in your favorite language but at the end of the day if you want to learn how the protocol is really defined, you'll have to dig into the [original implementation code](https://github.com/bitcoin/bitcoin).

> **Comments:**
> **username_0**: Yes, i was able to find some tutorials on creating bitcoin addresses and signing transactions in Node.js, creating raw transactions and then feeding them to the network.  I thought that bitcoin peers just interact on specific ports with something like websockets but any node can choose their own implementation and how they interact with the network. And that there can be implementations in different languages.  I guess I have to delve deeper into the Bitcoin protocol.  
> **username_0**: I see that the original implementation is mostly in C++ (which I don't know any of it unfortunately). Is there any specific reason for it to be in C++? What if I want to create a new cryptocurrency different from bitcoin with nodes running in Node.js? Is that a bad idea, running on Node.js and why? Perhaps mining will be slower in Node :)  
> **username_1**: Regarding the reason behind C++ i'm afraid you'd need to ask Satoshi :-). Regarding why is re-implement Bitcoin is a bad idea, well, see the answer above. Regarding a new copy of Bitcoin, I think it would be interesting that you post a new question like "why is it a bad idea to create my new '''cryptocurrency''' ? " I and many others would be thrived to answer as that comes up really often !  

---

