Author

Topic: how to check is private key valid? (Read 2304 times)

legendary
Activity: 1456
Merit: 1078
I may write code in exchange for bitcoins.
June 29, 2017, 01:15:32 PM
#17
But it's certainly correct that the process is completely specified.  There's a python library that you can use to play around with keys from numbers, maybe 'ku' (key utils), don't remember.  
And what name of this library? I will be very appreciate you

Here: https://github.com/richardkiss/pycoin
sr. member
Activity: 377
Merit: 282
Finis coronat opus
June 27, 2017, 05:48:40 PM
#16
1) Print like 10 private keys, send money to 9 of them. If they all work then chances are the remaining one should work also. Bitaddress.org I think prints 7 pub+priv key pairs at a time.

Sorry, but i think it's to complicated and the last key could be invalid.
If 9 keys works fine, you don't need the last one  Smiley

If I recall correctly you can actually generate two bitcoin addresses from a given random number.
Only one if you're using one algo.

But it's certainly correct that the process is completely specified.  There's a python library that you can use to play around with keys from numbers, maybe 'ku' (key utils), don't remember.  
And what name of this library? I will be very appreciate you
legendary
Activity: 3416
Merit: 4658
June 26, 2017, 09:56:42 AM
#15
Talking about the two address (or public keys) do you mean "Bitcoin address" and "Bitcoin Adress compressed". Because this is the same thing (same address). Just one is compressed?

Compressed does not mean that the address is compressed.  The address is generally the same size in either.

The full name would be "compressed key address".  In other words, the key is compressed (the public key), not the address.

Addresses don't actually exist at the transaction or blockchain level.  Addresses are just an abstraction wallets use to make it easier for us humans to talk about transferring control over value.  Those addresses get translated into scripts when the wallet builds the transaction.

There are several different types of scripts, and as such a single private key can result in MANY different scripts.  Many of them would have a unique address associated, some wouldn't have any address at all, but would still be valid transactions with spendable outputs.

Pay-to-PubKeyHash (P2PKH) scripts are represented with the type of address that starts with a "1".  In that case, you must supply the public key when you spend it.  Using a compressed key address means that when you spend that output you'll only need to supply half of the public key (32 bytes).  The other half can be computed from that, which saves you 32 bytes when you spend it and results in a cheaper transaction fee.

So there are exactly two public address derived from a private key. No more no less... right?

  • There is exactly 1 uncompressed key P2PKH address
  • There is exactly 1 compressed key P2PKH address
  • There are ~2160 P2SH addresses (Addresses that start with a "3")
  • Segwit will eventually introduce 1 or more additional address types
  • There are many spendable output scripts that don't translate to an address
member
Activity: 154
Merit: 29
June 26, 2017, 08:24:42 AM
#14
So there are exactly two public address derived from a private key. No more no less... right?
HCP
legendary
Activity: 2086
Merit: 4314
June 26, 2017, 07:34:53 AM
#13
They're technically two different addresses... and act as such as far as transactions and balance are concerned. They are just derived from the same private key.

So, you can send coins to 1bitcoinAddress and the coins won't show in 1bitcoinCompAddr... likewise, you can send to 1bitcoinCompAddr and the coins won't show in 1bitcoinAddress. However, if you have the private key you can spend coins sent to either address.
member
Activity: 154
Merit: 29
June 26, 2017, 06:00:16 AM
#12
HI-TEC99,

Talking about the two address (or public keys) do you mean "Bitcoin address" and "Bitcoin Adress compressed". Because this is the same thing (same address. Just one is compressed?

thanks
legendary
Activity: 2772
Merit: 2846
June 25, 2017, 08:23:37 PM
#11
if I understand well : private key is a combining of random number between 1 and 10^77.

From this private key is derived a bitcoin address with a precise algorithm.

As long as you send BTC to this bitcoin address which has been derived from your private key : you can safely say that you have the control of your fund and that your private key is valid.

can someone confirm?

Correct.

If I recall correctly you can actually generate two bitcoin addresses from a given random number.  But it's certainly correct that the process is completely specified.  There's a python library that you can use to play around with keys from numbers, maybe 'ku' (key utils), don't remember.  Anyway, python is convenient for learning, I think, the code is pretty readable and you can use the REPL to explore interactively.

Yes, the example in the quote below shows the two different valid addresses derived from the same private key (extremely long random number).

The first notepad screenshot is of the extremely long number (in hex format) that the two Bitcoin addresses were derived from.








This is the private key copied from notepad and pasted into an offline copy of the bitaddress wedsite. Click the view details button to get the private key converted to normal formats.





This is my multibit wallet's address 1F84fkbMng6dJpGZmtycRbUe72B7XSYbeT shown on the right hand side of bitaddress. Every raw private key can convert into two different bitcoin addresses, which is why there's two.




legendary
Activity: 1456
Merit: 1078
I may write code in exchange for bitcoins.
June 25, 2017, 03:30:03 PM
#10
if I understand well : private key is a combining of random number between 1 and 10^77.

From this private key is derived a bitcoin address with a precise algorithm.

As long as you send BTC to this bitcoin address which has been derived from your private key : you can safely say that you have the control of your fund and that your private key is valid.

can someone confirm?

Correct.

If I recall correctly you can actually generate two bitcoin addresses from a given random number.  But it's certainly correct that the process is completely specified.  There's a python library that you can use to play around with keys from numbers, maybe 'ku' (key utils), don't remember.  Anyway, python is convenient for learning, I think, the code is pretty readable and you can use the REPL to explore interactively.
copper member
Activity: 1330
Merit: 899
🖤😏
June 25, 2017, 04:45:39 AM
#9
How specifically I can " Sign and Verify your private key."? thanks
You can't sign a message with some body else private key, you'll need to find "sign/verify message" in Electrum menu and if you own an address you will just have to put address in it's place in the middle, then write a message where it says "Message" and click on sign it will then gives you the signature, if you want to verify then you'll just copy paste a signature an address with message and click on verify.
member
Activity: 154
Merit: 29
June 25, 2017, 04:21:21 AM
#8
How specifically I can " Sign and Verify your private key."? thanks
legendary
Activity: 3738
Merit: 1708
CoinPoker.com
June 23, 2017, 03:46:39 PM
#7
I had the same paranoia. There are a few things you can do.


1) Print like 10 private keys, send money to 9 of them. If they all work then chances are the remaining one should work also. Bitaddress.org I think prints 7 pub+priv key pairs at a time.

2) Sign and Verify your private key. This will confirm if the private key can actually send funds from the public key.

3) Use something like Electrum with a 2nd computer. You sign the transaction on the offline computer, and broadcast on the online computer. So you can send a small amount of BTC to an address, and try to send it, if it works then just reuse that address again.
Yes I know reuseing addresses is not recommended but quantum computers are decades away.
legendary
Activity: 3416
Merit: 4658
June 22, 2017, 08:28:59 AM
#6
if I understand well : private key is a combining of random number between 1 and 10^77.

From this private key is derived a bitcoin address with a precise algorithm.

As long as you send BTC to this bitcoin address which has been derived from your private key : you can safely say that you have the control of your fund and that your private key is valid.

can someone confirm?

Correct.
member
Activity: 154
Merit: 29
June 22, 2017, 06:32:08 AM
#5
 if I understand well : private key is a combining of random number between 1 and 10^77.

From this private key is derived a bitcoin address with a precise algorithm.

As long as you send BTC to this bitcoin address which has been derived from your private key : you can safely say that you have the control of your fund and that your private key is valid.

can someone confirm?
member
Activity: 154
Merit: 29
June 21, 2017, 04:32:17 PM
#4
IMHO, a good way to cross verify is using https://coinb.in. Download the source from Github and open it offline. Then provide your private key in WIF to see if that corresponds to the same bitcoin address as generated by bitaddress.org.

Is that not doing the same thing as using "wallet details" section offline of bitaddress.org?

thanks
legendary
Activity: 2520
Merit: 3238
The Stone the masons rejected was the cornerstone.
June 20, 2017, 08:56:00 AM
#3
I had the same question...go here



https://bitcointalksearch.org/topic/m.19583573
sr. member
Activity: 329
Merit: 251
June 20, 2017, 08:28:15 AM
#2
Hello,

I have created a paper wallet. I have a encrypted private key with password and a bitcoin public address.

using bitaddress.org, Ihave tried to decrypt the private key with password (doing this offline) and this worked fine : I recover the BTC address and the private key with no encryption...

However, I am wondering if this is enough to make sure that my private key is valid?

thanks

 

IMHO, a good way to cross verify is using https://coinb.in. Download the source from Github and open it offline. Then provide your private key in WIF to see if that corresponds to the same bitcoin address as generated by bitaddress.org.
member
Activity: 154
Merit: 29
June 20, 2017, 06:30:31 AM
#1
Hello,

I have created a paper wallet. I have a encrypted private key with password and a bitcoin public address.

using bitaddress.org, Ihave tried to decrypt the private key with password (doing this offline) and this worked fine : I recover the BTC address and the private key with no encryption...

However, I am wondering if this is enough to make sure that my private key is valid?

thanks

 
Jump to: