Bitcoin Forum
July 23, 2017, 10:53:18 PM *
News: Due to BIP91, it would starting now be prudent to require 5 times more confirmations than usual before trusting transactions.
 
   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 37767 times)
bmgjet
Member
**
Offline Offline

Activity: 98


View Profile
July 08, 2011, 09:21:40 PM
 #41

Any one going to compile it into a windows client. Dont want to have to turn my mining PC off to mess around trying to compile it myself.

Donations to: 1BMGjetfht9XLkGBYR4TSsuXjrYEKACcow
1stbits: 1bmgjet
300MHash/s 6850 http://www.techpowerup.com/gpuz/5u6wr/
Overclocked for 6 years and still strong http://valid.canardpc.com/show_oc.php?id=1931458 & http://valid.canardpc.com/show_oc.php?id=285337
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1500850398
Hero Member
*
Offline Offline

Posts: 1500850398

View Profile Personal Message (Offline)

Ignore
1500850398
Reply with quote  #2

1500850398
Report to moderator
samr7
Full Member
***
Offline Offline

Activity: 140

Firstbits: 1samr7


View Profile
July 08, 2011, 10:01:20 PM
 #42

This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

+1 more.  This is a very important feature, whether it's exposed to end users or not.
molecular
Donator
Legendary
*
Offline Offline

Activity: 2324



View Profile
July 08, 2011, 11:07:16 PM
 #43

This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

+1 more.  This is a very important feature, whether it's exposed to end users or not.

Actually, I might have changed my mind (partly)

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

The importing of a privkey is the part that is important for users (bitbill, import key generated with external tool like vanitygen) and this part, luckyly, poses no problems (that I can see), does it?

So how about splitting this and putting importprivkey in default, but not dumpprivkey?

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

Activity: 1358



View Profile
July 08, 2011, 11:32:15 PM
 #44

This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

+1 more.  This is a very important feature, whether it's exposed to end users or not.

Actually, I might have changed my mind (partly)

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

The importing of a privkey is the part that is important for users (bitbill, import key generated with external tool like vanitygen) and this part, luckyly, poses no problems (that I can see), does it?

So how about splitting this and putting importprivkey in default, but not dumpprivkey?
I still disagree.  I'd like to be able to export private keys from wallets, but really don't want to have to try to compile bitcoin again.  That was a complete PITA.
Ryland R. Taylor-Almanza
Legendary
*
Offline Offline

Activity: 882



View Profile
July 09, 2011, 01:18:32 AM
 #45

This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

+1 more.  This is a very important feature, whether it's exposed to end users or not.

Actually, I might have changed my mind (partly)

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

The importing of a privkey is the part that is important for users (bitbill, import key generated with external tool like vanitygen) and this part, luckyly, poses no problems (that I can see), does it?

So how about splitting this and putting importprivkey in default, but not dumpprivkey?
I still disagree.  I'd like to be able to export private keys from wallets, but really don't want to have to try to compile bitcoin again.  That was a complete PITA.
SgtSpike, are you on windows? Do you have a binary with this patch that you can provide? I've been looking for one for a while.

.BITSLER.                 ▄███
               ▄████▀
             ▄████▀
           ▄████▀  ▄██▄
         ▄████▀    ▀████▄
       ▄████▀        ▀████▄
     ▄████▀            ▀████▄
   ▄████▀                ▀████▄
 ▄████▀ ▄████▄      ▄████▄ ▀████▄
█████   ██████      ██████   █████
 ▀████▄ ▀████▀      ▀████▀ ▄████▀
   ▀████▄                ▄████▀
     ▀████▄            ▄████▀
       ▀████▄        ▄████▀
         ▀████▄    ▄████▀
           ▀████▄▄████▀
             ▀██████▀
               ▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄            
▄▄▄▄▀▀▀▀    ▄▄█▄▄ ▀▀▄         
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄      
█  ▀▄▄  ▀█▀▀ ▄      ▀████   ▀▀▄   
█ █▄  ▀▄   ▀████       ▀▀ ▄██▄ ▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█  ▀▀       ▀▄▄ ▀████      ▄▄▄▀▀▀  █
█            ▄ ▀▄    ▄▄▄▀▀▀   ▄▄  █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ ▄▄   ███   ▀██  █           ▀▀  █ 
█ ███  ▀██       █        ▄▄      █ 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
▀▄            █        ▀▀      █  
▀▀▄   ███▄  █   ▄▄          █   
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
▀▀▄   █   ▀▀▄▄▄▀▀▀         
▄▄▄▄▄▄▄▄▄▄▄█▄▄▀▀▀▀              
              ▄▄▄██████▄▄▄
          ▄▄████████████████▄▄
        ▄██████▀▀▀▀▀▀▀▀▀▀██████▄
▄     ▄█████▀             ▀█████▄
██▄▄ █████▀                ▀█████
 ████████            ▄██      █████
  ████████▄         ███▀       ████▄
  █████████▀▀     ▄███▀        █████
   █▀▀▀          █████         █████
     ▄▄▄         ████          █████
   █████          ▀▀           ████▀
    █████                     █████
     █████▄                 ▄█████
      ▀█████▄             ▄█████▀
        ▀██████▄▄▄▄▄▄▄▄▄▄██████▀
          ▀▀████████████████▀▀
              ▀▀▀██████▀▀▀
            ▄▄▄███████▄▄▄
         ▄█▀▀▀ ▄▄▄▄▄▄▄ ▀▀▀█▄
       █▀▀ ▄█████████████▄ ▀▀█
     █▀▀ ███████████████████ ▀▀█
    █▀ ███████████████████████ ▀█
   █▀ ███████████████▀▀ ███████ ▀█
 ▄█▀ ██████████████▀      ▀█████ ▀█▄
███ ███████████▀▀            ▀▀██ ███
███ ███████▀▀                     ███
███ ▀▀▀▀                          ███
▀██▄                             ▄██▀
  ▀█▄                            ▀▀
    █▄       █▄▄▄▄▄▄▄▄▄█
     █▄      ▀█████████▀
      ▀█▄      ▀▀▀▀▀▀▀
        ▀▀█▄▄  ▄▄▄
            ▀▀█████
[]
bmgjet
Member
**
Offline Offline

Activity: 98


View Profile
July 09, 2011, 01:26:58 AM
 #46

This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

+1 more.  This is a very important feature, whether it's exposed to end users or not.

Actually, I might have changed my mind (partly)

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

The importing of a privkey is the part that is important for users (bitbill, import key generated with external tool like vanitygen) and this part, luckyly, poses no problems (that I can see), does it?

So how about splitting this and putting importprivkey in default, but not dumpprivkey?
I still disagree.  I'd like to be able to export private keys from wallets, but really don't want to have to try to compile bitcoin again.  That was a complete PITA.
SgtSpike, are you on windows? Do you have a binary with this patch that you can provide? I've been looking for one for a while.

+1 tried compiling it but mingw and vc10 dont seem to like it.

Donations to: 1BMGjetfht9XLkGBYR4TSsuXjrYEKACcow
1stbits: 1bmgjet
300MHash/s 6850 http://www.techpowerup.com/gpuz/5u6wr/
Overclocked for 6 years and still strong http://valid.canardpc.com/show_oc.php?id=1931458 & http://valid.canardpc.com/show_oc.php?id=285337
riush
Member
**
Offline Offline

Activity: 73


View Profile
July 09, 2011, 01:48:07 AM
 #47

Well, I did a patch to remove keys, but it doesn't apply to the current state (after wallet class rework) anymore.
Also, you should really know what you are doing and review my code thoroughly before you use it, as I'm a total noob when it comes to C++ and I'm not confident on my grasp of the inner workings of bitcoin either...

https://github.com/mhanne/bitcoin/tree/showwallet-removeprivkey

http://forum.bitcoin.org/index.php?topic=19451

1MKKiJhUJgqKyfCLeo7bB1bvELNEM8wUbz
EricJ2190
Full Member
***
Offline Offline

Activity: 134


View Profile
July 09, 2011, 03:05:12 AM
 #48

+1 tried compiling it but mingw and vc10 dont seem to like it.

As I mentioned in the pull request comments, you need to add an include for fstream in headers.h. Anyway, here is my Windows MSVC10 build:
http://www.sendspace.com/file/lkoufm
bmgjet
Member
**
Offline Offline

Activity: 98


View Profile
July 09, 2011, 03:18:41 AM
 #49

Thank you EricJ2190.

---

getting a error with bitcoind

Entry point not found
msvcr100.dll

Have the latest VC redistribution installed.

--
fixed by taking the one from the VC10 folder.

Donations to: 1BMGjetfht9XLkGBYR4TSsuXjrYEKACcow
1stbits: 1bmgjet
300MHash/s 6850 http://www.techpowerup.com/gpuz/5u6wr/
Overclocked for 6 years and still strong http://valid.canardpc.com/show_oc.php?id=1931458 & http://valid.canardpc.com/show_oc.php?id=285337
SgtSpike
Legendary
*
Offline Offline

Activity: 1358



View Profile
July 09, 2011, 08:10:27 AM
 #50

I am not sure this a suitable to be on by default. This will cause a great amount of lost bitcoins because unsophisticated users are careless.

+1

This is fine living in a separate branch.

Being able to recompile a branch is a nice
barrier of entry for the tech. clueless.
This SHOULD be included in the default client.  Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies.

Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing.

No it wouldn't.

If you're desperate enough for the feature and not smart enough to follow
a wiki explaining how to recompile it, you'll find a way by asking someone
to do it for you.

In the end very few percentage of the user base will do this and people
will prefer the 'official' client because it'll be perceived as more 'safe'.

Again: barrier of entry, which will lower the percentage of fools screwing
around with their wallet not realizing the giant security risk they expose
themselves to when manipulating private keys directly.

Don't get me wrong, I find the feature very useful. But in the same way
you don't hand out a loaded AK-47 to a 5 year old, this feature belongs
in a branch.

Would you walk out of your bank with a 1kg gold bar sticking out of your
pocket ? You can argue that you're a grown man and that decision belong
to you. Fair enough, but when you're allowed to do this and it jeopardizes
the entire bitcoin ecosystem ... I don't agree.
I guess we're all entitled to our own opinions.

And where is this wiki article you speak of?  The only detailed compile instructions I've seen were posted on this forum, and involved MinGW and about 3 hrs of work downloading dependencies and waiting for things to compile.  It worked, after I figured out why a couple of things weren't working.

I still have no clue what to do with a patch file either.

Also, I certainly don't want to have to spend another 3 hours recompiling bitcoin with the patch every time a new version comes out.  That's just a waste of my time.  It's a waste of everyone's time to have to compile their own client in order to import/export keys.

There are other, much better ways to deal with potential user incompetence.  Have a checkbox with big red flashing text, saying "Are you sure you want to delete this key from your wallet?  It is unrecoverable unless you have saved it safely elsewhere," and then a more detailed explanation beneath that.
samr7
Full Member
***
Offline Offline

Activity: 140

Firstbits: 1samr7


View Profile
July 09, 2011, 08:50:37 AM
 #51

If you're desperate enough for the feature and not smart enough to follow
a wiki explaining how to recompile it, you'll find a way by asking someone
to do it for you.

I had no trouble building a patched bitcoin client on Linux.  However, building bitcoin on Windows would seem to be a black art.  I don't think it's fair to use it as a barrier to entry.  Plus, this feature requires the JSON-RPC server to be enabled, and use of the command line.  Isn't that enough of a barrier?
rabit
Member
**
Offline Offline

Activity: 62


View Profile
July 09, 2011, 11:39:08 AM
 #52

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

So how about splitting this and putting importprivkey in default, but not dumpprivkey?

Does this mean that  dumpprivkey removes the private key from the wallet, because the documentation is not clear for me and i am too lazy to learn C++ (it could also just show the data of the key without removing it)?

Quote
Well, I did a patch to remove keys, but it doesn't apply to the current state (after wallet class rework) anymore.
Also, you should really know what you are doing and review my code thoroughly before you use it, as I'm a total noob when it comes to C++ and I'm not confident on my grasp of the inner workings of bitcoin either...

https://github.com/mhanne/bitcoin/tree/showwallet-removeprivkey

http://forum.bitcoin.org/index.php?topic=19451

Unfortunately i need both import and export and my C++ is limited to the C part without the (confusing Cheesy) ++, but i will try to use it if no better solution is implemented. Will send you and sipa 0.5 BTCs.

EDIT: Nice, your version also have importkey if i read your code correct, will try it out Smiley
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1050


View Profile WWW
July 09, 2011, 11:40:08 AM
 #53

dumpprivkey only exports, it does not modify your wallet at all.

aka sipa, core dev team

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

Activity: 2324



View Profile
July 09, 2011, 11:52:46 AM
 #54

dumpprivkey only exports, it does not modify your wallet at all.

Should dumpprivkey remove the key from the wallet, though?

Not doing so can very easily lead to having the key in multiple wallets. This can even happen to people who are able to patch and compile bitcoin on windows.

So please, let's discuss what we should do, because clearly, key import is a great feature many people want. Key export is also wanted by many, but dangerous to bitcoin credibility (I can see the posts: "my bitcoin just disappeared for no reason!! the sky is falling!") in it's current form.

My suggestion is to either..

  • put key export into separate patch and pull only importprivkey into default, or
or

  • make dumpprivkey remove the key from the wallet (maybe rename to "removeprivkey" or similar)

What to do?

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

Activity: 62


View Profile
July 09, 2011, 11:59:00 AM
 #55

I want remove key because i will be able to use it in a crappy smart card solution:
Load key from SC -> add to wallet -> Make transaction -> Remove from wallet.
 
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1050


View Profile WWW
July 09, 2011, 12:00:57 PM
 #56

You should know that whenever you import a private key, you need to trust the one who gave it to you. There is no way around that, not even a patch that would make dumpprivkey remove a key by default. If you do not have the necessary level of trust in the person you're dealing with, you shouldn't be exchanging private keys, but using normal bitcoin transactions.

That said, a removeprivkey would be very useful, as a separate command (i believe i saw an implementation already somewhere). I don't think removing within dumpprivkey by default is safe - what if you intend to write it down on paper, but the computer crashes before you're able to do so? The correct procedure would be dumpprivkey to extract a key, and as soon as it is safe, issue removeprivkey.

aka sipa, core dev team

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

Activity: 2324



View Profile
July 09, 2011, 01:28:20 PM
 #57

You should know that whenever you import a private key, you need to trust the one who gave it to you. There is no way around that, not even a patch that would make dumpprivkey remove a key by default. If you do not have the necessary level of trust in the person you're dealing with, you shouldn't be exchanging private keys, but using normal bitcoin transactions.

That said, a removeprivkey would be very useful, as a separate command (i believe i saw an implementation already somewhere). I don't think removing within dumpprivkey by default is safe - what if you intend to write it down on paper, but the computer crashes before you're able to do so? The correct procedure would be dumpprivkey to extract a key, and as soon as it is safe, issue removeprivkey.

Yes, +1 for removeprivkey as extra command.

Because without it, how could I trust even myself to not spend the money if I'm not even able to remove the key!?!

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

Activity: 1358



View Profile
July 10, 2011, 02:50:43 AM
 #58

Quote
There are other, much better ways to deal with potential user incompetence.  Have a checkbox with big red flashing text, saying "Are you sure you want to delete this key from your wallet?  It is unrecoverable unless you have saved it safely elsewhere," and then a more detailed explanation beneath that.

There are indeed many ways to deal with user incompetence, and
this is one way I like very much, especially the "I'd have to recompile
the client every time a new version comes out" part.

This is a barrier of entry, it's guaranteed to keep the great unwashed
masses away from using the feature, and it's not an elitist one because
all you have to do to overcome the barrier is educate yourself, which
no one prevents you from doing.

Also: the 20th century is long over. High time to ditch windows unless
you want to be increasingly perceived as a has-been.

Here we go, another Linux elitist.   Roll Eyes  I happen to like Windows, so I use it.  Sorry if that means I'm stuck in the dark ages to you.

You should know that whenever you import a private key, you need to trust the one who gave it to you. There is no way around that, not even a patch that would make dumpprivkey remove a key by default. If you do not have the necessary level of trust in the person you're dealing with, you shouldn't be exchanging private keys, but using normal bitcoin transactions.

That said, a removeprivkey would be very useful, as a separate command (i believe i saw an implementation already somewhere). I don't think removing within dumpprivkey by default is safe - what if you intend to write it down on paper, but the computer crashes before you're able to do so? The correct procedure would be dumpprivkey to extract a key, and as soon as it is safe, issue removeprivkey.

Yes, +1 for removeprivkey as extra command.

Because without it, how could I trust even myself to not spend the money if I'm not even able to remove the key!?!
Another +1 for having removeprivkey as a command.  What's the point of exporting if you can't delete the key from the wallet?  I mean, really, honestly, I can't think of any reason to export a key other than to get the address out of that particular wallet and into safe storage or into another wallet.  Tis pointless to export a key otherwise.
Ukigo
Hero Member
*****
Offline Offline

Activity: 938


View Profile
July 10, 2011, 05:27:01 AM
 #59

Is it safe to compile "showwallet" branch
with gcc's '-fstack-protector' flag enabled ?!

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

Activity: 190


View Profile
July 10, 2011, 09:29:17 AM
 #60

Exporting of a key has a problem, doesn't it: the key is still in the source wallet. There's no way to remove it, is there? Even if there is, it's easy to screw up and people will wonder where their money went.

I do not seet it as a problem, so what if I have the same private key in many wallets?  Actually for me that is the case, because I store my wallets in many places on the internet. Encrypted of course.
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!