Author

Topic: P2SH and Bech32? (Read 158 times)

full member
Activity: 994
Merit: 137
★Bitvest.io★ Play Plinko or Invest!
January 10, 2021, 02:31:16 PM
#7
Thank you all for all the answers, that's exactly what I have been looking for.
I'm going to lock this topic now.


Unfortunately, I don't have enough merit for all of you.  Sad
legendary
Activity: 2506
Merit: 3645
Buy/Sell crypto at BestChange
January 08, 2021, 03:55:24 AM
#6
I was looking for something on the blockchain explorer, and I found some transactions that share inputs from both P2SH addresses (starting with 3) and Bech32 addresses (starting with bc1). My question is, is it possible that both types of addresses come from the same wallet or is there some other explanation for this type of transaction?


Since you found it on the blockchain explorer, the answer should be yes, and therefore the type of wallet (the code) is what gives you the option to insert a bc1 address or not.
For example, coinomi enables you to create three addresses.
So how will fees be calculated? Adding P2PKH addresses will increase the fees, which is one of the most important reasons for using P2SH & Bech32>
HCP
legendary
Activity: 2086
Merit: 4314
January 07, 2021, 04:26:20 PM
#5
Bitcoin Core also supports multiple script types in one wallet... When you use the getnewaddress command on the console (or via bitcoin-cli) you can specify which type you want. It will also automatically generate all three types if you import a private key:
legendary
Activity: 2380
Merit: 5213
January 07, 2021, 11:36:18 AM
#4
You can simply try this in electrum.

Just create a new wallet and select "Import bitcoin addresses or private keys".

Look at the image below.
I am importing a legacy address, a nested segwit address and a native segwit address into a same wallet.



Now, I have all three kinds of addresses in a single wallet and I can spend bitcoin from all of them in a same transaction.

legendary
Activity: 2310
Merit: 4313
🔐BitcoinMessage.Tools🔑
January 07, 2021, 11:13:33 AM
#3
My question is, is it possible that both types of addresses come from the same wallet
It is possible because some bitcoin wallets(samourai wallet, mycelium wallet) allow you to generate different types of addresses. For example, in Samourai wallet you click receive button and then you can choose (in advanced option) different types of addresses: Segwit compatibility (P2SH), Segwit native (bech32), Legacy (P2PKH).

Edit:

legendary
Activity: 2954
Merit: 4158
January 07, 2021, 10:16:07 AM
#2
Most wallets only lets the user have one type of addresses to prevent confusion. It's totally possible that some wallets could offer it in both formats, for compatibility with certain services. You can probably try to use walletexplorer to see if it belongs to exchanges. Some exchanges have both bech32 and p2wsh for their deposit addresses.

It's possible for the transactions inputs to contains UTXOs from both address type, as long as the requirements as encumbered in the UTXOs can be fulfilled.
full member
Activity: 994
Merit: 137
★Bitvest.io★ Play Plinko or Invest!
January 07, 2021, 09:43:10 AM
#1
I was looking for something on the blockchain explorer, and I found some transactions that share inputs from both P2SH addresses (starting with 3) and Bech32 addresses (starting with bc1). My question is, is it possible that both types of addresses come from the same wallet or is there some other explanation for this type of transaction?

Jump to: