Bitcoin Forum
December 08, 2016, 08:16:06 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 [5] 6 7 8 9 10 »  All
  Print  
Author Topic: [PULL] private key and wallet export/import  (Read 35858 times)
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
July 13, 2011, 02:48:33 AM
 #81

pulled into upstream

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
1481184966
Hero Member
*
Offline Offline

Posts: 1481184966

View Profile Personal Message (Offline)

Ignore
1481184966
Reply with quote  #2

1481184966
Report to moderator
1481184966
Hero Member
*
Offline Offline

Posts: 1481184966

View Profile Personal Message (Offline)

Ignore
1481184966
Reply with quote  #2

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

Posts: 1481184966

View Profile Personal Message (Offline)

Ignore
1481184966
Reply with quote  #2

1481184966
Report to moderator
bitlotto
Hero Member
*****
Offline Offline

Activity: 672


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 13, 2011, 02:51:11 AM
 #82

pulled into upstream
GREAT! I can't wait!!

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Shevek
Sr. Member
****
Offline Offline

Activity: 252



View Profile
July 13, 2011, 07:50:09 AM
 #83

Until its added:
check what Joric made: https://github.com/joric/pywallet
It makes exporting/importing keys easy without recompiling Bitcoin. It does it right to the wallet using a python script! Still new but pretty cool and easy!

Nice tool!

But it only works on freshly created wallet.dat files. If you try to dump, or to add a priv. key on to long-term used wallet, the program yields an error message.

Proposals for improving bitcoin are like asses: everybody has one
1SheveKuPHpzpLqSvPSavik9wnC51voBa
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
July 13, 2011, 09:40:38 AM
 #84

pulled into upstream

Eh no, not yet...

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
July 13, 2011, 06:43:59 PM
 #85

pulled into upstream

Eh no, not yet...

Sorry, cross-thread stupidity on my part.  Wallet encryption was pulled, not import/export -- though we do want to merge import/export soon!


Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
July 13, 2011, 07:58:42 PM
 #86

pulled into upstream

Eh no, not yet...

Sorry, cross-thread stupidity on my part.  Wallet encryption was pulled, not import/export -- though we do want to merge import/export soon!


You made my day, then killed it.  Sad
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
July 17, 2011, 09:11:04 PM
 #87

I just pushed a new version to github that contains a 'removeprivkey' that requires the *private* key to be removed to be passed.

It is untested for now, so use at your own risk. It should remove the key and irrelevant transactions from the wallet, the address from the address book, and from the key pool. It will not be removed from accounts (yet).

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
molecular
Donator
Legendary
*
Offline Offline

Activity: 2142



View Profile
July 18, 2011, 07:03:43 AM
 #88

I just pushed a new version to github that contains a 'removeprivkey' that requires the *private* key to be removed to be passed.

It is untested for now, so use at your own risk. It should remove the key and irrelevant transactions from the wallet, the address from the address book, and from the key pool. It will not be removed from accounts (yet).


awesome!

I was going to test, but I'm having trouble compiling:

Quote
util.cpp: In function ‘std::string FormatFullVersion()’:
util.cpp:903: error: invalid conversion from ‘const wxChar*’ to ‘char’

Sad

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
riush
Member
**
Offline Offline

Activity: 73


View Profile
July 18, 2011, 10:13:15 PM
 #89

Nice! much better than what I tried to do Tongue

I'm just having a 'little' problem with importing keys; the import fails, and even if I didn't remove the key, it is not listed anymore; but it seems to be there somehow...

Quote
foo@bar:~/work/bitcoin/src$ ./bitcoind getaddressesbyaccount foobar
[
    "mogyeNDBngfYGdbmc49QnTmDpbwgkbn2oK"
]
foo@bar:~/work/bitcoin/src$ ./bitcoind dumpprivkey mogyeNDBngfYGdbmc49QnTmDpbwgkbn2oK
92k6iexNDbUVjKdkE5YtcukbtDK6VWg9NAXxwakvviWc4RhoWNh
( foo@bar:~/work/bitcoin/src$ ./bitcoind removeprivkey 92k6iexNDbUVjKdkE5YtcukbtDK6VWg9NAXxwakvviWc4RhoWNh )
foo@bar:~/work/bitcoin/src$ ./bitcoind importprivkey 92k6iexNDbUVjKdkE5YtcukbtDK6VWg9NAXxwakvviWc4RhoWNh
error: {"code":-4,"message":"Error adding key to wallet"}
foo@bar:~/work/bitcoin/src$ ./bitcoind getaddressesbyaccount foobar
[
]
foo@bar:~/work/bitcoin/src$ ./bitcoind getaccountaddress foobar
mogyeNDBngfYGdbmc49QnTmDpbwgkbn2oK

