The scripting language embedded in Bitcoin transactions. A stack-based language, Script commands are used to validate the unspent Bitcoins (UTXOs) when a user sends coins to a recipient. See stack
The transaction contains a "locking script," which is typically the Bitcoin address that was derived from the public key (scriptPubKey). It also contains an "unlocking script" that is generally a digital signature of the transaction data computed from the user's private key (scriptSig). The digital signature ensures the integrity of the transaction (see digital signature
). See Bitcoin transaction
Bech32 for Segregated Witness Blockchains
In 2017, Bitcoin switched to the Segregated Witness (SegWit) architecture, which enabled faster validation, among other enhancements. The native address format for SegWit is Bech32; however, older wallets generate transactions that are still compatible because SegWit was a "soft fork" (see SegWit
and Bitcoin hard fork
P2PKH & P2WPKH - Pay to a Bitcoin Address
The non-SegWit P2PKH and the SegWit P2WPKH are the common formats that simply pay to a Bitcoin address. The "W" stands for Segregated Witness (SegWit). PKH means "public key hash," which is the Bitcoin address after being hashed (see HASH160
P2SH & P2SWH - Pay to Script Hash
P2SH and its P2SWH counterpart support advanced features such as when multiple signatures are required to authorize a payment.
P2SH (P2WPKH) - (Pay to Witness Public Key Hash)
A native SegWit script wrapped inside a P2SH script.
Touted as the fastest and most secure crypto wallet, Mycellium supports three address formats. When first started, it defaults to P2SH (top), which is "SegWit compatible." After tapping the QR code for Bech32, "SegWit native" is selected and finally P2PKH.