> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-script-new/introduction-to-bitcoin-script/what-is-bitcoin-script.md).

# What Is Bitcoin Script?

#### The Language That Runs Every Transaction

Bitcoin Script is the **scripting language** embedded in every Bitcoin transaction output. It is a simple, stack-based language processed from left to right as a series of sequential instructions. When a node on the network validates a transaction, it executes this script to decide whether the spending conditions have been satisfied.

Think of it like a combination lock built into every coin. The **locking script** (stored in the transaction output) describes how the lock is configured. The **unlocking script** (provided in the transaction input by the spender) is the combination. When the evaluator runs both together, the lock either opens — and the transaction is valid — or it doesn't, and the transaction is rejected.

Bitcoin Script uses **opcodes** — short instruction words — and **data items** that are pushed onto a data structure called the **stack**. Operations consume items from the stack and may push results back onto it. This design makes the language predictable, auditable, and secure.&#x20;

#### Why Script Matters

Most people think of Bitcoin as a simple payment tool. But Script transforms it into a **programmable value system**. With Script, you can encode time-locked payments (coins that can't be spent until a future date), multi-party authorization (requiring multiple signatures to spend), hash puzzles, and much more — all enforced by the network itself with no trusted intermediary.

The BSV Blockchain, which implements the original Bitcoin protocol, takes this further: Bitcoin Script on BSV is **Turing-complete** in a practical sense. Although it does not have traditional loop instructions, **finite state machines** can be built using UTXOs (Unspent Transaction Outputs) to hold intermediate computation state. Each transaction can check conditions and produce a new UTXO that contains the next step of the computation — effectively running programs across a chain of transactions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-script-new/introduction-to-bitcoin-script/what-is-bitcoin-script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
