Author

Topic: How can I use private key to create signature (Read 162 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
When your wallet creates a transaction, for example Bitcoin Core, the transaction is considered raw and cannot be broadcasted without a signature for security reasons. So to create that signature, your private key and the raw transaction are inserted inside an ECDSA signing operation to create the message signature, which is then placed inside the raw transaction to create a signed transaction.

Nodes will also verify transactions, to make sure that the signature is correct, using the ECDSA verification algorithm by passing parts of the signed transaction and signature as inputs. Generally, there is only one valid signature for each transaction, to prevent forgery.
legendary
Activity: 2394
Merit: 5531
Self-proclaimed Genius
-snip-
My question is now how can I create signature from my private key?
Bitcoin is using ECDSA for its signature using secp256k1 curve, more info about ECDSA here: /wiki/Elliptic_Curve_Digital_Signature_Algorithm

In Bitcoin transactions, the "message" to be signed is the transaction itself.
This article explained it better: learnmeabitcoin.com/technical/ecdsa#signing-a-transaction (I'd recommend to read the whole article)
Here's the beginner version: learnmeabitcoin.com/beginners/digital_signatures_signing_verifying
legendary
Activity: 1512
Merit: 4795
Your wallet automatically handles that, when you generate the wallet, keys and addresses are generated, the master private key generates the child keys. The child private key generate a signature while spending, to prove you are the owner of a public key while not revealing the private key. Without the signature, you can not be able to spend. So, without private key, you can not spend your coins. To understand better, if you import the master public keys (not private key), only child public keys and addresses are generated which are used for watch-only wallet, in watch-only wallet, you can not spend because it has no private key, it is used for just making an unsigned transactions and for tracking transactions.

Learn more from here: https://learnmeabitcoin.com/beginners/digital_signatures#:~:text=A%20digital%20signature%20is%20something,digital%20signature%20to%20prove%20it.
hero member
Activity: 644
Merit: 544
I am newbie who is very glad to be here. This farum was introduced to me by one of my friend some few month back that I can learn much about cryptocurrency here.
I 'm currently reading a topic about key private key, so i got confused.

I saw a sentence like private key is used to create a signature that are required to be spend Bitcoin by proving ownership of found used in a transaction.

My question is now how can I create signature from my private key?
Jump to: