Bitcoin Forum
April 20, 2014, 01:59:08 AM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2  All
  Print  
Author Topic: Caesure - a Python Bitcoin Client  (Read 7263 times)
Sam Rushing
Newbie
*
Offline Offline

Activity: 10



View Profile WWW

Ignore
July 08, 2011, 08:38:19 PM
 #1

I've started a new bitcoin client in Python.

https://github.com/samrushing/caesure

-Sam
Unbeatable Service & Product Support
Grab Your Miners at GAWMiners.com
Order Before April 25th to receive
Double your Hashing Power for 1 week!

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397959148
Hero Member
*
Offline Offline

Posts: 1397959148

View Profile Personal Message (Offline)

Ignore
1397959148
Reply with quote  #2

1397959148
Report to moderator
1397959148
Hero Member
*
Offline Offline

Posts: 1397959148

View Profile Personal Message (Offline)

Ignore
1397959148
Reply with quote  #2

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

Activity: 630

No Maps for These Territories


View Profile

Ignore
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]  Tips: 1L125pF2e7himW43Qu752ZFLtBLicxQmng 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
Newbie
*
Offline Offline

Activity: 10



View Profile WWW

Ignore
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



View Profile WWW

Ignore
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
Jr. Member
*
Offline Offline

Activity: 33


View Profile

Ignore
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: 630

No Maps for These Territories


View Profile

Ignore
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]  Tips: 1L125pF2e7himW43Qu752ZFLtBLicxQmng 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.
Ukigo
Hero Member
*****
Offline Offline

Activity: 924


View Profile

Ignore
July 09, 2011, 02:43:48 PM
 #7

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 )

"...Enemies are everywhere ! Angka is all rage ! Be a good soldiers, blow everything... " <-- Pol Pot (C)
zwierzak
Newbie
*
Offline Offline

Activity: 24



View Profile WWW

Ignore
July 09, 2011, 11:19:08 PM
 #8

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
Newbie
*
Offline Offline

Activity: 10



View Profile WWW

Ignore
July 10, 2011, 11:12:29 PM
 #9

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: 349



View Profile WWW

Ignore
July 12, 2011, 11:34:33 AM
 #10

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


View Profile

Ignore
July 12, 2011, 10:28:15 PM
 #11

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.

1NmJQCpvShNnyornRXDoSVyKJafydbXqD1
PGP
Lis
Sr. Member
****
Offline Offline

Activity: 295


Spice must flow!


View Profile

Ignore
July 14, 2011, 07:32:29 AM
 #12

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 have zero at the start, function is having problems

===
good job, thanks

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

Activity: 10



View Profile WWW

Ignore
July 15, 2011, 12:50:25 AM
 #13

please correct:

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

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

-Sam
etotheipi
Hero Member
*****
Offline Offline

Activity: 1036


Core Armory Developer


View Profile WWW

Ignore
September 15, 2011, 12:04:22 AM
 #14

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: 157

Firstbits: 1dithi


View Profile

Ignore
October 24, 2011, 01:20:11 PM
 #15

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
Hero Member
*****
Offline Offline

Activity: 1036


Core Armory Developer


View Profile WWW

Ignore
October 24, 2011, 08:50:03 PM
 #16

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
Hero Member
*****
Offline Offline

Activity: 1064


¡ɥɔʇɐʍ ʇsnɾ ˙ǝƃuɐɥɔ ɐuuoƃ s,ןɐǝɹ


View Profile WWW

Ignore
May 18, 2013, 05:38:57 AM
 #17

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?

peapodamus
Jr. Member
*
Offline Offline

Activity: 43


Brony FTW!


View Profile

Ignore
June 29, 2013, 03:38:55 AM
 #18

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

Hi.
Chaoskampf
Full Member
***
Offline Offline

Activity: 182


order in numbers


View Profile WWW

Ignore
July 08, 2013, 04:47:18 PM
 #19

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
Full Member
***
Offline Offline

Activity: 179



View Profile

Ignore
September 28, 2013, 06:02:22 PM
 #20

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.


My 0.02 BTC Smiley
BTC or DVC: 1DMHNzJEhKo5Nr8v7dHp41byA8v2C67Quq
Pages: [1] 2  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!