Script¶
Also see:
scriptPubKey()
¶
scriptPubKey(Descriptor<Definite>|WshInfo|TapInfo|Address|Script) -> ScriptPubKey
Get the scriptPubKey to be used in a transaction output.
Also accessible using the script_pubkey field.
Errors: When called with a Descriptor<Indefinite>.
Rust source code: src/stdlib/btc.rs:256
explicitScript()
¶
explicitScript(Descriptor<Definite>|WshInfo) -> Script
Get the underlying Script, before any hashing is done.
- For
Wpkh,PkhandBaredescriptors, this is thescriptPubkey - For
WshandShWshdescriptors, this is thewitnessScript - For
ShandShWpkhdescriptors, this is theredeemScript - For
WshInfo, this is thewitnessScript
Also accessible using the explicit_script field.
Errors:
- When called with a
Descriptor<Indefinite>. - When called with a
Descriptor<Tr>. Taproot doesn't have a single explicit script, but rather a tree of them. These can be obtained usingDescriptor->scripts/Descriptor->script_treeandTapInfo->scripts/TapInfo->script_tree.
Rust source code: src/stdlib/btc.rs:265
Script
¶
Construction Examples:
`$alice OP_CHECKSIG``1 2 OP_ADD pickAlt(3) OP_EQUAL``<1> <$alice> <$charlie> <2> OP_CHECKMULTISIG`(optional<>)`OP_TOALTSTACK*3`(script repetition)script(0x76a9147d9620d04e5eac6b9715d37112cbb9ca0c92679388ac)
Underlying type: bitcoin::ScriptBuf
Rust source code: src/stdlib/btc.rs:246
Only available for parsable scripts.
Only available for parsable scripts that are minimally encoded.
Whether this script can be parsed into valid instructions.
Whether this script uses minimally encoded pushes.
Only available for scripts representing the scriptPubKey of a witness program.
Aliased as: minimal_non_dust
script::instructions()
¶
Rust source code: src/stdlib/btc.rs:275