Bitcoin Forum
December 09, 2016, 03:57:21 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Priv/pub key pairs I'm generating do not import correctly into wallet? [solved]  (Read 1040 times)
BTCurious
Hero Member
*****
Offline Offline

Activity: 714


^SEM img of Si wafer edge, scanned 2012-3-12.


View Profile
June 28, 2011, 05:36:10 PM
 #1

EDIT: The problem does not seem to be in the generation of the keys. Probably the importing then. Scroll a few posts down for details on that…

I've been trying to generate priv/pub key pairs, and adding them to my wallet. It seemed to be working, however, when I send money to one of these, it doesn't appear back in my wallet. So either I didn't add it properly, or the keys/hashes are wrong. Can anyone check if these (example) keys and address are consistent with eachother?

Code:
Address:
17fhqnxers2WAnsKRFV2cjXENe6QX2an4e

Public key:
0494578b727fad5819f856cb862905b16575aed19551e8e6ab2d35873dd7b6bdfdca5401234a26318e47b4b6e962695ab31600e9dcfdd12573b03fcafe0d308efb

Private key base58:
9CCMrm42J1XnyVkS6c91XSSjF6L6wFcQnTHoBBkrrKTj

Private key hex:
79bbba8a53ae3ca15a723bd6588991863e3015a03530c09c453370045a402bae

Private key full hex (as it would appear in the wallet):
30820113020101042079bbba8a53ae3ca15a723bd6588991863e3015a03530c09c453370045a402baea081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000494578b727fad5819f856cb862905b16575aed19551e8e6ab2d35873dd7b6bdfdca5401234a26318e47b4b6e962695ab31600e9dcfdd12573b03fcafe0d308efb

This is probably not going to work in the newbie forum, is it? :/

1481255841
Hero Member
*
Offline Offline

Posts: 1481255841

View Profile Personal Message (Offline)

Ignore
1481255841
Reply with quote  #2

1481255841
Report to moderator
1481255841
Hero Member
*
Offline Offline

Posts: 1481255841

View Profile Personal Message (Offline)

Ignore
1481255841
Reply with quote  #2

1481255841
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1344


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 28, 2011, 05:37:42 PM
 #2

All valid private keys in base 58 should start with a '5'.  Yours doesn't, so it is definitely not right.

When you base58 a private key, it's 0x80 + 32byteprivatekey, followed by a 4-byte checksum.

so in other words, 8079bbba8a53ae3ca15a723bd6588991863e3015a03530c09c453370045a402baeXXXXXXXX
where XXXXXXXX is first 4 bytes of sha256(sha256(8079bbba8a53ae3ca15a723bd6588991863e3015a03530c09c453370045a402bae))

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper wallets instead.
BTCurious
Hero Member
*****
Offline Offline

Activity: 714


^SEM img of Si wafer edge, scanned 2012-3-12.


View Profile
June 28, 2011, 05:44:44 PM
 #3

Is that convention, or does it actually show back in the wallet?

In the wallet one just stores the hex value, right? Or does that also have associated checksums and such?

casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1344


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
June 28, 2011, 05:46:08 PM
 #4

Is that convention, or does it actually show back in the wallet?

In the wallet one just stores the hex value, right? Or does that also have associated checksums and such?

The client only stores the hex value.

This might seem simple and trivial, but you're using secp256k1 right?

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper wallets instead.
BTCurious
Hero Member
*****
Offline Offline

Activity: 714


^SEM img of Si wafer edge, scanned 2012-3-12.


View Profile
June 28, 2011, 05:49:12 PM
 #5

Yep, I am.

Edit: Someone on IRC just confirmed he got the same address from my private key, so that seems to work.
Then the problem would be with importing… not sure where I messed that up... *thinks

SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
June 28, 2011, 05:55:53 PM
 #6

Subbing, for when you figure out the problem I'm interested in the final script.  Smiley
BTCurious
Hero Member
*****
Offline Offline

Activity: 714


^SEM img of Si wafer edge, scanned 2012-3-12.


View Profile
June 28, 2011, 06:15:15 PM
 #7

EDIT: I thought I started with -rescan before, but I just did it again, and now it's working properly.
Awesome! Consider this solved Smiley

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!