Behaves the same no matter if I removed the key or not; AFAIS it shouldn't be in getaccountaddress if I did, and should be in getaddressesbyaccount if i didn't.

Am I understanding or doing something wrong here?

1MKKiJhUJgqKyfCLeo7bB1bvELNEM8wUbz
SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
July 18, 2011, 10:35:46 PM
 #90

Private keys always start with 5 though, right?
riush
Member
**
Offline Offline

Activity: 73


View Profile
July 18, 2011, 10:41:18 PM
 #91

Private keys always start with 5 though, right?

Yes, in the 'real' net. I was trying on testnet.

1MKKiJhUJgqKyfCLeo7bB1bvELNEM8wUbz
sirky
Sr. Member
****
Offline Offline

Activity: 407



View Profile
July 19, 2011, 01:09:09 AM
 #92

I want to say that I will be really excited when this makes its way into the client!
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
July 19, 2011, 02:42:15 PM
 #93

Nice! much better than what I tried to do Tongue

I'm just having a 'little' problem with importing keys; the import fails, and even if I didn't remove the key, it is not listed anymore; but it seems to be there somehow...

It seems there was a bug: keys were not removed from disk, so re-adding them failed. This should be fixed now - could you test again?

Quote
Behaves the same no matter if I removed the key or not; AFAIS it shouldn't be in getaccountaddress if I did, and should be in getaddressesbyaccount if i didn't.

Am I understanding or doing something wrong here?

Well, removing addresses from accounts is just not supported yet. It may cause inccorrect account balances, but not invalid total balances Smiley

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
riush
Member
**
Offline Offline

Activity: 73


View Profile
July 19, 2011, 10:40:47 PM
 #94

It seems there was a bug: keys were not removed from disk, so re-adding them failed. This should be fixed now - could you test again?
Ah, now it seems to work. Great! Smiley

Quote
Well, removing addresses from accounts is just not supported yet. It may cause inccorrect account balances, but not invalid total balances
Even getbalance for the account shows 0 after the keys are removed, even though getaccountaddress still knows it.
Are you planning on adding that? (Not that I find it important, just curious what to expect Wink)

Another question: is there a way to check the 'balance' of a single address/key?

1MKKiJhUJgqKyfCLeo7bB1bvELNEM8wUbz
SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
July 19, 2011, 11:07:47 PM
 #95

It seems there was a bug: keys were not removed from disk, so re-adding them failed. This should be fixed now - could you test again?
Ah, now it seems to work. Great! Smiley

Quote
Well, removing addresses from accounts is just not supported yet. It may cause inccorrect account balances, but not invalid total balances
Even getbalance for the account shows 0 after the keys are removed, even though getaccountaddress still knows it.
Are you planning on adding that? (Not that I find it important, just curious what to expect Wink)

Another question: is there a way to check the 'balance' of a single address/key?
Blockexplorer is probably the best way to check an address balance.
dserrano5
Legendary
*
Offline Offline

Activity: 1638



View Profile
July 26, 2011, 12:09:19 PM
 #96

Code:
git clone git://github.com/bitcoin/bitcoin
cd bitcoin
git remote add sipa git://github.com/sipa/bitcoin
git fetch --all
git diff master..sipa/showwallet

(Warning: I'm a subversion user and haven't worked with git at all)

I've followed these steps successfully with 0.3.23 (or maybe it was 22). In the last step I actually did 'git diff master..sipa/showwallet |patch -p1', then 'cd src' and 'make bitcoind' as usual. Funny having to patch things, but I guess that's how git does things.

Now, what should I do to update to 0.3.24 without starting from scratch? A quick google revealed 'git pull' but that failed with "Your local changes to 'contrib/gitian.yml' would be overwritten by merge.  Aborting". Must I revert those changes (the applied patch, I suppose) before doing 'git pull'?

For now I just removed everything and started over, but I'd like to be cleaner next time. Already running "0.3.25-beta" Smiley.

jackjack
Hero Member
*****
Offline Offline

Activity: 882


May Bitcoin be touched by his Noodly Appendage


View Profile
July 26, 2011, 12:42:30 PM
 #97

Code:
git clone git://github.com/bitcoin/bitcoin
cd bitcoin
git remote add sipa git://github.com/sipa/bitcoin
git fetch --all
git diff master..sipa/showwallet

(Warning: I'm a subversion user and haven't worked with git at all)

I've followed these steps successfully with 0.3.23 (or maybe it was 22). In the last step I actually did 'git diff master..sipa/showwallet |patch -p1', then 'cd src' and 'make bitcoind' as usual. Funny having to patch things, but I guess that's how git does things.

Now, what should I do to update to 0.3.24 without starting from scratch? A quick google revealed 'git pull' but that failed with "Your local changes to 'contrib/gitian.yml' would be overwritten by merge.  Aborting". Must I revert those changes (the applied patch, I suppose) before doing 'git pull'?

For now I just removed everything and started over, but I'd like to be cleaner next time. Already running "0.3.25-beta" Smiley.
From http://help.github.com/fork-a-repo/
Code:
git remote add upstream git://github.com/bitcoin/bitcoin
git fetch upstream
git merge upstream/master

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.
krepta3000
Member
**
Offline Offline

Activity: 92


View Profile
July 28, 2011, 08:55:37 PM
 #98

Until its added:
check what Joric made: https://github.com/joric/pywallet
It makes exporting/importing keys easy without recompiling Bitcoin. It does it right to the wallet using a python script! Still new but pretty cool and easy!

Thank you so much bitlotto, or whoever you really are! Smiley  I'm going to try out pyWallet, yay! Smiley

I've been using python for various things for a while, I'm very happy with pyTiVo for instance. Smiley

Ok, I have downloaded pywallet.py, I've run it and told it to dump my wallet in JSON format, and it dumped keys to my screen.  So, I told it to dump the output text to a file I called wallet.json.... now what?  How do I import into a new, clean and undamaged, wallet?

Quote
Usage: pywallet.py [options]

Options:
  --version            show program's version number and exit
  -h, --help           show this help message and exit
  --dumpwallet         dump wallet in json format
  --importprivkey=KEY  import private key from vanitygen
  --datadir=DATADIR    wallet directory (defaults to bitcoin default)
  --testnet            use testnet subdirectory and address type

Thank goodness for advanced text editors like Notepad++ and Textpad that have macro recording functionality.  I created macros to edit the json text file to create a batch file that would run all of the key importing quick and easy. Smiley
jackjack
Hero Member
*****
Offline Offline

Activity: 882


May Bitcoin be touched by his Noodly Appendage


View Profile
July 28, 2011, 09:49:07 PM
 #99

Until its added:
check what Joric made: https://github.com/joric/pywallet
It makes exporting/importing keys easy without recompiling Bitcoin. It does it right to the wallet using a python script! Still new but pretty cool and easy!

Thank you so much bitlotto, or whoever you really are! Smiley  I'm going to try out pyWallet, yay! Smiley

I've been using python for various things for a while, I'm very happy with pyTiVo for instance. Smiley

Ok, I have downloaded pywallet.py, I've run it and told it to dump my wallet in JSON format, and it dumped keys to my screen.  So, I told it to dump the output text to a file I called wallet.json.... now what?  How do I import into a new, clean and undamaged, wallet?

Quote
Usage: pywallet.py [options]

Options:
  --version            show program's version number and exit
  -h, --help           show this help message and exit
  --dumpwallet         dump wallet in json format
  --importprivkey=KEY  import private key from vanitygen
  --datadir=DATADIR    wallet directory (defaults to bitcoin default)
  --testnet            use testnet subdirectory and address type

I know that these are the command line options, I just don't know what to do from here.  Do I grab each key individually from the text file I created and tell this to import it into my new wallet file?  That could take a long time.
To copy an entire wallet, I think this might help you: http://forum.bitcoin.org/index.php?topic=31418.0
It is based on my pywallet fork (for label and reserve key support) and a script I made to use it

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.
krepta3000
Member
**
Offline Offline

Activity: 92


View Profile
July 28, 2011, 10:06:02 PM
 #100

To copy an entire wallet, I think this might help you: http://forum.bitcoin.org/index.php?topic=31418.0
It is based on my pywallet fork (for label and reserve support) and a script I made to use it

Thanks jackjack. Smiley  I didn't see this message till after I'd recorded the necessary macros to convert the json text into a batch importing file.  It's now working on importing all my keys, nice and easy. Smiley  I'll go download that script and work with it, some other time.  I'll just wait till the importing is all done and see what happens.
Pages: « 1 2 3 4 [5] 6 7 8 9 10 »  All
  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!