# Practical Application: Multi-Signature Flexibility

Stack depth checking enables scripts that adapt to different signing scenarios:

```
OP_DEPTH OP_2 OP_LESSTHAN OP_IF
  // Single signature path
  <pubkey1> OP_CHECKSIG
OP_ELSE
  // Multi-signature path
  OP_2 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIG
OP_ENDIF
```

This script accepts either:

* **One signature** (checked against first public key)
* **Two signatures** (requires both signatures in 2-of-2 multisig)

**Use cases:**

* **Emergency recovery:** Normal operations require one signature, high-value transfers require two
* **Tiered authorization:** Small amounts need one signature, large amounts need multiple
* **Progressive security:** Initial setup uses single key, later upgraded to multisig

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bsv-opcodes/stack-data-queries/practical-application-multi-signature-flexibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
