STAS protocol flags field.
The flags field is embedded in the trailing metadata of a STAS locking script, immediately after the redemption address/MPKH. Each bit enables an optional administrative capability that is set at issuance and cannot be changed.
Bit Layout
| Bit | Flag | Effect |
|---|---|---|
| 0 | freezable | Enables freeze/unfreeze by authority |
| 1 | confiscatable | Enables confiscation by authority |
When a flag is enabled, a corresponding service field follows the flags in the trailing metadata, containing the authority address/MPKH for that capability. Service fields appear left-to-right in the opposite order of the flag bits (right-to-left).
Encoding
The flags field is always present unless no data follows the redemption PKH.
Use OP_0 (0x00) or <<0x01, 0x00>> for default (no flags). Do NOT use
OP_1–OP_16 for the flags field — use pushdata encoding.
Summary
Functions
Decode a flags binary into a ScriptFlags struct.
Encode flags to a binary for embedding in a locking script.
Returns the number of service fields expected for the given flags.
Types
Functions
Decode a flags binary into a ScriptFlags struct.
Encode flags to a binary for embedding in a locking script.
Returns a binary where bit 0 = freezable, bit 1 = confiscatable.
@spec service_field_count(t()) :: non_neg_integer()
Returns the number of service fields expected for the given flags.