Pages:
Author

Topic: Python client (Read 36708 times)

legendary
Activity: 2576
Merit: 1186
April 13, 2011, 11:51:20 PM
#40
Spesmilo is a fully functional PySide GUI, FWIW. https://gitorious.org/bitcoin/spesmilo
full member
Activity: 136
Merit: 100
April 13, 2011, 08:57:21 PM
#39
Some work on a python implementation of bitcoin is done here:

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

Although, I am not really sure how close this is to an actual working client.
staff
Activity: 4270
Merit: 1209
I support freedom of choice
April 13, 2011, 09:00:50 AM
#38
"Background servers capable of running for longer than 30s" is a feature on Google's roadmap, so maybe a 100% App Engine bitcoin client will be possible in the future.
Is it possible right now? Smiley
http://googleappengine.blogspot.com/2010/12/happy-holidays-from-app-engine-team-140.html
legendary
Activity: 1232
Merit: 1076
March 11, 2011, 04:59:24 AM
#37
Not much to add here, except that if you had a basic reference implementation written in Python, then that'd be excellent.

Bitcoin should be broken down, and then there should be a core from which all the other components are built around. Imagine something *really* basic and difficult to use but very flexible for people to add new features to.
hero member
Activity: 616
Merit: 500
Firstbits.com/1fg4i :)
March 05, 2011, 02:21:51 AM
#36
IRC is just the default, i read someone saying there are a couple different fallbacks for when IRC isn't avaiable or desired by the user.




A python client that only depends on python would indeed be awesome.
legendary
Activity: 2576
Merit: 1186
March 04, 2011, 02:45:46 PM
#35
I had almost working pure perl client, but since I've heard alt clients are not welcomed, i've abandoned that project.
I would welcome a Perl implementation of various parts of BitCoin.

I also suggest new development try to stick to an abstract 4-piece infrastructure documented on https://en.bitcoin.it/wiki/Infrastructure so end users can choose to run different combinations of wallets/UIs/etc.
legendary
Activity: 1288
Merit: 1080
December 14, 2010, 05:08:37 AM
#34
The best approach is to standardize protocols (RFCs) and provide an open (BSD/GPL) modular "reference" implementation. An excellent example of a successful execution is GnuPG.

I don't understand everything but I agree with that.
sr. member
Activity: 252
Merit: 250
December 14, 2010, 05:02:35 AM
#33
I'm looking into the possibility of integrate Bitcoin functionality into an existing GPL software product, the problem is that it seems to be hard. The one true implementation brings with it some additional dependencies such as wxWindows (which is actually pointless if you're just interested in the functionality and not the GUI), BerkeleyDB (which is a bit much for storing just a bunch of keypairs), openSSL (which is reasonable as it's use is very wide-spread, but i'm not entirely sure why it is required as the set of crypto functions in Bitcoin is fairly limited afaik) and Boost (which is huge to introduce in an existing project when it's only needed for Bitcoin functionality). Especially on Windows is including those libraries far from a straightforward task and building a 64-bit binary for Windows is just a pain.

I don't really have a problem with the fact that a one true implementation is preferred, because I understand more implementations will introduce complications in this early stage, the examples where this method is successful are few (Perl is maybe one of the very few exceptions probably because it's very well-documented). I think in the long run multiple implementations are going to be required if Bitcoin is to grow (a lot) larger. Keep in mind that in time perhaps other devices with much more esoteric platforms may want to be able to have Bitcoin functionality as well (smartphones were already mentioned, but think about automated payment servers, set-top boxes, vending machines, pay-toilets, ...). Bittorrent, which is mentioned here as an example, is currently running on the firmware of some people's networked harddrives. Maybe on-chip implementations of Bitcoin will be made one day.

Being able to run Bitcoin in javascript (with an AJAX proxy) would be a significant advantage for the application I'm thinking about.

I think what would be needed is a very low-dependency reference implementation, which can easily be translated into other programming languages without introducing new bugs or incompatibilities. In time the protocol should be standardized and perhaps even go for recognition by standards bodies. That's the best way to guarantee long-term survival of the network. Every platform in the world that could be capable of using Bitcoin has at least a decent C compiler and the current de facto standard way to have a low-dependency reference implementation is to have C library which can be easily compiled on all major platforms without (or with absolute minimal) dependencies. The stock client should also use that C library.

Emphasis mine.

I registered just to reply to this and offer some insight. As a unix-type, I insist that modularity is important. By reimplementing specific cryptographic transforms rather than using something like openssl, the programmer risks all sorts of problems (recall the debian openssl fiasco a while back). The work has already been done by competent experts and is well-tested. Rolling in specific algos in lieu of calling openssl encourages "getting cute" with important components which are best left alone, especially when dealing with financial crypto.

The best approach is to standardize protocols (RFCs) and provide an open (BSD/GPL) modular "reference" implementation. An excellent example of a successful execution is GnuPG.

P.S. Someone, in either this thread or another, raised the point that communicating via IRC seems to be a rather obvious point of failure. I may be totally misinformed, but if this is true, it goes to my point about the importance of protocols over implementation details. A de facto reference implementation already exists; perhaps it is time to aggressively tackle some other problems via protocols. I am confident that an ecosystem of implementations will emerge naturally, similar to bittorrent.
legendary
Activity: 1372
Merit: 1008
1davout
December 10, 2010, 03:21:48 PM
#32
+1
legendary
Activity: 1288
Merit: 1080
December 10, 2010, 02:28:04 PM
#31

Personnaly I think Satoshi's code is quite tough to understand, that's why I'd like to see other implementations, for instance in python.

I also wonder whether it could be possible to split the program into different parts.

For instance, blocks could be downloaded and shared with a standard P2P program.  One file per block.  I know that may be beyond the maximum number of opened files on most OS but...  I'd like also to see those files in ASCII, and not in binary.  Same for wallets.  Performance is not an issue with bitcoin anyway, execpt for generation.  So ASCII could be fine.

Also, the libcrypto++-utils package contains command line tools to use cryptographic functions, such as ECDSA.

Using standard P2P program, command line tools and ASCII files could allow to write the full bitcoin client in a bash script.  I think this would be pretty cool.
full member
Activity: 141
Merit: 100
August 30, 2010, 07:25:27 PM
#30
Hmm,

GAE cron jobs could probably keep up to date or close.

Javascript in the browser would not work as a full client for the reasons you suggested, but there is node.js. I think a javascript port of a minimal client would find plenty of uses. For instance, maprejuice.com just launched -- they claim 200,000 web clients already. I imagine one would be interested to run block generation there.
legendary
Activity: 1652
Merit: 2301
Chief Scientist
August 30, 2010, 05:23:34 PM
#29
I agree with the sentiment that a small reference client would be hugely helpful. I would like one that ran on Google App Engine, for instance, and as you say, a reference javascript version would be totally fabulous.
Neither of those are feasible-- both App Engine and Javascript don't allow arbitrary socket connections, and a full bitcoin client needs to maintain a persistent connection to at least one other bitcoin client to get transaction messages.

"Background servers capable of running for longer than 30s" is a feature on Google's roadmap, so maybe a 100% App Engine bitcoin client will be possible in the future.
full member
Activity: 141
Merit: 100
August 30, 2010, 03:00:10 AM
#28
I agree with the sentiment that a small reference client would be hugely helpful. I would like one that ran on Google App Engine, for instance, and as you say, a reference javascript version would be totally fabulous.
hero member
Activity: 489
Merit: 505
August 23, 2010, 08:51:06 AM
#27
I think what would be needed is a very low-dependency reference implementation, which can easily be translated into other programming languages without introducing new bugs or incompatibilities. In time the protocol should be standardized and perhaps even go for recognition by standards bodies. That's the best way to guarantee long-term survival of the network. Every platform in the world that could be capable of using Bitcoin has at least a decent C compiler and the current de facto standard way to have a low-dependency reference implementation is to have C library which can be easily compiled on all major platforms without (or with absolute minimal) dependencies. The stock client should also use that C library.

My point exactly, the protocol needs to be standardized and well documented. In its current state the Protocol would pass no standardization process anyway, variable headers with/without checksums, variable length size fields, 30% of all fields are just placeholders, ...

Anyway I'm trying to work on a python client that has no dependencies except the default python installation  Grin
newbie
Activity: 15
Merit: 0
August 22, 2010, 12:15:33 PM
#26
I'm looking into the possibility of integrate Bitcoin functionality into an existing GPL software product, the problem is that it seems to be hard. The one true implementation brings with it some additional dependencies such as wxWindows (which is actually pointless if you're just interested in the functionality and not the GUI), BerkeleyDB (which is a bit much for storing just a bunch of keypairs), openSSL (which is reasonable as it's use is very wide-spread, but i'm not entirely sure why it is required as the set of crypto functions in Bitcoin is fairly limited afaik) and Boost (which is huge to introduce in an existing project when it's only needed for Bitcoin functionality). Especially on Windows is including those libraries far from a straightforward task and building a 64-bit binary for Windows is just a pain.

I don't really have a problem with the fact that a one true implementation is preferred, because I understand more implementations will introduce complications in this early stage, the examples where this method is successful are few (Perl is maybe one of the very few exceptions probably because it's very well-documented). I think in the long run multiple implementations are going to be required if Bitcoin is to grow (a lot) larger. Keep in mind that in time perhaps other devices with much more esoteric platforms may want to be able to have Bitcoin functionality as well (smartphones were already mentioned, but think about automated payment servers, set-top boxes, vending machines, pay-toilets, ...). Bittorrent, which is mentioned here as an example, is currently running on the firmware of some people's networked harddrives. Maybe on-chip implementations of Bitcoin will be made one day.

Being able to run Bitcoin in javascript (with an AJAX proxy) would be a significant advantage for the application I'm thinking about.

I think what would be needed is a very low-dependency reference implementation, which can easily be translated into other programming languages without introducing new bugs or incompatibilities. In time the protocol should be standardized and perhaps even go for recognition by standards bodies. That's the best way to guarantee long-term survival of the network. Every platform in the world that could be capable of using Bitcoin has at least a decent C compiler and the current de facto standard way to have a low-dependency reference implementation is to have C library which can be easily compiled on all major platforms without (or with absolute minimal) dependencies. The stock client should also use that C library.
hero member
Activity: 489
Merit: 505
August 22, 2010, 07:40:56 AM
#25
@lachesis: I started my own bitcoin client to play with the protocol and I have to say you did a great job with your Writer and Reader classes, I adapted them slightly as to have a socket writer/reader and a string writer/reader, they are just so much easier than to use pack and unpack all over the place ^^
full member
Activity: 210
Merit: 104
August 03, 2010, 05:36:12 PM
#24
On a slightly more meta note, here's the protocol for making a transaction:
Transaction is built and the hash is taken.
My client sends "inv" message to every other host to which it is connected.
If the other client doesn't already know about the tx, it responds with a "getdata" message with the same data (and therefore checksum).
My client then responds with a "tx" message. I've been decoding the tx message, but I haven't gotten it down yet.

These messages are or will be decoded on the wiki here http://code.google.com/p/pybitcoin/wiki/BitcoinProtocol.
full member
Activity: 210
Merit: 104
August 03, 2010, 07:35:34 AM
#23
By the way, the "version" message does not include a version number only a string, where is the version number transferred?
It includes the version number as the first four bytes (host byte order) of the message. That number is converted to the 0.3.6 notation that you see in the client:
Code:
init.cpp:191:    printf("Bitcoin version %d.%d.%d%s beta\n", VERSION/10000, (VERSION/100)%100, VERSION%100, pszSubVer);
Here's an (ugly) colorized version of the version packet from my machine:
http://www.alloscomp.com/bitcoin/messages/version.html
hero member
Activity: 489
Merit: 505
August 03, 2010, 06:10:13 AM
#22
Your right of course, I was grepping for PushMessage(" instead of strCommand Smiley

Apparently though subscribe, sub-cancel, publish and pub-cancel are never used in the code, at least I was unable to ever capture one of the messages.

By the way, the "version" message does not include a version number only a string, where is the version number transferred?
legendary
Activity: 1596
Merit: 1100
August 02, 2010, 09:38:22 PM
#21
I'm not sure about that list; this is what I see:
Code:
[jgarzik@bd bitcoin.hacks]$ grep '(strCommand ==' main.cpp
    if (strCommand == "version")
    else if (strCommand == "verack")
    else if (strCommand == "addr")
    else if (strCommand == "inv")
    else if (strCommand == "getdata")
    else if (strCommand == "getblocks")
    else if (strCommand == "tx")
    else if (strCommand == "block")
    else if (strCommand == "getaddr")
    else if (strCommand == "checkorder")
    else if (strCommand == "submitorder")
    else if (strCommand == "reply")
    else if (strCommand == "ping")
Pages:
Jump to: