Bitcoin Forum
April 20, 2024, 03:08:20 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Caesure - a Python Bitcoin Client  (Read 10689 times)
Sam Rushing (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0



View Profile WWW
July 08, 2011, 08:38:19 PM
 #1

I've started a new bitcoin client in Python.

https://github.com/samrushing/caesure

-Sam
1713582500
Hero Member
*
Offline Offline

Posts: 1713582500

View Profile Personal Message (Offline)

Ignore
1713582500
Reply with quote  #2

1713582500
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713582500
Hero Member
*
Offline Offline

Posts: 1713582500

View Profile Personal Message (Offline)

Ignore
1713582500
Reply with quote  #2

1713582500
Report to moderator
1713582500
Hero Member
*
Offline Offline

Posts: 1713582500

View Profile Personal Message (Offline)

Ignore
1713582500
Reply with quote  #2

1713582500
Report to moderator
wumpus
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
July 08, 2011, 09:10:19 PM
 #2

Great, I'll certainly be following this. A native Python client is nice, as it means not having to compile the bitcoin c++ client on a VPS, and it will be easier to integrate with Python (web) applications Smiley

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Sam Rushing (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0



View Profile WWW
July 08, 2011, 10:10:11 PM
 #3

Yup, one of my goals is to cut down on outside dependencies as much as possible - especially packages that require compiling C extensions.  Right now it runs completely standalone, all that's needed is a Python install and a shared openssl library.  The networking is done via the asyncore/asynchat modules, and openssl is accessed via ctypes.
zwierzak
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile WWW
July 09, 2011, 01:28:17 AM
 #4

So with this in future I can replace bitcoind+JSON or this is just API for bitcoind?
Martin P. Hellwig
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
July 09, 2011, 02:21:49 AM
 #5

So with this in future I can replace bitcoind+JSON or this is just API for bitcoind?

As far as I can read the code (I am sure that Sam will refactor the code ones he is happy with the functionality, so it is easier to read/maintain/extend for mere mortals  Wink ), this is aimed to be a full implementation of the reference c++ bitcoin implementation.

So in other words, where you used to run the bitcoin client downloaded from bitcoin.org, you can alternatively use his python one instead.

Good to see I am not the only one working on a Python implementation, a little bit of competition is a good thing :-)

Cheers Sam, good work!
wumpus
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
July 09, 2011, 08:29:56 AM
 #6

So with this in future I can replace bitcoind+JSON or this is just API for bitcoind?
The goal is to replace a full client, there are tons of JSON-API bindings for Python already Smiley

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
zwierzak
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile WWW
July 09, 2011, 11:19:08 PM
 #7

Maybe your https setup is broken ?
I end up with this msg :

sh-4.1# git clone https://github.com/samrushing/caesure
Initialized empty Git repository in /opt/caesure/.git/
error:  while accessing https://github.com/samrushing/caesure/info/refs

"git clone" works well for me with http:// though )
Report to github, not us. We can't do anything with this.
Sam Rushing (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0



View Profile WWW
July 10, 2011, 11:12:29 PM
 #8

To Sam Rushing :

Maybe your https setup is broken ?
I end up with this msg :

sh-4.1# git clone https://github.com/samrushing/caesure
Initialized empty Git repository in /opt/caesure/.git/
error:  while accessing https://github.com/samrushing/caesure/info/refs

"git clone" works well for me with http:// though )

Just try:
   $ git clone git://github.com/samrushing/caesure.git
 
mikegogulski
Sr. Member
****
Offline Offline

Activity: 360
Merit: 250



View Profile WWW
July 12, 2011, 11:34:33 AM
 #9

Bump for sheer awesome sauce, and because Sam used to buy beer for me when I was still underage.

FREE ROSS ULBRICHT, allegedly one of the Dread Pirates Roberts of the Silk Road
alkor
Full Member
***
Offline Offline

Activity: 136
Merit: 100


View Profile
July 12, 2011, 10:28:15 PM
 #10

There was also this effort to create an alternative bitcoin client in python, but it was never completed:

https://github.com/phantomcircuit/bitcoin-alt

I think the hard part was to do the scripting.
Lis
Sr. Member
****
Offline Offline

Activity: 292
Merit: 251


Spice must flow!


View Profile
July 14, 2011, 07:32:29 AM
Last edit: January 20, 2019, 06:56:56 PM by Lis
 #11

please correct:
file bitcoin.py
line 90
s = ('%x' % base58_decode (s[1:])).decode ('hex_codec')  =>  s = ('%048x' % base58_decode (s[1:])).decode ('hex')

if hash160 has zero on the left side then function has problem

===
good job, thanks

You would like to thank?
btc: 14tAPpwzrfZqBeFVvfBZHiBdByYhsoFofn
Sam Rushing (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0



View Profile WWW
July 15, 2011, 12:50:25 AM
 #12

please correct:

if hash160 have zero at the start, function is having problems

Thanks, Fremen Lis.  It's on the way in.

-Sam
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
September 15, 2011, 12:04:22 AM
 #13

I have my own python library I started building from Sam's code a few months ago.  I have all calculations implemented (including scripting!) but not networking.  Perhaps we should team up.  Though I suspect you (Sam) may not like the fact I replaced all your BTC classes with my own:  I did it for the fun of implementing the stuff myself in my own way, and learned a LOT.  I know from my job that the best way to understand a system is to try implementing it yourself--and holy hell I've learned a lot from this process...

This library does all scripting except for a few OP_codes, but it does do OP_CHECKSIG, meaning that the library can successfully verify and sign transactions (using Lis' raw ECDSA-in-python module).  I wanted to get some networking implemented, and was actually planning to just pull your code in, but maybe you'd be interested in contributing to this library and doing it yourself...? 

I've been caught up the last couple months trying to implement a C++/SWIG backend because python is slow as dirt.   Unfortunately I've been getting nowhere, and finding I need to do some more planning and reorganization before I'll get it right.  So right now, I don't have anyway to scan the blockchain or maintain a wallet.   But I have grand plans for doing so, and am anxious to get this functionality implemented!

If you're interested, the project is here:

https://github.com/etotheipi/PyBtcEngine

The file unittest.py might show you how to use the library as implemented... it tests just about every method in my library, including OP_CHECKSIG.    PM me if you have any interest in teaming up!

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
DiThi
Full Member
***
Offline Offline

Activity: 156
Merit: 100

Firstbits: 1dithi


View Profile
October 24, 2011, 01:20:11 PM
 #14

For optimizing python I suggest two alternatives:

PyPy: It's a python JIT compiler written in python. It supports ctypes and a lot of standard libraries natively, and has a wrapper for regular c-python extension modules.

Cython: A python-derived languaje for making python extension modules. I use it a lot, is like writing in python and C/C++ at the same time (but all with python syntax).

There's another one that I didn't know about until recently, Shed Skin: A (restricted subset of) python to c++ compiler. I think is kinda pypy's RPython translator but it seems better for interfacing with C++ code.

By the way, a complete python implementation of bitcoin is an awesome idea! It's the way to go to develop new features, specially if you have tools like those I mentioned. Python code is so much easier to understand and modify!

1DiThiTXZpNmmoGF2dTfSku3EWGsWHCjwt
etotheipi
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
October 24, 2011, 08:50:03 PM
 #15

Haha, thanks for the suggestion, but it's a little too late for me.  I already have like 7,000 lines of C++ code, imported into python through SWIG.  However, I do python development in other projects, too, so I may keep your recommendations in mind.

I had never used SWIG before starting this effort, and now that I have battled it and come out victorious, I'm quite impressed with it.  It understands most of the "nominal" C++ programming structures, and usually does a good job of mapping every C++ function and class (with methods) to identical python calls.  There's a few quirks with it, but i got most of it ironed with one afternoon of frustration. 

But no need to pollute Sam's thread with this any longer.  Just throwing it out my positive recommendation for SWIG.  It's been a lifesaver for BTC client development in python.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
giszmo
Legendary
*
Offline Offline

Activity: 1862
Merit: 1105


WalletScrutiny.com


View Profile WWW
May 18, 2013, 05:38:57 AM
 #16

Hi. Looking for some PyQT bitcoin client I found your project. Seriously dropping Windows support? I guess Windows is here to stay at least for some more years.
Last commit 2 months ago? How's your motivation?

ɃɃWalletScrutiny.comIs your wallet secure?(Methodology)
WalletScrutiny checks if wallet builds are reproducible, a precondition for code audits to be of value.
ɃɃ
peapodamus
Newbie
*
Offline Offline

Activity: 43
Merit: 0



View Profile
June 29, 2013, 03:38:55 AM
 #17

I am pleased to see Python being used for a wallet like this, esp. with a nice admin panel in it Cheesy
Chaoskampf
Full Member
***
Offline Offline

Activity: 182
Merit: 100


order in numbers


View Profile
July 08, 2013, 04:47:18 PM
 #18

How's the progress on this? I see the last commit was back in March. Any idea on when a stable release will be available?
sdp
Sr. Member
****
Offline Offline

Activity: 469
Merit: 280



View Profile WWW
September 28, 2013, 06:02:22 PM
 #19

Many python decoding functions including those for locale support will interpret a number starting with a zero specially : as an octal number.  Take a look at some of my interface changes for Electrum in its d.ddd branch.  You can find my fork at:

github.com/shawnpringle/electrum

Basically it nicely puts the thousand separators in for you when writing and when it displays numbers.  The thousand separators are pulled from the system default.  In the US, this is by default a comma but that can be changed to any character you wish.  It seems anyone who likes separators don't like commas.


Coinsbank: Left money in their costodial wallet for my signature.  Then they kept the money.
DiamondCardz
Legendary
*
Offline Offline

Activity: 1134
Merit: 1105



View Profile WWW
September 29, 2013, 08:53:02 PM
 #20

Haha, thanks for the suggestion, but it's a little too late for me.  I already have like 7,000 lines of C++ code, imported into python through SWIG.  However, I do python development in other projects, too, so I may keep your recommendations in mind.

I had never used SWIG before starting this effort, and now that I have battled it and come out victorious, I'm quite impressed with it.  It understands most of the "nominal" C++ programming structures, and usually does a good job of mapping every C++ function and class (with methods) to identical python calls.  There's a few quirks with it, but i got most of it ironed with one afternoon of frustration. 

But no need to pollute Sam's thread with this any longer.  Just throwing it out my positive recommendation for SWIG.  It's been a lifesaver for BTC client development in python.


Hi. Looking for some PyQT bitcoin client I found your project. Seriously dropping Windows support? I guess Windows is here to stay at least for some more years.
Last commit 2 months ago? How's your motivation?

I think the OP left bitcointalk over 2 years ago. His last action was in July of 2011. As for the commits, maybe he is still working on it, but he's not going to reply to your questions here.

BA Computer Science, University of Oxford
Dissertation was about threat modelling on distributed ledgers.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!