Bitcoin Forum
December 07, 2016, 06:44:28 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Pywallet fork for SolidCoin and more  (Read 2033 times)
Ukigo
Hero Member
*****
Offline Offline

Activity: 924


View Profile
August 25, 2011, 02:42:39 PM
 #1

Hi all !
 Pywallet.py fork for  SolidCoin https://github.com/ukigo/pywallet_solidcoin.git

Tested for creation and import privkeys only.

EDIT: Use this "evil" fork ONLY if you wish to play with key generator below or something similar.
For other purposes please use : https://github.com/jackjack-jj/pywallet

And yet another privkey generator, but for SolidCoin only.See code below.

Code:
#!/usr/bin/python

# Copyright (c) 2011, Ukigo

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


usage = """             Usage : ./solkgn your_passphrase_here your_number_from_0_to_32

                        Example :  ./solkgn =Sezam-+-+-+-+-+-+-+ 13 """


import sys, hashlib
import pywallet_solidcoin as pyw

def gen():

    try:
        if sys.argv[1] in ("help", "-h", "-help","--help"):
            print " "
            print usage
            exit(0)

    except IndexError:
        print " "
        print usage
        exit(0)

    print " "

    hash1 = hashlib.sha512(sys.argv[1]).digest()
    hash2 = hashlib.sha512(hash1).digest()
    hash3 = hashlib.sha512(hash2).digest()
    hash4 = hashlib.sha512(hash3).digest()
    hash5 = hashlib.sha512(hash4).digest()

    cut = int(sys.argv[2])
    if cut>32 or cut<0:
        print "Number must be in range 0...32"
        return

    print " "
    print "    Input was : ", sys.argv[1]

    topsec = hash5[cut:cut+32]
#    print len(topsec)
    print "                 ................................................................"
    print "    Sec (hex) : ", topsec.encode("hex")

    
    
    print " "
    
    secret = pyw.str_to_long(topsec)
    eckey = pyw.EC_KEY(secret)
    pub = pyw.GetPubKey(eckey)
    priv = pyw.GetPrivKey(eckey)
    priv_base58 = pyw.SecretToASecret(pyw.PrivKeyToSecret(priv))
    print "    Key for import : ", priv_base58
    
    print " "
    print "                Address :  "+pyw.public_key_to_bc_address(pub)
    print " "
    exit(0)

if __name__ == '__main__':
    gen()

 

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

Posts: 1481136268

View Profile Personal Message (Offline)

Ignore
1481136268
Reply with quote  #2

1481136268
Report to moderator
1481136268
Hero Member
*
Offline Offline

Posts: 1481136268

View Profile Personal Message (Offline)

Ignore
1481136268
Reply with quote  #2

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

Activity: 924


View Profile
August 25, 2011, 03:03:03 PM
 #2

How to use :
1) Install SolidCoin.
2) install pywallet_solidcoin from link in OP.
3) Save code from code block above in the same dir with pywallet_solidcoin.py
    as "solkgn".
4) chmod 700 ./solkgn
5) $ ./solkgn Good-Intentions=================Hell-Route 13
6) Note "Key for import" string from script output.
7) Be sure that SolidCoin is not running.
9) $ python pywallet_solidcoin.py  --datadir=/path/to/solidcoin_wallet \
 --importprivkey=your_key_here_from_5th_step
10) PROFIT ! Now you have deterministic key imported in your SolidCoin wallet.dat


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

Activity: 882


May Bitcoin be touched by his Noodly Appendage


View Profile
August 25, 2011, 03:06:24 PM
 #3

Did you leave your basement during the last thousand years?

Pywallet already support all existing and future blockchains

Also, you forked the old Joric's pywallet, ie you forked a tool which is already outdated
Well done

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Ukigo
Hero Member
*****
Offline Offline

Activity: 924


View Profile
August 25, 2011, 03:23:31 PM
 #4

Hmm, try to import Solidcoin key with your fork.
Then we will see who is right.

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

Activity: 882


May Bitcoin be touched by his Noodly Appendage


View Profile
August 25, 2011, 03:27:46 PM
 #5

I don't have to try I know it works
Follow my instructions with Version = 125 instead of 0
It worked for Bitcoin, Namecoin, I0coin, Ixcoin, Devcoin, Groupcoin, and all their testnets

Basically you just:
 - created a useless function
 - reintroduced 2 bugs
Code:
$ diff old_joric_pywallet this_awesome_fork
3c3
< # pywallet_solidcoin.py 1.1
---
> # pywallet.py 1.1
6c6
< # Usage: pywallet_solidcoin.py [options]
---
> # Usage: pywallet.py [options]
30,31c30,31
< max_version = 32500
< addrtype = 125
---
> max_version = 32400
> addrtype = 0
207a208
> return hex_der_key.decode('hex')
229a231,235
> # private keys are 279 bytes long (see crypto/ec/cec_asn1.c)
> # ASN1_SIMPLE(EC_PRIVATEKEY, version, LONG),
> # ASN1_SIMPLE(EC_PRIVATEKEY, privateKey, ASN1_OCTET_STRING),
> # ASN1_EXP_OPT(EC_PRIVATEKEY, parameters, ECPKPARAMETERS, 0),
> # ASN1_EXP_OPT(EC_PRIVATEKEY, publicKey, ASN1_BIT_STRING, 1)
244a251,252
> # public keys are 65 bytes long (520 bits)
> # 0x04 + 32-byte X-coordinate + 32-byte Y-coordinate
271,279d278
< def short_hex(bytes):
< t = bytes.encode('hex_codec')
< if len(t) < 32:
< return t
< return t[0:32]+"..."+t[-32:]
<
365c364
< vchIn = chr(addrtype) + secret
---
> vchIn = chr(addrtype+128) + secret
370c369
< if vch and vch[0] == chr(addrtype):
---
> if vch and vch[0] == chr(addrtype+128):
685a685,689
> elif type == "bestblock":
> vds.write_int32(d['nVersion'])
> vds.write_compact_size(len(d['hashes']))
> for h in d['hashes']:
> vds.write(h)


Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Ukigo
Hero Member
*****
Offline Offline

Activity: 924


View Profile
August 25, 2011, 05:26:36 PM
 #6

"short_hex" function is not mine.
Bugs ?! These are features. Smiley

BTW, my fork works for me just fine, i already imported ~100 keys
 and have  coins transfered to those addresses.

And yes i pretty love my basement and hate abusive strangers.
Dunno why, but they are tend to disappear.  Grin

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

Activity: 882


May Bitcoin be touched by his Noodly Appendage


View Profile
August 25, 2011, 05:52:16 PM
 #7

Yes,
Code:
chr(addrtype+128)
instead of
Code:
chr(addrtype)
is a bug, or rather something that goes against the de facto standards

I didn't say it doesn't work
It's just like ix/i0/solidcoin: copy the code, change a value, tada I made a fork
You guys should really help Bitcoin projects instead of parasiting them (mainly when it doesn't add any value...)

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Ukigo
Hero Member
*****
Offline Offline

Activity: 924


View Profile
August 25, 2011, 06:04:38 PM
 #8


You guys should really help Bitcoin projects instead of parasiting them (mainly when it doesn't add any value...)
I'm helping Smiley See my key generator above.
Most of it shamelessly copied from my own previous analogs.

"...Enemies are everywhere ! Angka is all rage ! Be a good soldiers, blow everything... " <-- Pol Pot (C)
Pages: [1]
  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!