<p>That strongly depends on your definition of <em>complete</em>. There are a number of implementations that implement parts of the Bitcoin node functionality. For example <a href="https://github.com/cdecker/pycoin" rel="noreferrer">cdecker/pycoin</a> has a solid network implementation, but does not include wallet management code and validation logic. <a href="https://github.com/richardkiss/pycoin" rel="noreferrer">richardkiss/pycoin</a> on the other hand has some of the wallet logic, but lacks networking. Other libraries include:</p>

<ul>
<li><a href="https://github.com/vbuterin/pybitcointools" rel="noreferrer">vbuterin/pybitcointools</a></li>
<li><a href="https://github.com/petertodd/python-bitcoinlib" rel="noreferrer">petertodd/python-bitcoinlib</a></li>
</ul>

<p>But as far as I know there is no standalone client that includes a wallet as well as the networking code.</p>

CC BY-SA 3.0
2015-12-07T12:11:17.370Z
2015-12-07T12:11:17.370Z
cdecker
<p>Check out <a href="https://github.com/jamesob/tinychain/" rel="nofollow noreferrer">Tinychain</a>.</p>

<p>It isn't complete and will never inter-operate with the real Bitcoin network, but it is a "code golf" approach to implementing all the Bitcoin core ideas (validation, POW mining, peer-to-peer architecture, data structures like TxIn/TxOut/Block, etc) in Python.</p>

CC BY-SA 4.0
2018-07-17T20:24:20.120Z
2019-03-16T04:55:18.447Z
2019-03-16T04:55:18.447Z
justinmoon
<p>There is a project, which is a complete bitcoin implementation in python.
The source code at <a href="https://github.com/csunny/py-bitcoin" rel="nofollow noreferrer">https://github.com/csunny/py-bitcoin</a></p>

CC BY-SA 4.0
2018-07-17T06:10:53.763Z
2018-07-17T06:10:53.763Z
陈发强
<p>AFAIK, there is no fundamental issues with implementing a complete bitcoin node using python, there is even some cool projects of Bitcoin full node in Python</p>

<ul>
<li><a href="https://github.com/samrushing/caesure" rel="nofollow noreferrer">https://github.com/samrushing/caesure</a></li>
<li><a href="https://bitcointalk.org/index.php?topic=94645.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=94645.0</a></li>
</ul>

CC BY-SA 4.0
2015-12-07T17:29:43.580Z
2019-03-05T16:33:44.807Z
2019-03-05T16:33:44.807Z
Wats0ns
<p>I recently became aware that python-bitcoinlib is not a full bitcoin node implementation, but rather a set of tools to work with bitcoin-core cpp. I would like to know whether there are some fundamental issues with implementing a complete bitcoin node using python? Also if it were to be tried as a code-golf exercise (the shortest code to get the full node running) how many lines of code will it amount to in python ??</p>

CC BY-SA 3.0
2015-12-07T18:48:10.020Z
Performance-wise this would be bad idea, as Python dynamic programming language tend to use more RAM on data structures. It could be however interesting exercise.
Mikko Ohtamaa
CC BY-SA 3.0
2015-12-07T19:15:32.343Z
@MikkoOhtamaa: Python is perfectly capable of handling the performance requirements of a Bitcoin node. The answers so far point to several projects that do this.
Greg Hewgill
CC BY-SA 3.0
2015-12-07T19:17:17.423Z
@GregHewgill: But none of those can serve as a complete replacement for bitcoin-core, right?
user2277550
CC BY-SA 3.0
2015-12-07T19:19:42.833Z
@user2277550: I don't see why not. There's no underlying reason why Python would be unsuitable for this purpose. It's certainly more than capable enough. It sounds like you're asking whether somebody else has already written in Python exactly what you have in mind. Maybe, maybe not. But it's possible to do so.
Greg Hewgill
CC BY-SA 3.0
2015-12-07T19:20:23.983Z
@GregHewgill: Links or didn't happen :)
Mikko Ohtamaa
CC BY-SA 3.0
2015-12-07T19:21:08.833Z
@MikkoOhtamaa: The existing answers already have several links. I'm not sure what more you're asking for.
Greg Hewgill
CC BY-SA 3.0
2015-12-07T19:25:13.917Z
@GregHewgill: Ok thanks - seeing the answer now.
Mikko Ohtamaa
<bitcoin-core><python>
A complete bitcoin implementation in Python?
user2277550
# A complete bitcoin implementation in Python?

(Asked by: username_0 on 2015-12-07)

I recently became aware that python-bitcoinlib is not a full bitcoin node implementation, but rather a set of tools to work with bitcoin-core cpp. I would like to know whether there are some fundamental issues with implementing a complete bitcoin node using python? Also if it were to be tried as a code-golf exercise (the shortest code to get the full node running) how many lines of code will it amount to in python ??

**Tags:** bitcoin-core, python

> **Comments:**
> **username_1**: Performance-wise this would be bad idea, as Python dynamic programming language tend to use more RAM on data structures. It could be however interesting exercise.  
> **username_2**: @MikkoOhtamaa: Python is perfectly capable of handling the performance requirements of a Bitcoin node. The answers so far point to several projects that do this.  
> **username_0**: @GregHewgill: But none of those can serve as a complete replacement for bitcoin-core, right?  
> **username_2**: @username_0: I don't see why not. There's no underlying reason why Python would be unsuitable for this purpose. It's certainly more than capable enough. It sounds like you're asking whether somebody else has already written in Python exactly what you have in mind. Maybe, maybe not. But it's possible to do so.  
> **username_1**: @GregHewgill: Links or didn't happen :)  
> **username_2**: @MikkoOhtamaa: The existing answers already have several links. I'm not sure what more you're asking for.  
> **username_1**: @GregHewgill: Ok thanks - seeing the answer now.  

---

## 4 answers

### Answer by username_6 on 2015-12-07. Score: 8 | Accepted answer

AFAIK, there is no fundamental issues with implementing a complete bitcoin node using python, there is even some cool projects of Bitcoin full node in Python

* <https://github.com/samrushing/caesure>
* <https://bitcointalk.org/index.php?topic=94645.0>


---

### Answer by username_3 on 2015-12-07. Score: 7

That strongly depends on your definition of *complete*. There are a number of implementations that implement parts of the Bitcoin node functionality. For example [username_3/pycoin](https://github.com/username_3/pycoin) has a solid network implementation, but does not include wallet management code and validation logic. [richardkiss/pycoin](https://github.com/richardkiss/pycoin) on the other hand has some of the wallet logic, but lacks networking. Other libraries include:

* [vbuterin/pybitcointools](https://github.com/vbuterin/pybitcointools)
* [petertodd/python-bitcoinlib](https://github.com/petertodd/python-bitcoinlib)

But as far as I know there is no standalone client that includes a wallet as well as the networking code.


---

### Answer by username_4 on 2018-07-17. Score: 2

Check out [Tinychain](https://github.com/jamesob/tinychain/).

It isn't complete and will never inter-operate with the real Bitcoin network, but it is a "code golf" approach to implementing all the Bitcoin core ideas (validation, POW mining, peer-to-peer architecture, data structures like TxIn/TxOut/Block, etc) in Python.


---

### Answer by username_5 on 2018-07-17. Score: 1

There is a project, which is a complete bitcoin implementation in python.
The source code at <https://github.com/csunny/py-bitcoin>


---

