Bitcoin Forum
August 15, 2024, 03:22:18 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can I use private key to create signature  (Read 166 times)
SOKO-DEKE (OP)
Hero Member
*****
Offline Offline

Activity: 756
Merit: 566



View Profile
June 24, 2022, 12:14:24 AM
Merited by fillippone (2)
 #1

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?

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
Charles-Tim
Legendary
*
Offline Offline

Activity: 1638
Merit: 5074


Leading Crypto Sports Betting & Casino Platform


View Profile
June 24, 2022, 12:55:56 AM
Merited by fillippone (3)
 #2

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.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
nc50lc
Legendary
*
Online Online

Activity: 2506
Merit: 5924


Self-proclaimed Genius


View Profile
June 24, 2022, 03:36:13 AM
Merited by fillippone (3)
 #3

-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

█▀▀▀











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











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

Activity: 1694
Merit: 7150


In memory of o_e_l_e_o


View Profile WWW
June 25, 2022, 01:56:06 PM
Merited by fillippone (3)
 #4

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.

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!