BitShares Forum

Main => Technical Support => Topic started by: Eastside on March 19, 2016, 12:44:56 am

Title: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: Eastside on March 19, 2016, 12:44:56 am
I am offering 0.123 BTC to anyone who can hold my hand via the phone or Skype (no email) and help me with my Bitshares Blues.
1) I don't check this forum very often, so please don't respond to me here.
2) Please don't respond unless you really know what you're talking about. If you DON'T really know what you're talking about and you waste my time (as has happened 2x now), of course I will not pay you.

I need to export/import my private keys but I'm having a lot of problems.
Please email me for an initial discussion and then we can set up a Skype session or Wechat via phone or regular old phone.
I'm in the U.S. on Central time - 1 hour behind NYC. I never go to bed before 12 midnight fyi.
Email:
jcbarrett2003@yahoo.com

Thanks,

JB
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: abit on March 19, 2016, 03:45:56 pm
I am offering 0.123 BTC to anyone who can hold my hand via the phone or Skype (no email) and help me with my Bitshares Blues.
1) I don't check this forum very often, so please don't respond to me here.
2) Please don't respond unless you really know what you're talking about. If you DON'T really know what you're talking about and you waste my time (as has happened 2x now), of course I will not pay you.

I need to export/import my private keys but I'm having a lot of problems.
Please email me for an initial discussion and then we can set up a Skype session or Wechat via phone or regular old phone.
I'm in the U.S. on Central time - 1 hour behind NYC. I never go to bed before 12 midnight fyi.
Email:
jcbarrett2003@yahoo.com

Thanks,

JB
Email sent. Wish I can help.
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: xeroc on March 20, 2016, 10:26:36 am
I wonder why in all those 10 mails or so that you wrote me over the last two weeks you never asked me for a skype session ..
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: baying on March 20, 2016, 06:28:20 pm
I'm trying to do the same thing.

could you please post the steps here?

could the people who can help, if not the author of the original post, please reply publicly as well as to the author privately?
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: abit on March 20, 2016, 07:06:11 pm
I'm trying to do the same thing.

could you please post the steps here?

could the people who can help, if not the author of the original post, please reply publicly as well as to the author privately?
See https://bitsharestalk.org/index.php/topic,20822.0.html

Full chain data of 0.9.3c can also be downloaded from here:
https://mega.nz/#!P8BhCZ4I!NZHkhUEbrgVTNRI1QXhDJI6ly7z1Fv2nFgrpQM1UWDQ
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: ElMato on March 27, 2016, 07:33:33 pm
For anyone that find it useful, the bash script below takes a 0.X json wallet backup and dumps "account name, owner pubkey, owner privkey".

Tested with a 07/2014 backup  (0.4.X?)
Tested with a 03/2015 backup  (0.8.X?)

Only one "rare" dependecy.
npm install -g json

For the rest it uses standard command line tools (openssl, sha512sum, xxd

pip install bitcoin (optional to have the privatekey in Wif format)

Code: [Select]
#!/bin/bash
WALLET_FILE=$1
PASSWORD=$2
SHA512=$(echo -n $PASSWORD | sha512sum -)
KEY=${SHA512:0:64}
IV=${SHA512:64:32}

cat $WALLET_FILE | json -c "this.type == 'account_record_type'" | json -c "this.data.is_my_account == true" | json -a data.name data.owner_key | while read -a line; do
  NAME=${line[0]}
  PUBKEY=${line[1]}
  ENC_PRIVKEY=$(cat $WALLET_FILE | json -c "this.type == 'key_record_type'" | json -c "this.data.public_key == '$PUBKEY'" | json -a data.encrypted_private_key)

  PRIVKEY=$(echo -n $ENC_PRIVKEY | xxd -r -p | openssl enc -d -aes-256-cbc -K $KEY -iv $IV | xxd -p | tr -d '\n')

  which pybtctool > /dev/null
  if [ $? -eq 0 ]; then
    PRIVKEY=$(echo -n $PRIVKEY | pybtctool -s encode_privkey wif)
  fi

  echo $NAME $PUBKEY $PRIVKEY
done
Title: Re: Bitshares 0.9.3c problem. Need to export/import private keys
Post by: abit on March 27, 2016, 11:14:44 pm
For anyone that find it useful, the bash script below takes a 0.X json wallet backup and dumps "account name, owner pubkey, owner privkey".

Tested with a 07/2014 backup  (0.4.X?)
Tested with a 03/2015 backup  (0.8.X?)

Only one "rare" dependecy.
npm install -g json

For the rest it uses standard command line tools (openssl, sha512sum, xxd

pip install bitcoin (optional to have the privatekey in Wif format)

Code: [Select]
#!/bin/bash
WALLET_FILE=$1
PASSWORD=$2
SHA512=$(echo -n $PASSWORD | sha512sum -)
KEY=${SHA512:0:64}
IV=${SHA512:64:32}

cat $WALLET_FILE | json -c "this.type == 'account_record_type'" | json -c "this.data.is_my_account == true" | json -a data.name data.owner_key | while read -a line; do
  NAME=${line[0]}
  PUBKEY=${line[1]}
  ENC_PRIVKEY=$(cat $WALLET_FILE | json -c "this.type == 'key_record_type'" | json -c "this.data.public_key == '$PUBKEY'" | json -a data.encrypted_private_key)

  PRIVKEY=$(echo -n $ENC_PRIVKEY | xxd -r -p | openssl enc -d -aes-256-cbc -K $KEY -iv $IV | xxd -p | tr -d '\n')

  which pybtctool > /dev/null
  if [ $? -eq 0 ]; then
    PRIVKEY=$(echo -n $PRIVKEY | pybtctool -s encode_privkey wif)
  fi

  echo $NAME $PUBKEY $PRIVKEY
done
+5%