Bitcoin Forum

Bitcoin => Electrum => Topic started by: JasonSato on May 05, 2022, 03:35:29 PM



Title: Decode a signed transaction and the private key?
Post by: JasonSato on May 05, 2022, 03:35:29 PM
I want to send 0.1 BTC to my friend but he wants to broadcast it himself.
If I sign a transaction with Electrum and send the raw text to someone, can he decode it to find my private key? or make another tx with that?


Title: Re: Decode a signed transaction to find the private key?
Post by: hosseinimr93 on May 05, 2022, 03:51:12 PM
If I sign a transaction with Electrum and send the raw text to someone, can he decode it to find my private key?
No. Your raw transaction doesn't include your private key. Instead, it includes a digital signature which can be used only for that transaction and becomes invalid if transaction data is changed.
By the way, why doesn't your friend let you broadcast the transaction yourself?


Title: Re: Decode a signed transaction to find the private key?
Post by: JasonSato on May 05, 2022, 04:22:14 PM
No. Your raw transaction doesn't include your private key. Instead, it includes a digital signature which can be used only for that transaction and becomes invalid if transaction data is changed.
By the way, why doesn't your friend let you broadcast the transaction yourself?
Thanks for your explanation.
He just wants to broadcast two transactoions at a time.
So there is no possibility of hacking a wallet by decoding a raw transaction.


Title: Re: Decode a signed transaction to find the private key?
Post by: BlackHatCoiner on May 05, 2022, 04:30:48 PM
So there is no possibility of hacking a wallet by decoding a raw transaction.
No, that's what is contained in blocks publicly anyways. Take a random transaction and search it on a block explorer, such as mempool.space: https://mempool.space/api/tx/da526ae2f1d8b58253dc9e26810a8e76c8eb11a8ebe995e132a4b22740b38773/hex

This is how public key cryptography works. You can verify one owns the private key without knowing it.


Title: Re: Decode a signed transaction to find the private key?
Post by: BitMaxz on May 05, 2022, 11:49:31 PM
Thanks for your explanation.
He just wants to broadcast two transactoions at a time.
So there is no possibility of hacking a wallet by decoding a raw transaction.

So you mean he wants to combine two transactions with your sign raw transaction?

He won't be able to do that what he can do only is to broadcast the transaction. The generated raw transaction is unique for every transaction and private keys are not included in this.

Why don't you just broadcast it instead of giving it to him for safety purposes?


Title: Re: Decode a signed transaction to find the private key?
Post by: pooya87 on May 06, 2022, 02:39:12 AM
Make sure your transaction is signed otherwise if it is unsigned it could contain your master public key which would let your friend have all your current and future public keys (and addresses). You may not want them to know that for privacy reasons.

Otherwise when the transaction is signed, it is broadcasted to the network and everyone sees it and the transaction will be included in a block and remains there forever; so there is nothing risky about sending a signed transaction to someone else to broadcast although I have to say it makes no sense to do that.


Title: Re: Decode a signed transaction to find the private key?
Post by: JasonSato on May 06, 2022, 12:37:14 PM
So you mean he wants to combine two transactions with your sign raw transaction?

He won't be able to do that what he can do only is to broadcast the transaction. The generated raw transaction is unique for every transaction and private keys are not included in this.

Why don't you just broadcast it instead of giving it to him for safety purposes?
No! He is just a newbie who wants to get into all the features of Electrum and test all types of transactions, RBF and CPFP.


Title: Re: Decode a signed transaction to find the private key?
Post by: NeuroticFish on May 06, 2022, 12:41:44 PM
No! He is just a newbie who wants to get into all the features of Electrum and test all types of transactions, RBF and CPFP.

For that purpose, best is to use Electrum on testnet, maybe multiple wallets too, get free funds from testent faucets and learn for free how the things work.
Then there's no risk at all. And if you're nice enough, after the tests you'll send back to the faucet the remaining testnet bitcoins.


Title: Re: Decode a signed transaction to find the private key?
Post by: JasonSato on May 06, 2022, 12:46:03 PM
Make sure your transaction is signed otherwise if it is unsigned it could contain your master public key which would let your friend have all your current and future public keys (and addresses). You may not want them to know that for privacy reasons.

Otherwise when the transaction is signed, it is broadcasted to the network and everyone sees it and the transaction will be included in a block and remains there forever; so there is nothing risky about sending a signed transaction to someone else to broadcast although I have to say it makes no sense to do that.
Thanks for your good advice.
So there is no risk if I send him a signed transaction in a .txn file or a raw text.

For that purpose, best is to use Electrum on testnet, maybe multiple wallets too, get free funds from testent faucets and learn for free how the things work.
Then there's no risk at all. And if you're nice enough, after the tests you'll send back to the faucet the remaining testnet bitcoins.
Thanks for the tip.
He prefers to do all the tests with 0.001 BTC in Electrum.


Title: Re: Decode a signed transaction to find the private key?
Post by: Pmalek on May 07, 2022, 09:13:15 AM
He prefers to do all the tests with 0.001 BTC in Electrum.
It might not seem like a lot of money today, but those $35 in BTC can one day be worth $135 or $335 that your friend is just wasting for no reason. You wouldn't be doing that with fiat, why do it with a currency far more valuable? I understand that he won't waste the whole amount, but only the required transaction fees, however, there is still the possibility that he makes a mistake and the coins get lost.

Since your friend is a newbie, he might not know much about testnet. All the features from the mainnet can be played around with in a testing environment and you don't have to spend your real coins. Wallet addresses are different and you need to get your hands on some testnet coins, but it's a great learning ground.   


Title: Re: Decode a signed transaction to find the private key?
Post by: JasonSato on May 07, 2022, 01:04:38 PM
It might not seem like a lot of money today, but those $35 in BTC can one day be worth $135 or $335 that your friend is just wasting for no reason. You wouldn't be doing that with fiat, why do it with a currency far more valuable? I understand that he won't waste the whole amount, but only the required transaction fees, however, there is still the possibility that he makes a mistake and the coins get lost.

Since your friend is a newbie, he might not know much about testnet. All the features from the mainnet can be played around with in a testing environment and you don't have to spend your real coins. Wallet addresses are different and you need to get your hands on some testnet coins, but it's a great learning ground.  
Thanks, I know everything about the testnet and have shown him how to run Electrum on testnet, but he wanted to start on the mainnet and learn everything about all types of wallets, addresses and transactions.


Title: Re: Decode a signed transaction to find the private key?
Post by: Cricktor on May 18, 2022, 01:04:03 AM
Thanks, I know everything about the testnet and have shown him how to run Electrum on testnet, but he wanted to start on the mainnet and learn everything about all types of wallets, addresses and transactions.
I apologize to be frank but your newbie friend is plain stupid not to use testnet for his initial Bitcoin exploration journey. He could explore everything (except interaction with crypto exchanges) within testnet without any costs and fear of making mistakes and harming sats. I don't get it why he insists on mainnet but who am I to judge...

Free testnet coins available e.g. at https://testnet.coinfaucet.eu