Author

Topic: Script PubKey (Read 160 times)

legendary
Activity: 3472
Merit: 10611
January 04, 2022, 11:48:33 PM
#6
scriptPubKey scripts no longer contain public keys.
They can and they do. What you should've said is that they are no longer as common as early days (that is until Taproot becomes common).

The old types such as P2PK are standard and can be used, P2MS is another script type contains multiple public keys, there are nonstandard scripts that contain public keys.
And finally the newest script types used in Taproot scripts contains the x-only public key.

These are the most recent P2PK transactions with the most recent from 2021-12-31:
https://blockchair.com/bitcoin/outputs?s=time(desc)&q=type(pubkey)#f=transaction_hash,type,time
Keep in mind that blockchair shows a P2PKH address by mistake, if you check the raw transaction you see the actual script is a P2PK one.
legendary
Activity: 4522
Merit: 3426
January 04, 2022, 08:49:28 PM
#5
@ranochigo explained it, but I'm going to simplify. scriptPubKey is the name of the script in a transaction that sets the conditions for spending the bitcoins "received" by the transaction.

Originally, the scriptPubKey script specified a public key whose private key is required to spend the "received" bitcoins. A transaction containing this kind of script is called a P2PK (pay-to-public-key) transaction. You can find P2PK transactions in the earliest blocks and their scriptPubKey scripts will contain public keys.

But P2PK transactions are no longer used and scriptPubKey scripts no longer contain public keys. A public key may still be required to spend the "received" bitcoins, but the scriptPubKey script no longer refers to it directly.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
January 04, 2022, 12:02:39 AM
#4
ScriptPubKey does not actually contain the public key. It is just the conditions that can be used to spend the funds, in cases like P2PKH outputs, you will find the HASH160 of the public key and only if you have the P2PK output, then you can see the actual ECDSA public key.

For normal scenarios like P2PKH, P2WPKH, since it dictates the HASH160 (SHA256 and then RIPEMD-160), the conditions to be fulfilled requires for the public key to be revealed. As such, you can validate that the public key hashes to the key in the unlocking script and for the signature to match the public key. With a public key, you can use it to produce the various scripts that requires your public key, and from there you can derive the possible ScriptPubKeys that corresponds to it.
legendary
Activity: 3472
Merit: 10611
January 03, 2022, 10:48:28 PM
#3
And the public key is the unique Bitcoin address that allows you to receive Bitcoins.
Public key is the ellilptic curve point computed from the private key using  a one way operation. It can then be converted to an address, usually by computing its hash. Public key is not the address though.
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
January 03, 2022, 06:35:58 PM
#2
According to Google search
Quote from: Google
Pubkey script is a script that controls how bitcoin can be spent. In English, most bitcoin scripts translate as follows: “In order to spend this bitcoin, one must produce a signature belonging to this public key…”, followed by a public key

And the public key is the unique Bitcoin address that allows you to receive Bitcoins.

Check this link below for other explanations about these.
- https://nominex.io/blog/education/bitcoin-script/
newbie
Activity: 22
Merit: 10
January 03, 2022, 04:52:46 PM
#1
Greetings,
what is the difference between the Public key and the script pubkey ?
can one derive one from the other ?
thank you !
Jump to: