Input scripts have keys?

Giovanni

Member
Usually (but not all) inuts script have two tables, first: 70-72 bytes, second 33 or 65 bytes.
This second table is public key? Where this is in Bitcoin documentation?
 

Callen

New member
This second table is public key?
Hi,

Yes : for spending an usual P2(W)PKH, the input(/witness) is
Code:
<signature (70-72 bytes long)><pubkey (33 or 65 bytes long)>.

Because the locking script (scriptpubkey/witness program) is in this case
Code:
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Once having verified that the public key matches the hash in the locking script, there is only OP_CHECKSIG left, which takes <a signature><a public key> and verifies that the signature matches the public key.

Quote
Where this is in Bitcoin documentation?
You can find more about OP_CHECKSIG on the wiki : https://en.bitcoin.it/wiki/OP_CHECKSIG
 
Top