BSV.Tokens.Script.Reader (bsv_sdk v2.0.1)

Copy Markdown View Source

Script reader for parsing STAS and STAS 3.0 locking scripts.

Summary

Functions

Check whether a STAS 3.0 locking script's owner field equals EMPTY_HASH160 = HASH160("") = b472a266d0bd89c13706a4132ccfb16f7c3b9fcb.

Check if a script is a STAS v2 token script.

Parse a locking script binary and classify it.

Functions

arbitrator_free_owner?(script)

Check whether a STAS 3.0 locking script's owner field equals EMPTY_HASH160 = HASH160("") = b472a266d0bd89c13706a4132ccfb16f7c3b9fcb.

Per STAS 3.0 v0.1 §9.5 / §10.3 (signature-suppression / arbitrator-free swap): when the owner field on a swap input equals this sentinel, the engine accepts OP_FALSE for both the signature and pubkey/redeem-buffer slot from that side — i.e. that leg is spent without any signing involved.

Accepts either:

  • the locking-script binary (or BSV.Script.t()), or
  • a parsed Stas3Fields struct.

Returns false for non-STAS-3.0 scripts.

is_stas(script)

@spec is_stas(binary()) :: boolean()

Check if a script is a STAS v2 token script.

read_locking_script(script)

@spec read_locking_script(binary()) :: BSV.Tokens.Script.ParsedScript.t()

Parse a locking script binary and classify it.