Cointegrity

Script

Web3 / smart contracts

A script is a small program or list of instructions embedded directly within a cryptocurrency transaction that specifies the conditions under which the funds locked in that transaction can be spent in the future. Scripts operate on a stack-based virtual machine and typically define spending requirements such as signatures, time locks, or hash preimages that must be satisfied before the transaction output can be claimed. The most common type is an "unlocking script" (scriptSig) that provides the necessary data to satisfy a previous transaction's "locking script" (scriptPubKey). Scripts form the foundation of Bitcoin's programmability and enable everything from simple ownership transfers to complex multisignature schemes. Example: Bitcoin's standard Pay-to-Public-Key-Hash (P2PKH) script requires a valid digital signature from the corresponding private key to unlock funds. The locking script checks that a provided signature matches the public key hash, and only when the unlocking script provides valid data does the transaction succeed. Why it matters for smart contracts: Scripts are the precursor to modern smart contract languages, representing the first approach to embedding conditional logic in cryptocurrency transactions. Understanding Bitcoin scripts is essential for grasping how early blockchains enabled programmable money and the conceptual foundation upon which more advanced smart contract platforms like Ethereum built their execution models.

Category: smart contracts, blockchain technology

Explore the full Web3 Glossary — 2,010+ expert-curated definitions. Need guidance? Talk to our consultants.