TeachMeBitcoin

Efficiency and Privacy

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

P2SH: Efficiency and Privacy

P2SH was more than just a convenient address format; it was a fundamental shift in how Bitcoin scales. By allowing complex scripts to be represented as simple 20-byte hashes, P2SH introduced major improvements to the network's economics and privacy.

1. Saving the UTXO Set

The UTXO Set is the most critical database in a Bitcoin node because it must be kept in RAM for fast verification.

2. Sender-Receiver Equality

In the legacy model, if you wanted to receive a multisig payment, you had to ask the sender to pay higher fees (because their transaction was larger). This was unfair to the sender.

3. Privacy and Script Blinding

P2SH provides "Blinded" scripts.

4. Standardness Thresholds

P2SH allowed the network to support more complex scripts without relaxing "Standardness" rules. While bare multisig is limited to 3 keys, P2SH allows for up to 15 keys (limited by the 520-byte script size limit).

Property P2MS (Bare) P2SH (Hashed)
UTXO Impact High Low
Fee Responsibility Sender Receiver
Privacy Zero High (until spend)
Standardness Strict (3 keys) Flexible (15 keys)

In the final section, we will build a Python P2SH Auditor.

☕ Help support TeachMeBitcoin

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:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!