Skip to content

Understanding P2WPKH #333

Answered by dr-orlovsky
kanishk779 asked this question in Q&A
Apr 2, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I can answer the second question, but can't answer the first one (I have the same question actually).

So, the witness program is the next byte-push following the version opcode in the scriptPubkey. The meaning of the witness program is specific to the used witness version (first int-push in scriptPubkey).

For witness version v0 (P2WKPH, P2WSH) it means that the following push (20 or 32 bytes correspondingly) is the hash of the public key (P2WPKH) or a witness script (P2WSH). It must be provided as a part of the witness data of the spending transaction input, and for a public key it must be a compressed public key, and for a witness script it must be a script source as a first witness stac…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kanishk779
Comment options

@dr-orlovsky
Comment options

Answer selected by kanishk779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants