Bitcoin Forum
April 30, 2024, 12:17:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: compressed private key  (Read 180 times)
karusell22 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 16
Merit: 4


View Profile
January 28, 2024, 08:54:06 PM
 #1

hey,


i have following issue

i have a privat key which starts with L ( its from 2014 ) and i took the private key from the blockchain.com wallet ( previously info )

so what i have read is that if it starts with L its compressed so i need to uncompress it.

If i uncompress it will it work 100% and i have access to the bitcoins or not?



could someone elaborate the steps how to uncompress it?

im just afraid because i have read that private key is linked to 2 public adresses or something and if the uncompressed priv key is for the second adress which doesnt hold my funds then i dont have access?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714479421
Hero Member
*
Offline Offline

Posts: 1714479421

View Profile Personal Message (Offline)

Ignore
1714479421
Reply with quote  #2

1714479421
Report to moderator
1714479421
Hero Member
*
Offline Offline

Posts: 1714479421

View Profile Personal Message (Offline)

Ignore
1714479421
Reply with quote  #2

1714479421
Report to moderator
1714479421
Hero Member
*
Offline Offline

Posts: 1714479421

View Profile Personal Message (Offline)

Ignore
1714479421
Reply with quote  #2

1714479421
Report to moderator
Charles-Tim
Legendary
*
Offline Offline

Activity: 1526
Merit: 4831



View Profile
January 28, 2024, 08:58:10 PM
 #2

Import the private key into wallet like Electrum and you will be able to access your coin and spend it. Compressed private key can start from K or L and they are wallet import formats (WIF).

Uncompressed private keys start from 5 and they are also WIF.

.
HUGE
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
karusell22 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 16
Merit: 4


View Profile
January 28, 2024, 09:01:51 PM
 #3

i havent tried it yet, but electrum supports compressed private keys?

Because i have read that some users imported compressed private keys to electrum and the pub adress was a completely different one.

unfortunately im not home so i cant test.
Charles-Tim
Legendary
*
Offline Offline

Activity: 1526
Merit: 4831



View Profile
January 28, 2024, 09:07:31 PM
 #4

i havent tried it yet, but electrum supports compressed private keys?

Because i have read that some users imported compressed private keys to electrum and the pub adress was a completely different one.

unfortunately im not home so i cant test.
I have given you the information that you need. You can import it. It would work.

If it is huge amount of money, you can import it on wallet on an airgapped device and use watch-only wallet to create unsigned transaction and use the wallet on the airgapped device to sign.

https://electrum.readthedocs.io/en/latest/coldstorage.html

.
HUGE
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
karusell22 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 16
Merit: 4


View Profile
January 28, 2024, 09:35:58 PM
 #5

thank you

if i import the private key on an offline device with electrum installed,  it will instantly confirm if the private key is valid to the belonging pub adress?
Charles-Tim
Legendary
*
Offline Offline

Activity: 1526
Merit: 4831



View Profile
January 28, 2024, 09:42:20 PM
Merited by pooya87 (2)
 #6

if i import the private key on an offline device with electrum installed,  it will instantly confirm if the private key is valid to the belonging pub adress?
On offline Electum, it will not synchronized with the blockchain and you will not see your coins. You know that you have coins there, you can see it through the watch-only wallet which is online and which you can use to create an unsigned transaction, send it to the offline Electum through QR code or USB stick. The offline Electum will only be used for signing the unsigned transaction and you will send the signed transaction back to the watch-only wallet to broadcast it.

This guide is for mobile Electrum but it would be of help if you use QR code for unsigned and signed transaction transfer:

Okay, here's the procedure to create a cold-storage mobile Electrum wallet:
  • 1. Install Electrum on both devices, and create a standard wallet on the "cold storage" device, that will be your main wallet that contains all the keys and shouldn't be connected to the internet even once (a newly formatted device/new device is better).
    Make sure that the seed was saved in a physical backup like a piece of paper.
  • 2. Click the wallet's name on top of the screen and click "Master Public key" twice to open the QR code.
  • 3. On the online phone, create a new wallet using the option "Standard Wallet->Use a master key", then click the camera icon to scan the cold-storage wallet's QR code.
    This will create a watch-only wallet version of your cold-storage wallet.
  • 4. Confirm if the address in the receive tab is the same.

Now to use those wallets:
  • You just have to create a transaction using the online watch-only wallet using the send tab.
  • Fill out the recipient, amount, etc. then, click pay (select if you want to opt-in RBF, yes) and click the QR code icon below.
  • In the cold-storage wallet, go to send tab and click the camera icon on the right side and scan the other device's QR code.
  • The transaction will be imported to the cold-storage wallet, now click option->sign (enter your pin) and it will be marked as "signed" above.
  • Click the QR code icon, then scan this using your online watch-only wallet and the signed transaction will be imported and now you can use options->broadcast button to send it to the network.

If you're not familiar with Electrum's defaut bitcoin denomination, you can change it from mBTC to BTC in the settings->denomination.

.
HUGE
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
karusell22 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 16
Merit: 4


View Profile
January 28, 2024, 09:44:43 PM
 #7

thank you

is there any other way to check if the private key is valid to the pub adress without signing a transaction?
hosseinimr93
Legendary
*
Online Online

Activity: 2380
Merit: 5235



View Profile
January 28, 2024, 09:57:39 PM
Merited by pooya87 (2), ABCbits (1), Charles-Tim (1)
 #8

Because i have read that some users imported compressed private keys to electrum and the pub adress was a completely different one.
Compressed and uncompressed formats of your private key would generate different addresses.
Most probably, you don't need to derive the uncompressed format of your private key. It's not common to use uncompressed private keys and the address you are looking for is probably derived from the compressed private key.


if i import the private key on an offline device with electrum installed,  it will instantly confirm if the private key is valid to the belonging pub adress?
If you import your private key into electrum, you will see the derived address and you can check if that's correct.
If the address is correct, it means that you have the correct private key.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Cricktor
Hero Member
*****
Offline Offline

Activity: 742
Merit: 1102


Crypto Swap Exchange


View Profile
January 28, 2024, 10:08:10 PM
 #9

so what i have read is that if it starts with L its compressed so i need to uncompress it.

If i uncompress it will it work 100% and i have access to the bitcoins or not?

A private key is simply a stream of 256 random bits and both an uncompressed private key WIF and a compressed private key WIF represent the very same sequence of 256 bits.

Take e.g. this (definitely not random at all) private key in hex form:
0000000000000000000000000000000000000000000000000000000000000001

For this bit sequence the uncompressed WIF representation is:
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
and the compressed WIF representation is:
KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

Note that the "compressed" WIF is actually 1 char longer than the uncompressed WIF. That's not something you'd normally associate with "compressed", isn't it funny?

From such a private key you can derive by elliptic curve magic a public key which you can have in an uncompressed form and a compressed form. From above example private key we get
uncompressed (130 chars):
0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C 4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
compressed (66 chars):
0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

From each public key you can derive a legacy public address...
uncompressed: 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm
  compressed: 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH

With your own particular private key it simply depends to which public address your funds have been sent. If necessary, it is possible to convert a compressed private key WIF to the uncompressed WIF form in a secure air-gapped computer environment. There are different tools available for this. I did above example with the verified code from https://github.com/pointbiz/bitaddress.org.

As Charles-Tim already pointed out, you can import a WIF into Electrum (use p2pkh:<WIF char sequence> to import for legacy addresses), both compressed or uncompressed, whatever you need in particular.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
karusell22 (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 16
Merit: 4


View Profile
January 28, 2024, 10:36:30 PM
 #10

so what i have read is that if it starts with L its compressed so i need to uncompress it.

If i uncompress it will it work 100% and i have access to the bitcoins or not?

A private key is simply a stream of 256 random bits and both an uncompressed private key WIF and a compressed private key WIF represent the very same sequence of 256 bits.

Take e.g. this (definitely not random at all) private key in hex form:
0000000000000000000000000000000000000000000000000000000000000001

For this bit sequence the uncompressed WIF representation is:
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
and the compressed WIF representation is:
KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

Note that the "compressed" WIF is actually 1 char longer than the uncompressed WIF. That's not something you'd normally associate with "compressed", isn't it funny?

From such a private key you can derive by elliptic curve magic a public key which you can have in an uncompressed form and a compressed form. From above example private key we get
uncompressed (130 chars):
0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C 4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
compressed (66 chars):
0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

From each public key you can derive a legacy public address...
uncompressed: 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm
  compressed: 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH

With your own particular private key it simply depends to which public address your funds have been sent. If necessary, it is possible to convert a compressed private key WIF to the uncompressed WIF form in a secure air-gapped computer environment. There are different tools available for this. I did above example with the verified code from https://github.com/pointbiz/bitaddress.org.

As Charles-Tim already pointed out, you can import a WIF into Electrum (use p2pkh:<WIF char sequence> to import for legacy addresses), both compressed or uncompressed, whatever you need in particular.


wow...

so this means that i will have access to both public adress , one via the compromised priv key and one with the uncompromised, which means that i will 100% access my coins no matter what?

im so sorry i feel so dumb
Cricktor
Hero Member
*****
Offline Offline

Activity: 742
Merit: 1102


Crypto Swap Exchange


View Profile
January 28, 2024, 11:39:54 PM
 #11

Yes, you can have access to funds sent to the "uncompressed" public  address and the "compressed" one. You could even have access to the corresponding nested segwit address 3... or the native segwit address (type 0) bc1q... if necessary.

A clear warning from my side: when you handle unprotected private key data, it is imperative and mandatory to know what you're doing and doing it only in a secure computer environment which should ideally be and stay air-gapped (a disposable OS instance like a Live Linux that runs only in RAM and has no network connection whatsoever should be fine as this shouldn't leave any data traces behind after you shutdown it).

Improper security and not verifying the authenticity of your tools can lead to stolen keys and funds. Don't be reckless!

There's no need to feel sorry or dumb, you have learned something today and Bitcoin knowledge doesn't come on its own.
Stay curious and learn!

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
January 29, 2024, 05:12:48 AM
Merited by LoyceV (4), Cricktor (1)
 #12

wow...

so this means that i will have access to both public adress , one via the compromised priv key and one with the uncompromised, which means that i will 100% access my coins no matter what?

im so sorry i feel so dumb
Please do not "compress" or "uncompress" your private keys. Your wallet should already define what kind of keys it is by generating the appropriate private keys and you should not do anything beyond simply importing it. Converting it between various formats could potentially result in the loss of funds. For example, using uncompressed public keys for bech32 results in a non-standard address.

If you want to have a different address, generate a new key using a wallet and don't do any conversions.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3211



View Profile
January 31, 2024, 07:43:06 AM
Merited by LoyceV (4), ABCbits (2), hosseinimr93 (2), Cricktor (1)
 #13

The term "compressed private key" is a misnomer. A "compressed" private key is not compressed as the name states. It is actually the public key that is compressed (by removing unnecessary information).

Instead, a compressed private key is just a private key with additional data that tells the wallet to use the compressed public key to generate the address.

An uncompressed private key does not have that extra data, so the wallet knows to use the uncompressed public key.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!