Byte-pattern constants for classifying STAS script versions, plus builders for fixed locking-script bodies (such as the STAS 3.0 v0.1 §10.2 P2MPKH locking script).
Summary
Functions
EMPTY_HASH160 sentinel = HASH160(""). Means "skip auth" in owner / arbitrator slots.
Build the fixed 70-byte STAS 3.0 v0.1 §10.2 P2MPKH locking-script body.
STAS 3.0 v0.1 §10.2 P2MPKH locking-script body length (70 bytes).
Standard P2PKH script length in bytes.
P2PKH script prefix: OP_DUP OP_HASH160 OP_DATA_20.
P2PKH script suffix: OP_EQUALVERIFY OP_CHECKSIG.
Length of a public key hash in bytes.
STAS 3.0 base template prefix bytes.
Length of the STAS 3.0 base template in bytes.
STAS v2 marker bytes after the 20-byte owner PKH.
Byte offset of the STAS v2 marker within the script.
Minimum length of a STAS v2 script (template + flags).
Byte offset of the OP_RETURN within a STAS v2 template.
Byte offset of the owner PKH within a STAS v2 script.
STAS v2 prefix bytes: OP_DUP OP_HASH160 OP_DATA_20.
Byte offset of the redemption PKH within a STAS v2 template.
Length of the STAS v2 template body in bytes.
Functions
EMPTY_HASH160 sentinel = HASH160(""). Means "skip auth" in owner / arbitrator slots.
@spec p2mpkh_locking_script(<<_::160>>) :: binary()
Build the fixed 70-byte STAS 3.0 v0.1 §10.2 P2MPKH locking-script body.
This locking script is used at issuance and redemption boundaries of a STAS token — i.e. on UTXOs that are not themselves STAS in-life UTXOs but bracket a STAS token's lifecycle. In-life STAS UTXOs do NOT carry this script; the engine inlines equivalent logic.
Input
mpkh— 20-byte MPKH (HASH160of the redeem buffer; seeBSV.Transaction.P2MPKH.mpkh/1).
Output
70-byte binary equal to:
<<0x76, 0xA9, 0x14, mpkh::binary-size(20),
0x88, 0x82, 0x01, 0x21, 0x87, 0x63, 0xAC, 0x67,
0x51, 0x7F, (0x51, 0x7F, 0x73, 0x63, 0x7C, 0x7F, 0x68) x 5,
0xAE, 0x68>>Decoded as Bitcoin Script: OP_DUP OP_HASH160 <MPKH> OP_EQUALVERIFY OP_SIZE 0x21 OP_EQUAL OP_IF OP_CHECKSIG OP_ELSE OP_1 OP_SPLIT (OP_1 OP_SPLIT OP_IFDUP OP_IF OP_SWAP OP_SPLIT OP_ENDIF) x 5 OP_CHECKMULTISIG OP_ENDIF.
STAS 3.0 v0.1 §10.2 P2MPKH locking-script body length (70 bytes).
Standard P2PKH script length in bytes.
P2PKH script prefix: OP_DUP OP_HASH160 OP_DATA_20.
P2PKH script suffix: OP_EQUALVERIFY OP_CHECKSIG.
Length of a public key hash in bytes.
STAS 3.0 base template prefix bytes.
Length of the STAS 3.0 base template in bytes.
STAS v2 marker bytes after the 20-byte owner PKH.
Byte offset of the STAS v2 marker within the script.
Minimum length of a STAS v2 script (template + flags).
Byte offset of the OP_RETURN within a STAS v2 template.
Byte offset of the owner PKH within a STAS v2 script.
STAS v2 prefix bytes: OP_DUP OP_HASH160 OP_DATA_20.
Byte offset of the redemption PKH within a STAS v2 template.
Length of the STAS v2 template body in bytes.