ScriptSig
ScriptSig (Script Signature) is a component of a Bitcoin transaction input that contains the unlocking data required to spend a previously created transaction output. It typically includes a digital signature and, in many cases, a public key that proves the spender has the right to use the referenced UTXO.
ScriptSig Explained in Simple Terms
ScriptSig Explained in Simple Terms
Every Bitcoin transaction output is protected by a set of rules that determine who can spend it. These rules are stored in the output's locking script, commonly known as ScriptPubKey.
When someone later wants to spend that Bitcoin, they must provide evidence that they satisfy those rules.
This is where ScriptSig comes into play.
You can think of ScriptPubKey as a locked door and ScriptSig as the key used to open it. The locking script defines the requirements, while ScriptSig provides the data needed to meet them.
If the provided data is valid:
the output can be spent
the transaction is accepted
If the data is invalid:
the transaction is rejected by the network
How ScriptSig Works
How ScriptSig Works
When a wallet creates a transaction, it must prove ownership of the UTXOs being spent.
The process works as follows:
Existing UTXO Selected The wallet chooses a UTXO as a transaction input.
Locking Conditions Identified The network checks the rules stored in the output's ScriptPubKey.
Unlocking Data Generated The wallet creates a digital signature using the private key.
ScriptSig Added The signature and other required data are placed inside the transaction input.
Verification Performed Bitcoin nodes execute both scripts together to determine whether spending is authorized.
The relationship can be summarized as:
If validation succeeds, the UTXO can be spent.
Example of ScriptSig in Practice
Example of ScriptSig
Imagine Alice previously received Bitcoin at an address controlled by her wallet.
The corresponding output contains a locking script requiring:
a valid digital signature
the correct public key
When Alice wants to spend those funds, her wallet creates:
a digital signature generated from her private key
the matching public key
These elements are placed into the ScriptSig field of the transaction input.
Bitcoin nodes then verify that:
the signature is valid
the public key matches the locking conditions
Alice is authorized to spend the output
If everything checks out, the transaction is accepted.
Why ScriptSig Matters
ScriptSig plays a crucial role in Bitcoin's security model because it provides proof of ownership without exposing the private key.
It allows the network to:
verify spending rights
validate digital signatures
prevent unauthorized transactions
enforce ownership rules
maintain trustless operation
Without ScriptSig, Bitcoin nodes would have no way to confirm that a spender controls the funds they are attempting to use.
ScriptSig vs ScriptPubKey
ScriptSig
Located in:
transaction inputs
Purpose:
provide unlocking data
Usually contains:
digital signatures
public keys
ScriptPubKey
Located in:
transaction outputs
Purpose:
define spending conditions
Usually contains:
locking rules
address-related instructions
Together, these two scripts determine whether a transaction is valid.
ScriptSig and Digital Signatures
In a typical Bitcoin transaction, ScriptSig contains a digital signature created using the private key associated with the funds being spent.
The signature proves:
ownership of the UTXO
authorization of the transaction
integrity of transaction data
Importantly, the private key itself never appears on the blockchain.
Only the cryptographic proof is shared.
ScriptSig and Transaction Validation
Every full node verifies ScriptSig before accepting a transaction.
During validation, the node checks:
whether the signature is valid
whether the public key matches the locking script
whether the transaction data has been altered
whether the referenced UTXO exists and remains unspent
Only transactions that satisfy all conditions can be added to a block.
ScriptSig and SegWit
With the introduction of Segregated Witness (SegWit), much of the signature-related data moved from the traditional ScriptSig field into a separate witness structure.
As a result:
legacy transactions rely heavily on ScriptSig
SegWit transactions store most signature data in the witness section
However, understanding ScriptSig remains important because it forms the foundation of Bitcoin's transaction validation model.
Related Bitcoin Terms
ScriptPubKey
Digital Signature
Transaction Input
UTXO (Unspent Transaction Output)
Public Key
SegWit