Bitcoin Forum
July 16, 2024, 10:46:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: P2WSH and P2SH  (Read 204 times)
coinlary (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 4


View Profile
July 03, 2024, 01:19:46 PM
Last edit: July 04, 2024, 11:17:06 AM by coinlary
 #1

Bip16 P2WSH and Bip141 P2SH

Firstly, both Pay 2 Witness Script Hash (  P2WSH) and Pay 2 Script Hash (P2SH) and they contain the Pay 2 Multisig (P2MS) locking Script

Bip16 P2WSH and Bip141 P2SH

Firstly, both Pay 2 Witness Script Hash (  P2WSH) and Pay 2 Script Hash (P2SH) are Multisig type are script hashes that can use hash of a multi-sig redeem script as well as hash of any other redeem script type, they contain the Pay 2 Multisig (P2MS) locking Script

Here's a quick overview  of Multisig wallet

   P2WSH and P2SH address
P2SH was used before the introduction  of Seqwit which also brought about the use of P2WSH,the idea of P2WSH was to replace P2SH as it's much more standard

P2SH address starts with 3 and usually have 34 chars
Testnet starts with 2
-----------‐------------------------------------------------------------
P2WSH address starts with bc1q just like the P2WPKH both are segwit version 0 but P2WSH is 62 chars.
Testnet starts with tb1q

             P2WSH and P2SH Unlocking Script
The Unlocking Script is always used to unlock the output of their transaction.
The Script sig contains the Unlocking Script(I.e the Unlocking code & the Reedem Script) for P2SH
The Witness field Contains the Unlocking Script(Witness script)for P2WSH which needs be hashed using  SHA-256  to attempt the Script Hash

Ref == https://learnmeabitcoin.com

Here's the little I've learned about them so far as I have been reading throughout  my stay on the forum

All Corrections and additions are welcome


[Addit]

P2TR

 P2TR or Taproot exist today which allow lower transaction size and slightly better privacy, so there's no strong reason to keep using P2SH and P2WSH unless you can't find software which use P2TR (with specific spending condition you impose) or you perform transaction with someone else who use software which doesn't support P2TR.
bitmover
Legendary
*
Offline Offline

Activity: 2366
Merit: 6121


bitcoindata.science


View Profile WWW
July 03, 2024, 03:34:19 PM
 #2

Why not talk about the other address formats as well?

Bech32
Native Segwit, starts with bc1, lower fees than compatible segiwt (3)


Taproot
Bech32m format , stars with bc1p


Full list here
https://en.bitcoin.it/wiki/List_of_address_prefixes

pooya87
Legendary
*
Offline Offline

Activity: 3514
Merit: 10712



View Profile
July 04, 2024, 05:00:51 AM
Merited by ABCbits (2)
 #3

Firstly, both Pay 2 Witness Script Hash (  P2WSH) and Pay 2 Script Hash (P2SH) are Multisig type and they contain the Pay 2 Multisig (P2MS) locking Script
They aren't "multisig type", both of these script hashes can use hash of a multi-sig redeem script as well as hash of any other redeem script type.

Quote
the idea of P2WSH was to replace P2SH as it's much more standard
Being standard is not a spectrum, a script is either standard or not.

P2WSH is not exactly a replacement either even though it may look like one. It is the SegWit way of using script hash in locking scripts.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether
Legendary
*
Offline Offline

Activity: 1666
Merit: 7034


In memory of o_e_l_e_o


View Profile WWW
July 04, 2024, 07:30:33 AM
Merited by ABCbits (1)
 #4

Firstly, both Pay 2 Witness Script Hash (  P2WSH) and Pay 2 Script Hash (P2SH) are Multisig type and they contain the Pay 2 Multisig (P2MS) locking Script

The old multisig that was used by so-called P2SH and P2MS addresses had some serious limitations in the number of co-signers you could have. I think it was a maximum of three or something. But for segwit addresses (P2WSH in other words), the limit has increased significantly to about a thousand co-signers or close to that. That is why everybody is using P2WSH when they want to use Multisig, as the old address format was way too restrictive about this.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2940
Merit: 7665


Crypto Swap Exchange


View Profile
July 04, 2024, 09:48:52 AM
 #5

All Corrections and additions are welcome

Here's an addition from me. P2TR or Taproot exist today which allow lower transaction size and slightly better privacy, so there's no strong reason to keep using P2SH and P2WSH unless you can't find software which use P2TR (with specific spending condition you impose) or you perform transaction with someone else who use software which doesn't support P2TR.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1582
Merit: 7746

Masses won't buy bitcoin. Masses will earn bitcoin


View Profile
July 04, 2024, 10:14:04 AM
 #6

Soon to be updated with silent payment addresses.

Being standard is not a spectrum, a script is either standard or not.
Maybe some nodes treat it as standard, maybe some don't!  Tongue

The old multisig that was used by so-called P2SH and P2MS addresses had some serious limitations in the number of co-signers you could have. I think it was a maximum of three or something.
Correct, 3. The serious limitation was that P2MS didn't have an address type, it was plain script. This practically means no reputable wallet software can send to P2MS. You need to manually construct it. Recipe for disaster.
coinlary (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 4


View Profile
July 04, 2024, 11:01:33 AM
 #7

Why not talk about the other address formats as well?

Only  talked about those because they "can receive hash of a multisig reedem script" just as I've been correct maybe I can create another thread talking about  it if I learn more about them
Thank you for this

Firstly, both Pay 2 Witness Script Hash (  P2WSH) and Pay 2 Script Hash (P2SH) are Multisig type and they contain the Pay 2 Multisig (P2MS) locking Script
They aren't "multisig type", both of these script hashes can use hash of a multi-sig redeem script as well as hash of any other redeem script type.

Quote
the idea of P2WSH was to replace P2SH as it's much more standard
Being standard is not a spectrum, a script is either standard or not.

P2WSH is not exactly a replacement either even though it may look like one. It is the SegWit way of using script hash in locking scripts.
~
Noted sir.. and corrected


The old multisig that was used by so-called P2SH and P2MS addresses had some serious limitations in the number of co-signers you could have. I think it was a maximum of three or something. But for segwit addresses (P2WSH in other words), the limit has increased significantly to about a thousand co-signers or close to that. That is why everybody is using P2WSH when they want to use Multisig, as the old address format was way too restrictive about this.
Thank you for this....

Here's an addition from me. P2TR or Taproot exist today which allow lower transaction size and slightly better privacy, so there's no strong reason to keep using P2SH and P2WSH unless you can't find software which use P2TR (with specific spending condition you impose) or you perform transaction with someone else who use software which doesn't support P2TR.
Okays noted and added ...
However, I have a question although I haven't read much about P2TR but can it have co-signers just like a multisig or maybe I'm just getting it all wrong
pooya87
Legendary
*
Offline Offline

Activity: 3514
Merit: 10712



View Profile
July 04, 2024, 04:00:26 PM
 #8

The old multisig that was used by so-called P2SH and P2MS addresses had some serious limitations in the number of co-signers you could have. I think it was a maximum of three or something.
I believe 3 is standard limitation otherwise you can use up to 20 for n in P2MS and only 15 in P2SH (assuming compressed pubkeys)

Quote
But for segwit addresses (P2WSH in other words), the limit has increased significantly to about a thousand co-signers or close to that.
For witness version 0 the n value is still limited to 20 max
https://github.com/bitcoin/bitcoin/blob/bd5d1688b4311e21c0e0ff89a3ae02ef7d0543b8/src/script/interpreter.cpp#L1116

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2940
Merit: 7665


Crypto Swap Exchange


View Profile
July 05, 2024, 08:45:53 AM
 #9


Here's an addition from me. P2TR or Taproot exist today which allow lower transaction size and slightly better privacy, so there's no strong reason to keep using P2SH and P2WSH unless you can't find software which use P2TR (with specific spending condition you impose) or you perform transaction with someone else who use software which doesn't support P2TR.
Okays noted and added ...
However, I have a question although I haven't read much about P2TR but can it have co-signers just like a multisig or maybe I'm just getting it all wrong


Yes, it's possible. What can be done with P2SH and P2WSH is also possible with P2TR.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
coinlary (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 4


View Profile
July 05, 2024, 08:49:02 AM
 #10



Yes, it's possible. What can be done with P2SH and P2WSH is also possible with P2TR.
In this case does it means it use the P2MS locking Script too because  I'm so surprised it could be used in a multisig wallet
ABCbits
Legendary
*
Offline Offline

Activity: 2940
Merit: 7665


Crypto Swap Exchange


View Profile
July 05, 2024, 08:56:59 AM
 #11

Yes, it's possible. What can be done with P2SH and P2WSH is also possible with P2TR.
In this case does it means it use the P2MS locking Script too because  I'm so surprised it could be used in a multisig wallet

The locking script is different. If you try to create P2TR multi-sig address with help of Miniscript and descriptor, you need to use multi_a(k,key1,...,keyN) rather than multi(k,key1,...,keyN).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
coinlary (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 4


View Profile
July 05, 2024, 10:50:08 PM
 #12

Still going through this,still trying to find my way around the abstractions
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!