Bitcoin Forum
November 15, 2024, 09:20:18 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: Python Bitcoin ECC library, supports signing, transactions, determinstic wallets  (Read 11437 times)
danneu
Newbie
*
Offline Offline

Activity: 32
Merit: 0



View Profile
November 09, 2013, 07:12:28 PM
 #21

Huge thanks for sharing.

This is the most intelligible/simple implementation I've found yet, and not just for ECC.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1036



View Profile WWW
November 21, 2013, 11:47:19 AM
Last edit: December 03, 2013, 02:03:45 AM by deepceleron
 #22

You can grab line 573-590 out of here if you want to add a "print paper wallet" def print_wallet(priv) to your code:

http://we.lovebitco.in/dice2key.py

Or grab the whole thing to line 483 if you want a pretty version of main.py, but there's still some warnings for python 2.7:

Expected type 'Number', got 'str | unicode' instead (at line 429) (edit: this appears to be an invalid warning I can't make go away)
Unexpected argument (at line 92) (incorrect call argument) (edit: VB fixed this)
472-475 "Q and Qr" are uppercase
redundant parenthesis. 94, 98, 103, 107, 112, 162, 167, 169

along with more PEP8 if: statements on same line, spacings etc.
phelix
Legendary
*
Offline Offline

Activity: 1708
Merit: 1020



View Profile
November 28, 2013, 07:39:15 PM
 #23

Quote
Thanks for the commit!
My pleasure. PBT is great.
sdp
Sr. Member
****
Offline Offline

Activity: 469
Merit: 281



View Profile WWW
December 03, 2013, 01:22:50 PM
 #24

Nice, congratulations. Though I would've suggested a different language cause simply Python ain't all that fast when it comes to these expensive operations there.


This reminds me when someone mentioned to me that I shouldn't use iostreams in C++.  That it was faster to use C-style printf functions.  After some bench marking and some inspection he was right that C++ iostreams are slower.  Each << is a function call.  I think this argument is similar.  In the end it doesn't matter.  Computers are fast today.

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

Activity: 1708
Merit: 1020



View Profile
December 13, 2013, 10:48:39 AM
 #25

I assume mktx will put anything not spent explicitly to mining fees?
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
December 17, 2013, 06:37:22 PM
 #26

Are there any practical limits in numbers of parties to a multisig transaction? I am thinking of a scenario like 6 of 10 of 8 of 15. Does the size of the script start to break anything at any point?

Quote
I assume mktx will put anything not spent explicitly to mining fees?
Yes, it works like that here as that's part of the bitcoin protocol.

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1013



View Profile
December 17, 2013, 06:38:33 PM
 #27

Are there any practical limits in numbers of parties to a multisig transaction? I am thinking of a scenario like 6 of 10 of 8 of 15. Does the size of the script start to break anything at any point?
n=20 is the maximum allowed by protocol.

n>3 is currently non-standard, so you have to make a private arrangement with a miner to get those transactions included in a block.
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
December 17, 2013, 07:03:25 PM
 #28

Are there any practical limits in numbers of parties to a multisig transaction? I am thinking of a scenario like 6 of 10 of 8 of 15. Does the size of the script start to break anything at any point?
n=20 is the maximum allowed by protocol.

n>3 is currently non-standard, so you have to make a private arrangement with a miner to get those transactions included in a block.

Ah thanks that is a very important point for me ... I did notice the darkwallet guys using a 3 of 5 address, I guess I can ask them about that. I only have one special use for large numbers, maybe I can work around it.

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
December 23, 2013, 04:49:30 PM
Last edit: December 24, 2013, 06:40:17 PM by waxwing
 #29

(On the above posts, Vitalik seems to have added an "eligius_pushtx" method to allow the more exotic multisig txs to go through (eligius processes them apparently) so that's cool Smiley )

Question: I want to do verifying messages with addresses from external wallets
..[snipped]

Question can be ignored, the code is already there in ecdsa_recover. Thanks Smiley

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
natb
Newbie
*
Offline Offline

Activity: 28
Merit: 12


View Profile
December 29, 2013, 04:25:22 PM
 #30

Vitalik, this is exactly what I was looking for. I'm going to replace my HW wallet test harness with your library (the one I was using before was functional, but I'd say not the cleanest library in the world). Thanks for sharing - I'll let you know if I run across any issues or have any improvement ideas.
phelix
Legendary
*
Offline Offline

Activity: 1708
Merit: 1020



View Profile
January 23, 2014, 08:37:29 AM
 #31

the time part of the two random functions looses entropy:

str(int(time.time())**7)   is probably meant to be
str(int(time.time()**7))   or
str(time.time()**7)

It would be nice to be able to add some base entropy by hammering your tinfoil hat on the keyboard at start.
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
March 02, 2014, 01:18:37 PM
Last edit: March 02, 2014, 02:07:27 PM by waxwing
 #32

I opened an issue with regard to signature padding here: https://github.com/vbuterin/pybitcointools/issues/9

I think fixing it might be a bit above my paygrade (or at least would take me a while), so if anyone can help I'd appreciate it.

Edit: Vitalik pushed a fix already, thanks (although it needs testing, which might be tricky).

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
Wanesst
Sr. Member
****
Offline Offline

Activity: 421
Merit: 250



View Profile
March 03, 2014, 07:24:04 PM
 #33

That's cool!  But a different language can be better cause this ain't all that fast

yakov
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
March 04, 2014, 01:05:06 AM
 #34

What are you coding that needs such breakneck speed?
hobbes
Full Member
***
Offline Offline

Activity: 128
Merit: 107



View Profile
March 07, 2014, 06:12:36 PM
 #35

My application of pybitcointools: offbit - Minimalistic offline key generation, offline TX signing and Tor protected TX broadcasting.

https://bitcointalk.org/index.php?topic=488915.0

hamish.macewan
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 23, 2014, 06:23:18 PM
 #36

I deliberately designed the library to be simple and no-nonsense.
Thanks for the effort, and I feel bad having to ask for assistance when so much has already been given.

What is required before you reach this point
Quote
> from pybitcointools import *

The command line examples are fine, but this "> from pybitcointools import *" only caused me grief.
instagibbs
Member
**
Offline Offline

Activity: 114
Merit: 12


View Profile
March 23, 2014, 07:00:20 PM
 #37

I deliberately designed the library to be simple and no-nonsense.
Thanks for the effort, and I feel bad having to ask for assistance when so much has already been given.

What is required before you reach this point
Quote
> from pybitcointools import *

The command line examples are fine, but this "> from pybitcointools import *" only caused me grief.

Same here. I couldn't get it to import, even with adding the correct folders to path(even inside the script using sys.path).

I'm no linux expert though so I'm probably doing something wrong.
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
March 25, 2014, 04:07:22 PM
 #38

I deliberately designed the library to be simple and no-nonsense.
Thanks for the effort, and I feel bad having to ask for assistance when so much has already been given.

What is required before you reach this point
Quote
> from pybitcointools import *

The command line examples are fine, but this "> from pybitcointools import *" only caused me grief.

"from pybitcointools import *" is Python.

If you have Python installed, you can just type 'python' (assuming it's in your path) at the command line to start the Python interpreter, and then you will get
 
>

from there you can do the above command.

Feel free to ask further questions as necessary. People will be happy to help.

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
gabridome
Full Member
***
Offline Offline

Activity: 162
Merit: 100


View Profile
March 28, 2014, 02:40:23 PM
 #39

Thank you for all you are doing for us.
I have scarse experience in python and programming in general but I like a lot your tutorial on multisig (http://bitcoinmagazine.com/11113/pybitcointools-multisig-tutorial/).

I get the following error when I type the first line of code:
>>> from pybitcointools import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pybitcointools

also using the command line tool I get instead:
 k1=`pybtctool random_key`
Traceback (most recent call last):
  File "/usr/local/bin/pybtctool", line 8, in <module>
    cmd = sys.argv[2]
IndexError: list index out of range

I work on Mac OS. I have installed the tools with:

sudo pip install bitcoin

Thank you.
tongbao
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
March 30, 2014, 10:01:31 AM
 #40

nice work, put a footprint here [feasibility on multiple public keys]
Pages: « 1 [2] 3 »  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!