Tuesday, September 5, 2023
HomeBitcoin Newsoutput script - What's the content material of ScriptPubKey for P2WPKH?

output script – What’s the content material of ScriptPubKey for P2WPKH?

Advertisement


What’s the content material of ScriptPubKey for P2WPKH?

Gr asp bitcoin e-book 2end version says the next (hyperlink

Advertisement

):

Instance P2WPKH output script

0 ab68025513c3dbd2f7b92a94e0581f5d50f654e7

In programming Bitcoin by Jimmy Track, it says the next:

The ScriptPubKey for p2wpkh is OP_0 <20-byte hash>.

It additionally supplies the next picture:

enter image description here

Moreover, when Jimmy Track is checking if the scriptPubKey is of P2WPKH kind, he’s utilizing the next code:

enter image description here

So my query is: The place is OP_PUSHBYTES_20 right here? Okay, perhaps within the examples we are able to omit it and simply say OP_0 20-byte hash, however how can we omit it in a program checking if the script is P2WPKH as Jimmy Track did?

I believed that I missed one thing, so I went into Bitcoin block explorer to search out any P2WPKH scriptPubKey and I discovered it with OP_PUSHBYTES_20. Right here is the hyperlink for it.

So, ought to we think about the P2WPKH output is: OP_0 OP_PUSHBYTES_20 <20-byte hash> and never simply OP_0 <20-byte hash>. Does it imply Jimmy Track made a mistake in his program?

Advertisement
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments