Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet API implementation #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

rubensayshi
Copy link
Contributor

** WIP **

test currently fails because delete_wallet requires a signature and there's no python lib implementing this, pending a PR on https://github.com/petertodd/python-bitcoinlib

@rubensayshi rubensayshi force-pushed the wallet-api-bitcoinlib branch 5 times, most recently from f7f8760 to 425a82b Compare February 24, 2015 16:01
@thebookworm101
Copy link

The wallet functionality in this python library will be very useful to me, so be aware of my bias in the following comment:
There is currently not much of a dependency on outside code, but this P.R. will introduce a dependency on python-bitcoinlib, which has a dependency on openssl, on recent version of fedora openssl is broken (missing ECC).
Im not sure what you mean by signature, but code signing transactions in python is already available, see here: https://github.com/vbuterin/pybitcointools/blob/3213b0a99ab41a06125e45276258437e7ea8d178/bitcoin/transaction.py#L333 ,
But pardon my ignorance since in delete_wallet i do not expect that its transactions that are being signed. So what exactly do you mean by signature? and who much work would be required to get something done in pure python without pulling in python-bitcoinlib?

@rubensayshi
Copy link
Contributor Author

Hey @thebookworm101 that's very valuable feedback to know that openssl is broken on fedora!

When you want to delete a wallet you need to use your private key to sign a message to prove you really have the private key, to avoid someone being able to delete a wallet if they get your API key.
So there we need to sign a message with a privatekey, but in a bit of a different way than normal transaction signing (compatible with the signmessage and verifymessage from bitcoind).

I actually tried using pybitcointools and pycoin first before using python-bitcoinlib, the reason for choosing python-bitcoinlib over pybitcointools is that when I tried pybitcointools I ran into a few bugs and I'm also not very comfortable with the relatively low amount of unittests.
And to top it all off it seems that the lead maintainer isn't very active or interested anymore in this library, judging but the activity of commits and the lack of response to the pull requests I did for that library; https://github.com/vbuterin/pybitcointools/pulls

However, if using python-bitcoinlib means that our SDK doesn't work on fedora then I think I'll spend some extra time to see if I can fix the issues in either of the other libraries.

@thebookworm101
Copy link

Ok,
if i get you right then it must be something along these lines:
https://github.com/jackjack-jj/jasvet/blob/master/jasvet.py#L479
which i found mentioned here: https://bitcointalk.org/index.php?topic=222992.0
im i thinking what you intended?
If iv got you right i could extract the code (from pybitcointools/this link) into an independent module so it can be used separately.

@rubensayshi
Copy link
Contributor Author

yea, that's the stuff, nice find!

the biggest problem I see right now is that both pycoin and pybitcointools are very slow in responding to pull requests and for either one of them I will need to do a few pull requests to fix some small bugs they have ...

Another option is adding support for using https://github.com/bitcoin/secp256k1 to python-bitcoinlib, which would probably be the best / coolest solution since then we'll be using the same code as bitcoin core for signing / verying.
The hard part is that users need to build it first ...

@thebookworm101
Copy link

Its not that hard, especially if we package it together as some libraries do, since setups/pip can do actual builds, this may not be a problem. My biggest worry would be dependencies, and as it stands,
python-bitcoinlib's dependency on openssl which is missing ECC on fedora (the tests segfault, its that bad). But also, should you choose to send PRs to one of the two (python-bitcoinlib, pybitcointools) it may have to be one or the other, since they both send up in the same package namespace (vbuterin/pybitcointools#78 ), clobbering each other.
Another suggestion for easing users pain in compiling is to create a .deb and .rpm + others for common operating systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants