Pay-To-Script-Hash (P2SH)

Published by Martin Schuster on

Pay-To-Script-Hash script was created after the fact, for users who wanted additional functionality. It also offers a possibility to place the responsibility of paying additional network fees on the recipient. Creating and using customized scripts was very complex and time-consuming before P2SH was implemented. Instead of sending the transaction script directly to the recipient like in P2PK or P2PKH transaction, the script gets hashed and that hashed script gets send to the recipient.

When redeeming the UTXO, the recipient then must provide the original script and follow the steps of this script to unlock the funds. Especially for long and complex scripts, it saves the sender a lot of size and therefore fees when sending such a script as P2SH. One downside of P2SH is that with the unlocking of the script, all possible ways to spend the coin are revealed. This leads to a leak of unnecessary information for example, what wallet was used and with this information, it could be possible to draw conclusions on additional information.