Bitcoin Forum
May 07, 2024, 05:30:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: P2SH and Bech32?  (Read 158 times)
Marvelman (OP)
Full Member
***
Offline Offline

Activity: 1008
Merit: 137


★Bitvest.io★ Play Plinko or Invest!


View Profile
January 07, 2021, 01:43:10 PM
Merited by hugeblack (2)
 #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?


1715059830
Hero Member
*
Offline Offline

Posts: 1715059830

View Profile Personal Message (Offline)

Ignore
1715059830
Reply with quote  #2

1715059830
Report to moderator
1715059830
Hero Member
*
Offline Offline

Posts: 1715059830

View Profile Personal Message (Offline)

Ignore
1715059830
Reply with quote  #2

1715059830
Report to moderator
1715059830
Hero Member
*
Offline Offline

Posts: 1715059830

View Profile Personal Message (Offline)

Ignore
1715059830
Reply with quote  #2

1715059830
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4166


View Profile
January 07, 2021, 02:16:07 PM
 #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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
witcher_sense
Legendary
*
Offline Offline

Activity: 2338
Merit: 4330

🔐BitcoinMessage.Tools🔑


View Profile WWW
January 07, 2021, 03:13:33 PM
Last edit: January 07, 2021, 03:29:05 PM by witcher_sense
Merited by Marvelman (1)
 #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:


█▀▀▀











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











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

Activity: 2394
Merit: 5235



View Profile
January 07, 2021, 03:36:18 PM
Merited by hugeblack (2), Rath_ (2), ABCbits (1)
 #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.


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

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 07, 2021, 08:26:20 PM
Merited by Marvelman (1)
 #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:

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
hugeblack
Legendary
*
Offline Offline

Activity: 2506
Merit: 3647


Buy/Sell crypto at BestChange


View Profile WWW
January 08, 2021, 07:55:24 AM
Merited by Marvelman (1)
 #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>

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Marvelman (OP)
Full Member
***
Offline Offline

Activity: 1008
Merit: 137


★Bitvest.io★ Play Plinko or Invest!


View Profile
January 10, 2021, 06: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

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!