Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: greenhallo8 on June 08, 2020, 12:38:35 PM



Title: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: greenhallo8 on June 08, 2020, 12:38:35 PM
Hello,

Is it possible to get the private key from a Bitcoin raw transaction?

Thank you in advance,


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: TheArchaeologist on June 08, 2020, 01:17:58 PM
No, it is not. There is a reason it's called private.

The private key is used for signing transactions, thankfully the key itself is not exposed. This it the key principle of asymmetric cryptography.


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: bob123 on June 08, 2020, 01:40:31 PM
Is it possible to get the private key from a Bitcoin raw transaction?

No.
A "raw transaction" is simply a transaction.
I guess you are referring to the getrawtransaction CLI command from core ?

You can use the -v (verbose) flag to get more information about that transaction.

However, a private key is never included in a transaction.
The private key is used to sign the transaction.

Transactions are being broadcasted into the network. They simply can not contain your private key without the whole system being worthless and broken.


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: bitmover on June 08, 2020, 03:10:34 PM
The private key is used to sign the transaction.

Transactions are being broadcasted into the network. They simply can not contain your private key without the whole system being worthless and broken.

Additionally to what bob123 said,  the signature is broadcasted into the network, not the private key.

This is very basic cyber security. THis is why it is safe. Keys are never broadcasted, only the signature which were created by the private keys. The keys never leave the device.


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: hosseinimr93 on June 08, 2020, 06:34:04 PM
As already stated in previous posts, the private key is not revealed in the raw transaction. So, you may ask how the signature is verified without knowing the private key.

The public key is a function of the private key. So they are related to each other and nodes use the public key (without any need to the private key) to validate the signature.
The transaction you create includes a hash and a signature.
Nodes use the public key and the signature to generate a hash. If the hash generated by nodes matches the hash broadcast by you, they will validate your transaction.



Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: pooya87 on June 09, 2020, 04:26:08 AM
it depends on what you mean by "raw transaction".
the entire bitcoin blockchain that is more than 200 GB is all raw transactions and as others have already said multiple times, you can't get private key from any of them. if you could bitcoin wouldn't have existed!

but if it is a transaction made locally, is unsigned, has other information inside to help signing, created by a weird implementation,... then it is a completely different discussion. for example Electrum unsigned raw transactions contain the master public key. even though you still can't get the private key from that but if a single private key from that wallet is known the master private key (and all other keys) can be computed from that.
or for example there were cases where the implementation was terrible (eg. blockchain.info in the past) and they reused k while signing and that led to easy computation of the private key by just having the signature (the raw tx).


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: Marynarz on June 12, 2020, 07:47:12 PM
Hello,

Is it possible to get the private key from a Bitcoin raw transaction?

Thank you in advance,

https://www.youtube.com/watch?v=yPGGhwGGdFg


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: bob123 on June 12, 2020, 09:13:11 PM
https://www.youtube.com/watch?v=yPGGhwGGdFg

This completely generic video does not help OP at all.
The answer simply is no.

This video just shows how to retrieve a transaction. It doesn't help OP at all.


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: Marynarz on June 12, 2020, 09:33:42 PM
https://www.youtube.com/watch?v=yPGGhwGGdFg

This completely generic video does not help OP at all.
The answer simply is no.

This video just shows how to retrieve a transaction. It doesn't help OP at all.

Watch with understanding ;)


Title: Re: Is it possible to get the private key from a Bitcoin raw transaction?
Post by: bob123 on June 13, 2020, 09:18:31 AM
Watch with understanding ;)

I don't need to watch it completely.

If your statement is, that it is possible to retrieve a private key from a signed transaction, it simply is wrong.
There is no poorly made YT video which could convince me otherwise.