Bitcoin Forum
May 04, 2024, 06:43:02 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about P2PKH  (Read 145 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 09, 2019, 05:48:41 AM
 #1

I read this article in https://en.bitcoin.it/wiki/Transaction

P2PKH uses :
Code:
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>

scriptSig is supplied by the redeemer. scriptPubKey is from the referred previous transaction.

For example. i send bitcoin to the recipient using the pubkeyHash of the recipient. Because the redeeming condition requires the pubKey and the sig, does it mean anyone with the pubKey and sig can redeem the bitcoin?
1714848182
Hero Member
*
Offline Offline

Posts: 1714848182

View Profile Personal Message (Offline)

Ignore
1714848182
Reply with quote  #2

1714848182
Report to moderator
1714848182
Hero Member
*
Offline Offline

Posts: 1714848182

View Profile Personal Message (Offline)

Ignore
1714848182
Reply with quote  #2

1714848182
Report to moderator
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714848182
Hero Member
*
Offline Offline

Posts: 1714848182

View Profile Personal Message (Offline)

Ignore
1714848182
Reply with quote  #2

1714848182
Report to moderator
1714848182
Hero Member
*
Offline Offline

Posts: 1714848182

View Profile Personal Message (Offline)

Ignore
1714848182
Reply with quote  #2

1714848182
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
May 09, 2019, 06:00:08 AM
Merited by ABCbits (1)
 #2

Because the redeeming condition requires the pubKey and the sig, does it mean anyone with the pubKey and sig can redeem the bitcoin?
Yes. Anyone who can provide the public key and a valid signature can spend that output. However there is no one signature; the signature is specific to the spending transaction. So in order to create a valid signature, you also need to have the private key for the public key.

victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 09, 2019, 06:45:21 AM
 #3

Thank you.

From:
https://bitcoin.org/en/transactions-guide#introduction

Code:
An secp256k1 signature made by using the ECDSA cryptographic formula to combine certain transaction data
 (described below) with Bob’s private key. This lets the pubkey script verify that Bob owns the private key which
created the public key.
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!