Author

Topic: P2SH and Bech32? (Read 188 times)

full member
Activity: 1008
Merit: 139
★Bitvest.io★ Play Plinko or Invest!
January 10, 2021, 01: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: 2688
Merit: 3983
January 08, 2021, 02: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: 4361
January 07, 2021, 03: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, 10: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: 2450
Merit: 4415
🔐BitcoinMessage.Tools🔑
January 07, 2021, 10: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: 3038
Merit: 4418
Crypto Swap Exchange
January 07, 2021, 09: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: 1008
Merit: 139
★Bitvest.io★ Play Plinko or Invest!
January 07, 2021, 08: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: