CryptoURANUS Economics: P2WPKH-within-P2SH (SegWit-aware): Cryptocurrency

Anti-AdBlocker

Wednesday, July 24, 2019

P2WPKH-within-P2SH (SegWit-aware): Cryptocurrency

P2WPKH-in-P2SH

P2WPKH-in-P2SH together with P2WSH-in-P2SH represents a Transaction which allows non-SegWit wallets to generate a SegWit transaction.



The P2SH addressing transaction used as the cornerstone that includes P2WPKH inside it.

When SegWit-aware node identifies P2SH containing P2WPKH then interprets enact native transactions.

ScriptPubKey: OP_HASH160 <20-byte-redeemScriptHash> OP_EQUAL 
ScriptSig:  <0 <20-byte-PublicKeyHash>> 
Witness:  <Signature> <PublicKey>
RedeemScript: 0 <20-byte-PublicKeyHash>
 
The P2SH redeem script is equal to 0 <20-byte-PublicKeyHash> and is the exact same as P2WPKH scriptPubKey.

The ScriptSig is a canonical push of data, and this data contain another canonical push of data, please read link: "ScriptSig" for definition.

To understand how transactions work on basic technical level, check blog post Types of Bitcoin transactions: Part I, Part 2.

More detailed description can be found in Bitcoin Wiki or in Bitcoin.org Developer guide.
Like Trezor? Get one here!

No comments: