> 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/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
