MultiversX Tracker is Live!

Where is the revelead public key in a spending transaction?

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 154 Views

What you show in your screenshot is some program's summary of a transaction which omits details of the spending script. You need to look at a more detailed view of the raw transaction data.

There are several types of Bitcoin transaction. The type known as Pay to Public Key Hash (P2PKH) requires that the recipient reveal their public key in a later transaction where they spend the received money.

There are several places that explain this. One is https://learnmeabitcoin.com/technical/p2pkh

The P2PKH script pattern contains a hashed public key surrounded by these opcodes:

scriptPubKey:

OP_DUP OP_HASH160
12ab8dc588ca9d5787dde7eb29569da63c3a238c OP_EQUALVERIFY OP_CHECKSIG

To solve this script, the owner of the hashed public key above needs to provide the original public key, along with a valid signature for it:

scriptSig:

304502203f004eeed0cef2715643e2f25a27a28f3c578e94c7f0f6a4df104e7d
163f7f8f022100b8b248c1cfd8f77a0365107a9511d759b7544d979dd152a955
c867afac0ef78601
044d05240cfbd8a2786eda9dadd520c1609b8593ff8641018d57703d02ba687c
f2f187f0cee2221c3afb1b5ff7888caced2423916b61444666ca1216f2618139
8c

In short, when this script runs:

  • The original public key is DUPlicated and then HASH160’ed.
  • This hashed value is compared with the hashed public key in the scriptPubKey to make sure it is EQUALVERIFY.
  • If it matches, the script continues and the CHECKSIG checks the signature against the public key (just like a P2PK script).

Note that the locking script is only present in the transaction in which a person received this money. The transaction in which they spend the received money has a reference to the earlier transaction and contains a spending script that is prepended to the earlier transaction's locking script and then evaluated.

The transaction you show is a P2WPKH which is a little more complex and has some advantages over P2PKH.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments