Skip to content

Elements/Liquid Opcodes & Macros

Composite Opcodes

Introspection

OP::INPUT_VALUE Script

stack in: <input index> stack out: <input amount> (or fail if the amount is confidential)

OP::OUTPUT_VALUE Script

stack in: <output index> stack out: <output amount> (or fail if the amount is confidential)

OP::INPUT_ASSET Script

OP::OUTPUT_ASSET Script

OP::OUTPUT_ASSET_EQ_VERIFY Script

OP::INPUT_ASSET_EQ_VERIFY Script

OP::OUTPUT_VALUE_EQ_VERIFY Script

OP::INPUT_VALUE_EQ_VERIFY Script

OP::OUTPUT_SPK_EQ_VERIFY Script

OP::INPUT_SPK_EQ_VERIFY Script

OP::OUTPUT_SPK_V1_EQ_VERIFY Script

OP::INPUT_SPK_V1_EQ_VERIFY Script

64-bit Arithmetic

OP::ADD64_VERIFY Script

OP::SUB64_VERIFY Script

OP::MUL64_VERIFY Script

OP::DIV64_VERIFY Script

OP::DIV64FLOOR_VERIFY Script

OP::NEG64_VERIFY Script

OP::GT64_VERIFY Script

OP::LT64_VERIFY Script

OP::GTE64_VERIFY Script

OP::LTE64_VERIFY Script

OP::MAX64 Script

OP::MIN64 Script

OP::2SORT64 Script

OP::ENCODE_COMPACT_SIZE Script

OP::ENCODE_PUSH_OP Script

OP::HASH_TAPLEAF Script

OP::HASH_TAPTWEAK Script

Script Macros

checkOutput()

checkOutput(output_index: Int, asset_id: Bytes, amount: Int, wit_prog: Int:Bytes) -> Script

Minsc source code: src/stdlib/elements.minsc:N/A

checkOutputSpk()

checkOutputSpk(output_index, wit_prog: Int:Bytes) -> Script

Minsc source code: src/stdlib/elements.minsc:N/A

checkSameAsset()

checkSameAsset(input_index: Int, output_index: Int) -> Script

Minsc source code: src/stdlib/elements.minsc:N/A

checkSameSpk()

checkSameSpk(input_index: Int, output_index: Int) -> Script

Minsc source code: src/stdlib/elements.minsc:N/A

checkSameValue()

checkSameValue(input_index: Int, output_index: Int) -> Script

Minsc source code: src/stdlib/elements.minsc:N/A

inspectInSpkVer()

inspectInSpkVer(expected_version: Int) -> Script

stack in: <input index> stack out: <input scriptPubKey> (or fail if doesn't match the expected_version)

Minsc source code: src/stdlib/elements.minsc:N/A

inspectOutSpkVer()

inspectOutSpkVer(expected_version: Int) -> Script

stack in: <output index> stack out: <output scriptPubKey> (or fail if doesn't match the expected_version)

Minsc source code: src/stdlib/elements.minsc:N/A

Native Opcodes

OP_TWEAKVERIFY Script

OP_SHA256INITIALIZE Script

OP_SHA256UPDATE Script

OP_SHA256FINALIZE Script

OP_SUBSTR_LAZY Script

OP_DETERMINISTICRANDOM Script

Introspection

OP_INSPECTVERSION Script

OP_INSPECTLOCKTIME Script

OP_INSPECTNUMINPUTS Script

OP_INSPECTNUMOUTPUTS Script

OP_TXWEIGHT Script

OP_INSPECTINPUTASSET Script

OP_INSPECTINPUTISSUANCE Script

OP_INSPECTINPUTOUTPOINT Script

OP_INSPECTINPUTSCRIPTPUBKEY Script

OP_INSPECTINPUTSEQUENCE Script

OP_INSPECTINPUTVALUE Script

OP_PUSHCURRENTINPUTINDEX Script

OP_INSPECTOUTPUTASSET Script

OP_INSPECTOUTPUTNONCE Script

OP_INSPECTOUTPUTSCRIPTPUBKEY Script

OP_INSPECTOUTPUTVALUE Script

64-bit Arithmetic

OP_SUB64 Script

OP_MUL64 Script

OP_NEG64 Script

OP_DIV64 Script

OP_ADD64 Script

OP_GREATERTHANOREQUAL64 Script

OP_LESSTHANOREQUAL64 Script

OP_LESSTHAN64 Script

OP_GREATERTHAN64 Script

OP_SCRIPTNUMTOLE64 Script

OP_LE64TOSCRIPTNUM Script

OP_LE32TOLE64 Script