Bitcoin Forum
September 10, 2024, 07:23:37 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: pubkey and pubkeyHash on: March 29, 2015, 07:47:35 PM
Alice.  

When Carol sent coins to Alice it was a Pay2PubKeyHash transaction.  The address Alice gave Carol contains the PubKeyHash.  So the output of Carol's txn (called PkScript) contains only the PubKeyHash.

When Alice spends that txn she needs to include in the input (ScriptSig) the PubKey which hashes to the PubKeyHash in the prior txn.







So in this transaction,
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501 is Alice's public key.
And in the output ,
the <pubkeyhash> 404371705fa9bd789a2fcd52d2c580b65d35549d should be the receiver Bob's public key hash?

But the script will verify if <pubKeyHash> is the hash of <pubKey>. How can Alice's public key relate to Bob's, they won't match right?


2  Bitcoin / Development & Technical Discussion / Re: pubkey and pubkeyHash on: March 29, 2015, 07:03:25 PM
A scriptPubKey (with pubKeyHash) is associated to the output of a transaction (let's say Tx1).
A scriptSig (with pubkey) is associated to the input of a transaction (let's say Tx2).

Pubkey is revealed when the user wants to spend an utxo previously received (example: Tx2 consumes an output of Tx1).

<pubkeyHash> (appearing in Tx1) is the hash of <pubkey> (appearing in Tx2)

To summarize: All receiver will become a sender (except hardcore hodlers Wink)

Thanks, but let's say Alice sends a transaction to Bob using a previous tx from Carol.
then in the example above.

who is the owner of the public key<pubkey>? (90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501)

3  Bitcoin / Development & Technical Discussion / pubkey and pubkeyHash on: March 29, 2015, 04:12:45 PM
In pay-to-PubkeyHash:
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>

what do pubkey and pubKeyHash stand for?

Since the script will check the validity of signature, I guess pubKey is the pubKey of the sender?
But is <pubKeyHash> the hash of receiver's public key?
Then what's the point of checking sender's public key with receiver's? They can't match.


Input:
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
Index: 0
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501

Output:
Value: 5000000000
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
OP_EQUALVERIFY OP_CHECKSIG

<pubkey>90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501
<pubkeyHash>404371705fa9bd789a2fcd52d2c580b65d35549d
I just want to know the owner of these two keys. Sender or receiver?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!