# `BSV.Script.Interpreter`
[🔗](https://github.com/Bittoku/bsv_sdk_elixir/blob/main/lib/bsv/script/interpreter.ex#L1)

Full Bitcoin script interpreter.

Executes unlocking and locking scripts to verify transaction inputs.
Supports all standard opcodes including stack, arithmetic, crypto,
comparison, flow control, and splice operations.

## Limitations

OP_CHECKLOCKTIMEVERIFY (0xB1) and OP_CHECKSEQUENCEVERIFY (0xB2) are currently
treated as NOPs and are not fully validated against transaction lock_time or
input sequence numbers.

# `flag`

```elixir
@type flag() ::
  :utxo_after_genesis
  | :verify_minimal_data
  | :verify_clean_stack
  | :enable_sighash_forkid
```

# `opts`

```elixir
@type opts() :: [
  flags: [flag()],
  sighash_fn: (BSV.Script.t(), non_neg_integer(), non_neg_integer() -&gt;
                 {:ok, binary()} | {:error, term()})
]
```

# `verify`

```elixir
@spec verify(BSV.Script.t(), BSV.Script.t(), opts()) :: :ok | {:error, term()}
```

Verify an unlocking script against a locking script.

Returns `:ok` on success or `{:error, reason}` on failure.

## Options

  * `:flags` - List of verification flag atoms
  * `:sighash_fn` - Function for OP_CHECKSIG sighash computation

## Examples

    iex> {:ok, lock} = BSV.Script.from_asm("OP_1")
    iex> BSV.Script.Interpreter.verify(%BSV.Script{}, lock)
    :ok

---

*Consult [api-reference.md](api-reference.md) for complete listing*
