---
title: "Bitcoin Script Limitations — definition | Nuri Glossary"
description: "Script has no loops and bounded stack depth on purpose, keeping validation cheap and predictable for every node."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/bitcoin-script-limitations"
---

# Bitcoin Script Limitations

Script has no loops and bounded stack depth on purpose, keeping validation cheap and predictable for every node.

## Basically

Bitcoin's scripting language has deliberate limits. It bars loops, caps data sizes and restricts computation to protect the network.

## Key Takeaways

- Bitcoin Script is intentionally non-Turing-complete: it lacks loops, floating-point maths and access to external data, so every script terminates in bounded time and produces deterministic results across all nodes.
- Concrete limits enforce resource bounds: a 520-byte maximum push size, 201 non-push opcode cap for legacy and SegWit v0, 10,000-byte script size ceiling and 1,000-item stack limit prevent denial-of-service attacks during transaction validation.
- Taproot, defined for Tapscript in BIP 342, removes the 201 opcode limit and the 10,000-byte script size cap, replacing them with a per-input signature operations budget tied to witness weight.

## What Are Bitcoin Script Limitations?

Bitcoin Script limitations are deliberate constraints that restrict what scripts can do during transaction validation. Unlike general-purpose programming languages, Bitcoin Script is a stack-based language designed to be simple, predictable and resource-bounded. These limits protect the network from malicious scripts that could consume excessive CPU time, memory or bandwidth on every validating node.
Satoshi Nakamoto's original implementation established the design philosophy: Bitcoin Script should make it easy to express spending conditions, meaning who can spend a UTXO and under what circumstances, but impossible to write scripts that harm the network. In 2010, several opcodes were disabled after vulnerabilities were discovered, including CVE-2010-5141, which allowed anyone to spend anyone's bitcoins. This incident reinforced the principle that a smaller, more constrained scripting language is safer than a powerful one.

## How It Works

Bitcoin enforces script limitations at the consensus level through constants defined in Bitcoin Core's source code. Every validating node checks these limits during script execution, and any script that violates them causes the entire transaction to be rejected.

## Size and Computation Limits

Legacy and SegWit v0 scripts share a set of core constraints. Bitcoin Core defines them in src/script/script.h.
The 520-byte push limit is especially significant for P2SH redeem scripts, which are pushed as data, and for hash operations like OP_SHA256, which cannot process messages larger than 520 bytes. The 201 opcode limit counts only non-push operations, so data pushes such as OP_PUSHDATA do not count towards this cap.

## What Scripts Cannot Do

Bitcoin Script lacks several capabilities found in general-purpose languages. These gaps apply alongside its numeric limits.

## Why These Limits Exist

Every full node on the network must validate every transaction in every block. A script that takes one second to execute might seem harmless, but multiplied by thousands of transactions per block across tens of thousands of nodes, the aggregate cost becomes enormous. The limits serve several purposes.

## How Taproot Changes the Limits

Taproot activated at block height 709,632 in November 2021. It introduced Tapscript, defined in BIP 342, which relaxes several legacy constraints while maintaining safety through new mechanisms.

## Limits Removed in Tapscript

Tapscript removes some limits because scriptCode is no longer directly included in the signature hash. It is included only indirectly through a precomputable tapleaf hash, so CPU time spent on Schnorr signature verification is no longer proportional to script size.

## New: Per-Input Sigops Budget

Tapscript replaces the legacy block-wide limit of 80,000 signature operations with a per-input budget. That budget is tied to witness size.
The computational cost of signature verification scales proportionally with the space consumed in the block. Scripts cannot be computationally expensive without paying the corresponding weight cost.

## Tapscript Opcode Changes

Tapscript also modifies multisig handling. The legacy OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY opcodes are disabled and immediately fail the script. They are replaced by OP_CHECKSIGADD, which supports batch-verifiable multisig with up to 999 public keys per script, compared to the legacy limit of 20.

## The Debate Over Expanding Script

The Bitcoin community has long debated whether to relax Script's constraints further. Several proposals aim to unlock new capabilities through soft forks, each with different trade-offs. You can find a deeper analysis in the research article on the OP_CAT covenant debate.

## OP_CAT (BIP 347)

OP_CAT would re-enable byte string concatenation in Tapscript only, allowing scripts to pop two values from the stack and push their concatenation, limited to 520 bytes. Originally part of Bitcoin's scripting language, it was disabled in 2010 over DoS concerns, but proponents argue that the 520-byte element size limit and Tapscript's witness weight constraints eliminate the original DoS vectors. Combined with Schnorr signatures, OP_CAT enables transaction introspection, which makes covenants, zero-knowledge proof verification and trustless bridges possible.

## OP_CHECKTEMPLATEVERIFY (BIP 119)

OP_CTV would allow a script to commit to a specific set of future outputs, enabling vaults with time-delayed spending and recovery paths, congestion control and Lightning Network improvements. It is designed to be non-recursive, preventing perpetual restrictions on coins. As of 2026, concrete activation parameters have been proposed with a 90% miner signalling threshold.

## The Great Script Restoration

Rusty Russell, a Core Lightning developer, proposed the Great Script Restoration in BIPs 440 and 441. It would re-enable approximately 15 opcodes disabled in 2010 and add new ones in a new tapscript version, with safety maintained through a "varops budget" that assigns each opcode a computational cost based on bytes written to memory. This approach provides a comprehensive expansion rather than piecemeal proposals, though its broader scope may make consensus harder to achieve.

## Use Cases

Script limitations matter in several practical scenarios. You need to account for them when assessing what a script can do.

## Why It Matters

Bitcoin Script limitations shape all Bitcoin development. Every Layer 2 protocol, wallet feature and proposed upgrade must account for what Script can and cannot do. The tension between security, which keeps Script constrained, and functionality, which enables richer spending conditions, drives much of Bitcoin's technical roadmap.
Layer 2 solutions like Spark treat these limitations as both a constraint and a design driver. Spark's architecture uses FROST threshold signatures and cooperative protocols that work within current Script capabilities while providing rich functionality off-chain. When you need to exit unilaterally, on-chain enforcement relies on the opcodes and script structures that Bitcoin's consensus rules support, so these boundaries shape how you evaluate trade-offs between trustlessness, efficiency and expressive power in different Layer 2 designs. For a comprehensive look at Bitcoin's scripting capabilities, see the Bitcoin Script programmability research article.

## The Tradeoff: Security vs. Functionality

Every constraint on Script is a feature someone cannot build natively on Bitcoin. The lack of loops prevents general computation, the lack of transaction introspection prevents on-chain covenants, and the 520-byte push limit constrains complex multi-party protocols. Each limitation protects the network, but also pushes functionality off-chain or to other layers.

## Risks of Expansion

Proposals to expand Script carry real risks. You need to weigh those risks against the capabilities each proposal would add.

## Risks of Inaction

Keeping Script unchanged also has costs. Developers may move to alternative chains with richer scripting, Layer 2 protocols may hit design ceilings that limit Bitcoin's scalability, and use cases like trustless bridges and on-chain vaults remain impossible without covenant support. The balance between these competing risks defines Bitcoin's ongoing technical evolution.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
