Bitcoin Forum
May 10, 2024, 09:48:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Script PubKey  (Read 134 times)
Alicatraz (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 10


View Profile
January 03, 2022, 09: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 !
1715377705
Hero Member
*
Offline Offline

Posts: 1715377705

View Profile Personal Message (Offline)

Ignore
1715377705
Reply with quote  #2

1715377705
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715377705
Hero Member
*
Offline Offline

Posts: 1715377705

View Profile Personal Message (Offline)

Ignore
1715377705
Reply with quote  #2

1715377705
Report to moderator
1715377705
Hero Member
*
Offline Offline

Posts: 1715377705

View Profile Personal Message (Offline)

Ignore
1715377705
Reply with quote  #2

1715377705
Report to moderator
1715377705
Hero Member
*
Offline Offline

Posts: 1715377705

View Profile Personal Message (Offline)

Ignore
1715377705
Reply with quote  #2

1715377705
Report to moderator
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2970


Block halving is coming.


View Profile WWW
January 03, 2022, 11: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/

█▀▀▀











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











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

Activity: 3444
Merit: 10558



View Profile
January 04, 2022, 03:48:28 AM
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
January 04, 2022, 05:02:39 AM
Merited by ABCbits (2)
 #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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
odolvlobo
Legendary
*
Offline Offline

Activity: 4312
Merit: 3214



View Profile
January 05, 2022, 01:49:28 AM
Last edit: January 05, 2022, 02:07:20 AM by odolvlobo
 #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.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
January 05, 2022, 04:48:33 AM
Merited by ABCbits (1)
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!