This post has not been vetted or endorsed by BuzzFeed's editorial staff. BuzzFeed Community is a place where anyone can create a post or quiz. Try making your own!

    P2Sh (Pay To Script Hash) Guide

    Crypto gave a new meaning to the world of transactions, by changing all the known parameters in terms of speed, security and fluidity of such operations. The Bitcoin network is an excellent example of this revolution, especially if we talk about P2SH (Pay To Script Hash).

    Crypto gave a new meaning to the world of transactions, by changing all the known parameters in terms of speed, security and fluidity of such operations. The Bitcoin network is an excellent example of this revolution, especially if we talk about P2SH (Pay To Script Hash).

    What is P2SH?

    A Bitcoin address is a string of alphanumeric characters that a user can distribute to anyone who wants to send them money. Bitcoin addresses can have different formats, the most common being: Pay-to-PubKeyHash (P2PKH) and Pay-to-ScriptHash (P2SH). The main difference between the two is that the standard addresses, for example, "15Cytz9sHqeqtKCw2vnpEyNQ8teKtrTPjp", are technically called as P2PKH (Pay To Public Key Hash) and start with "1", while the multi-signature addresses, such as "347N1Thc213QqfYCz3PqJkP3BQPKJP3 like P2SH (Pay To Script Hash) and start with "3".

    The P2SH address comprises a hashed script, so the sender can create a pubkey script that Pays To Script Hash. The most common use of P2SH is multi-signature addresses, but we must emphasize that they are not limited to such use. Therefore, although a Bitcoin address that begins with the number "3" may make us think that it is a multi-signature address, it is not always the case. All addresses beginning with "3" are P2SH addresses. All multi-signature addresses start with "3". But not all addresses that start with "3" are multi-signature addresses, in your case they can be SegWit addresses.

    How were P2SH addresses created?

    P2SH addresses were developed by software developer Gavin Andresen, who has been recognized for his involvement in Bitcoin's early stages. The idea was presented in March 2012 through BIP16. A month after the publication of BIP16, in April 2012, P2SH addresses were implemented in Bitcoin.Until that date, only P2PKH addresses existed (those that begin with “1”). However, it was possible to create multi-signature addresses, but they had to be done in a very rudimentary way and there was no standard, agreed-upon process for creating them.It was at block 170052 (March 7, 2012) that a transaction in a multi-signature address was received, for the first time in history.

    The address was 342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey. It should be noted that it was an address created without following the BIP16 standard, although, as we can see (starting with "3"), it did follow the BIP13 standard.The ability to carry out collaborative transactions in a decentralized manner is an incredible technological innovation, but it is an innovation that is motivated by a practice hundreds of years old: in the Middle East, those who guarded crypts and security cameras kept treasures with doors that needed multiple keys to be opened, in this little video you can see it.

    Can a hardware wallet synchronize with P2SH addresses?

    A multi-signature address is created through the public keys of different Bitcoin addresses. This means that you can use the public key associated with the private key that your hardware wallet manages to create a P2SH address.

    This compatibility is convenient if we remember that hardware wallets are one of the safest options for storing tokens, as long as they are not lost or access is lost.

    Advantages of P2SH addresses

    The sender can finance any arbitrary redemption script without knowing what the spending conditions attached to the script are. This is an appropriate result, for the sender does not care how the funds sent will be spent in the future. This is a problem for the receiver, who is concerned about the conditions for additional expenses.

    Transaction fees will depend on how big the transaction is, and a fixed-length cryptographic hash allows the sender to send funds to any arbitrary redemption script without worrying about paying higher fees. As said before, It is the receiver’s responsibility to determine how large their spending transaction will be and how much it will cost as they have to include the redemption script in order to spend the funds.