What is a Bare Script
What is a Bare Script?
A bare script (sometimes called a "bare output") is a locking script that directly expresses its spending conditions without the P2SH wrapper. Before P2SH was introduced in 2012, bare scripts were the only option. Today, they are mostly legacy constructs.
Bare P2PK — The Original Bitcoin Output
The very first Bitcoin transaction ever (the genesis block coinbase) used a bare P2PK output:
// Genesis block output script:
04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG
This script locks coins to a full (uncompressed) public key directly. To spend it, you provide a signature:
// Unlocking script:
<signature>
// Validation:
<signature> <pubkey> OP_CHECKSIG → [TRUE]
Bare Multisig — M-of-N Without P2SH
Before P2SH, multisig outputs had to use bare multisig scripts. The locking script contained all the public keys:
// 2-of-3 bare multisig:
OP_2 <pubKey1> <pubKey2> <pubKey3> OP_3 OP_CHECKMULTISIG
// Unlocking:
OP_0 <sig1> <sig2>
The problem: the sender had to know all the public keys and include them in the locking script. This made the transaction large and expensive, and it required the sender to know details they shouldn't need to know. P2SH solved this by moving the keys into the redeem script.
Why Bare Scripts Fell Out of Use
Bare scripts have several disadvantages compared to their P2SH or SegWit equivalents:
-
Size: Bare multisig locking scripts are large. A 2-of-3 bare multisig locking script is ~105 bytes. The P2SH equivalent is just 23 bytes.
-
Privacy: Anyone can see the spending conditions before the coins are spent.
-
Wallet compatibility: Older wallets expected P2PKH addresses. Bare scripts don't produce standard addresses.
-
Relay limits: Bitcoin Core only relays bare multisig up to 3-of-3. Anything larger is non-standard.
Bare Scripts Still Used Today
Despite their disadvantages, bare scripts do still appear:
-
Coinbase outputs in early blocks used bare P2PK
-
OP_RETURN outputs are technically bare scripts
-
Puzzle scripts on testnets and experimental contracts
-
Satoshi's known addresses (if ever moved) would use bare P2PK
// OP_RETURN is a bare script (data carrier):
OP_RETURN <arbitrary data up to 80 bytes>
// This is provably unspendable — no valid unlocking script exists
// But it is still technically a "bare" locking script
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: