Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Chandu141 on December 28, 2019, 09:18:03 AM



Title: BASE58 (P2SH) vs BECH32 (P2WPKH)
Post by: Chandu141 on December 28, 2019, 09:18:03 AM
Hello BTC Devs,

Just wanted to know how much difference it makes between "BASE58 (P2SH) & BECH32 (P2WPKH)"

security wise as well as anonymity wise does BECH32 (P2WPKH) really sound than BASE58 (P2SH) ?



Title: Re: BASE58 (P2SH) vs BECH32 (P2WPKH)
Post by: odolvlobo on December 28, 2019, 09:48:54 AM
Hello BTC Devs,

Just wanted to know how much difference it makes between "BASE58 (P2SH) & BECH32 (P2WPKH)"

security wise as well as anonymity wise does BECH32 (P2WPKH) really sound than BASE58 (P2SH) ?



Base-58 and bech32 are two encoding schemes. P2WPKH and P2SH are two kinds of transactions.


Title: Re: BASE58 (P2SH) vs BECH32 (P2WPKH)
Post by: pooya87 on December 28, 2019, 09:59:05 AM
P2WPKH
this script is similar to P2PKH (addresses starting with 1) but using Segregated Witness. it is also referred to as native SegWit address. it requires one signature and is currently (version 0) using the same signature scheme (ECDSA) as always.
the transaction size is almost the same size as P2PKH (±2 byte) but has a smaller weight so you end up paying lower fees.

- P2WPKH addresses start with bc1 as they use bech32 encoding

the only problem you may face when using these address types is when the person wanting to send coins to you doesn't accept this type of address. eg. an exchange that has not yet updated their system after 3 years!

P2SH
is pay to script where the script can be anything. examples are multi-signature scripts, lock time scripts, witness redeem script,...
if you are looking into "nested SegWit" where you have an address starting with 3 but it is using SegWit then the correct term for these scripts are:
P2SH-P2WPKH
they are similar to P2PKH and they require only one signature.
P2SH-P2WSH
they are similar to regular P2SH but with SegWit. they require a "script" called redeem script to unlock.

- all P2SH addresses start with 3 as they use base58 encoding

in both cases the transaction size is moderately larger than their counterparts due to the leftover redeemscript and SegWit overhead but their weight is smaller so you end up paying a lower fee.

the benefit of nested SegWit compared to native SegWit


there is absolutely no difference between these scripts and their SegWit counterparts regarding anonymity or security (at least not on version 0 witness, there will be some additional privacy benefits in future versions with new proposals).


Title: Re: BASE58 (P2SH) vs BECH32 (P2WPKH)
Post by: Chandu141 on December 28, 2019, 11:47:09 AM


Base-58 and bech32 are two encoding schemes. P2WPKH and P2SH are two kinds of transactions.

Thanks!




there is absolutely no difference between these scripts and their SegWit counterparts regarding anonymity or security (at least not on version 0 witness, there will be some additional privacy benefits in future versions with new proposals).

Thanks for clarifying on this point and  :)


Title: Re: BASE58 (P2SH) vs BECH32 (P2WPKH)
Post by: baro77 on January 04, 2020, 06:14:26 PM
Sorry I have been offline for a while....

Just my humble visual summary:

https://medium.com/@baro77/btc-locking-and-unlocking-scripts-cheatsheet-ff6d515447de (https://medium.com/@baro77/btc-locking-and-unlocking-scripts-cheatsheet-ff6d515447de)

best regars