Author

Topic: Bitcoin Input with all address type (Read 283 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
March 24, 2021, 04:45:16 AM
#18
The simplest way of using the same seed for all the addresses is probably going to be to use a BIP39 seed with Electrum, import it three times to create three separate wallets - a P2PKH, a P2SH, and a P2WPKH wallet - and then export the individual private keys for each address you want and import them all in to the same wallet. You could also do something similar with a tool like Ian Coleman. By doing this, you keep each address type under the standard derivation path, so future recovery is as straightforward as possible.
Or, much easier, if you're looking for a HD wallet that allows to create all possible address type from one seed phrase: use Mycelium!
Right under the QR-code it shows: "Tap for P2PKH / Tap for P2SH / Tap for Bech32".

Mycelium has some drawbacks to consider though: it's not open source, only for mobile, and it can't send to multiple addresses at once. I use it as a mobile wallet, but only for small amounts, and I don't need "send to many" from mobile.
legendary
Activity: 2268
Merit: 18711
March 23, 2021, 09:09:35 PM
#17
I don't find that very "simple" and convenient, because you can't generate new adresses in your wallet neither use change adresses.  Undecided
Sure, it's not super straightforward, but it's the simplest method at present to achieve all address types from one seed phrase in a single wallet using Electrum.

Moreover it's not easy to create a P2SH wallet in Electrum. You have to do a hack AFAIK
Not if you are using a BIP39 seed phrase as I said. Then you just recover your seed phrase and select P2SH when prompted.

I'm not sure about that, AFAIK Electrum use the common derivation path (m/0/0) for its legacy wallets, which is the same for its segwit wallets.
For its own seed phrases, Electrum uses m/0 for legacy and m/0'/0 for segwit, but for BIP39 seed phrases it uses the standard BIP 44/49/84 paths.
legendary
Activity: 2604
Merit: 2353
March 23, 2021, 08:32:46 PM
#16
Yes you can import adresses in different formats on Electrum for example. But your wallet won't be a Hierarchical Deterministic wallet as you say.
The simplest way of using the same seed for all the addresses is probably going to be to use a BIP39 seed with Electrum, import it three times to create three separate wallets - a P2PKH, a P2SH, and a P2WPKH wallet - and then export the individual private keys for each address you want and import them all in to the same wallet. You could also do something similar with a tool like Ian Coleman. By doing this, you keep each address type under the standard derivation path, so future recovery is as straightforward as possible.
I don't find that very "simple" and convenient, because you can't generate new adresses in your wallet neither use change adresses.  Undecided
Moreover it's not easy to create a P2SH wallet in Electrum. You have to do a hack AFAIK

The other option is to create a single wallet in Electrum, export the private keys you are interested in, and then import those private keys in to another Electrum wallet, using the same private key to generate one of each of the three above address types. The problem with this is you have to remember that you are using a private key from a "legacy" derivation path m/44'/0'/0'/0/0 to derive a P2WPKH address, for example.
I'm not sure about that, AFAIK Electrum use the common derivation path (m/0/0) for its legacy wallets, which is the same for its segwit wallets.
legendary
Activity: 2268
Merit: 18711
March 23, 2021, 05:06:25 PM
#15
Yes you can import adresses in different formats on Electrum for example. But your wallet won't be a Hierarchical Deterministic wallet as you say.
The simplest way of using the same seed for all the addresses is probably going to be to use a BIP39 seed with Electrum, import it three times to create three separate wallets - a P2PKH, a P2SH, and a P2WPKH wallet - and then export the individual private keys for each address you want and import them all in to the same wallet. You could also do something similar with a tool like Ian Coleman. By doing this, you keep each address type under the standard derivation path, so future recovery is as straightforward as possible.

The other option is to create a single wallet in Electrum, export the private keys you are interested in, and then import those private keys in to another Electrum wallet, using the same private key to generate one of each of the three above address types. The problem with this is you have to remember that you are using a private key from a "legacy" derivation path m/44'/0'/0'/0/0 to derive a P2WPKH address, for example.
legendary
Activity: 2604
Merit: 2353
March 23, 2021, 02:02:09 PM
#14
You can already do it with Bitcoin Core, from the same seed you can generate segwit bech32 addresses, nested segwit addresses and legacy addresses in the same wallet.
You just need to use getnewaddress in the Bitcoin Core console with the address type desired, each time you want a new address.  Smiley
https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/getnewaddress/

usually all wallets have a workaround to do something like this, mostly through creating a new wallet and importing the key with a different address type and sometimes using command line like this.
the problem is that there is no easy way (specially if you are using deterministic wallet) to derive multiple address types from the same seed.
Yes you can import adresses in different formats on Electrum for example. But your wallet won't be a Hierarchical Deterministic wallet as you say. But with Bitcoin Core your wallet will remain deterministic since all adresses generated like that are derived from the same HD seed. That's why it can be a good solution for the use case you mentioned above in my opinion.
legendary
Activity: 2114
Merit: 1293
There is trouble abrewing
March 23, 2021, 12:29:51 PM
#13
You can already do it with Bitcoin Core, from the same seed you can generate segwit bech32 addresses, nested segwit addresses and legacy addresses in the same wallet.
You just need to use getnewaddress in the Bitcoin Core console with the address type desired, each time you want a new address.  Smiley
https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/getnewaddress/

usually all wallets have a workaround to do something like this, mostly through creating a new wallet and importing the key with a different address type and sometimes using command line like this.
the problem is that there is no easy way (specially if you are using deterministic wallet) to derive multiple address types from the same seed.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
March 23, 2021, 11:58:01 AM
#12
@Pmalek @bob123 @o_e_l_e_o you guys should share your opinion with Bitwala, the original author.

~

I really don't like some of the material on that page:

Quote
Brain wallets

If you’re feeling risky, then you might consider using a brain wallet. Disclaimer: we wouldn’t if we were you.

No, you don't ever do this even if you do feel risky because there are programs out there like brainflayer being ran by hungry thieves across all the possible inputs and will take any opportunity to wipe your funds. It's not enough to downplay it by saying "we wouldn't if we were you". They don't even mention how insecure they are.

Quote
Anyways, it’s harder for a hacker to crack two keys than one and that’s why multi-signature solutions are better to ensure enhanced security. It’s also harder to lose two keys than just one. That’s if you store them separately (of course, both in highly secure locations/multiple highly secure locations). That way, if you lose one, you still have access to your coins.

(I assume this is 1-2 Multisig) Hackers usually don't crack the keys, they steal them! So having two different keys is completely useless if somebody just needs one to spend.

Quote
Two out of three keys are required for Bitcoin transactions to be authorised and for a wallet recovery to be performed.

This is not a hard requirement, any M-N scheme can be used as long as M <= N.

Quote
One way to perform a wallet recovery is to go to a GitHub.io hosted page (specified by your wallet client) and enter your backup key/seed phrase.
...

 Shocked I'm not even going to begin talking about this. And it's right at the beginning.

(Hint: would you enter your credit card number on some random Github.io site, especially considering ANYBODY can create one for free?)



It's too bad they don't have a contact page anywhere because there's some really nasty technical errors in this article.
legendary
Activity: 2604
Merit: 2353
March 23, 2021, 11:40:39 AM
#11
Electrum's checksum prevents this, probably to reduce the probability of newbies being confused when restoring their wallets.

that's a shame though because this could have been a very good feature for wallets, maybe more in a couple of years ago than now but still a good one.
people usually need both address types, the segwit one to decrease their fees and the legacy one to receive payments whenever the payer cannot pay to a segwit address.
having the ability to generate different addresses from the same seed in the same wallet (without needing extra work and importing individual keys) could be very useful.
You can already do it with Bitcoin Core, from the same seed you can generate segwit bech32 addresses, nested segwit addresses and legacy addresses in the same wallet.
You just need to use getnewaddress in the Bitcoin Core console with the address type desired, each time you want a new address.  Smiley
https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/getnewaddress/
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
March 23, 2021, 06:35:15 AM
#10
@Pmalek @bob123 @o_e_l_e_o you guys should share your opinion with Bitwala, the original author.

A Bitcoin address is like a traditional bank account number. However, unlike a bank account, one wallet can have multiple receiving addresses generated by its public key.

You can provide those new addresses to whoever wishes to send you bitcoin in order to conceal your original public key. The creation of new receiving addresses is availed of for privacy reasons, however, the coins are still sent to the same wallet. Thus, only your combination of keys can access and move the newly received bitcoin.
legendary
Activity: 2268
Merit: 18711
March 23, 2021, 04:32:10 AM
#9
A Bitcoin address is like a traditional bank account number.
Yeah, I don't like that analogy either because it encourages address reuse, which is bad for your privacy. You can have a single bank account for years or even your entire life, and give out the account details to hundreds or thousands of different people to accept payments from, and suffer next to no consequences. However, if you use the same bitcoin address to receive a thousand different payments from a thousand different people, you let every single one of those people examine your entire financial history, your total income, who else you have transacted with, where you have moved your money to, and so on.

A better analogy is to think of a bitcoin address as an invoice or payment request you would generate for a single other person. You give them the invoice, they pay it, and then you never use the same invoice again. The next time you want to accept a payment, you generate a new invoice.
legendary
Activity: 1624
Merit: 2481
March 23, 2021, 04:07:52 AM
#8
A Bitcoin address is like a traditional bank account number.

I don't like that analogy.
IMO it is pretty far away from the reality and not really comparable.



However, unlike a bank account, one wallet can have multiple receiving addresses generated by its public key.

A "wallet" is just a piece of software or a combination of hardware and software which manages the keys for you.
A wallet does not have that one public key. They can generate multiple public keys derived from multiple private keys. It is comparable to a keychain.



The creation of new receiving addresses is availed of for privacy reasons, however, the coins are still sent to the same wallet

The coins are not "sent to the same wallet".
They are rather "assigned to the public key on the blockchain" (which technically also isn't completely correct, but it is "closer" to the technical truth).
Since your wallet then holds all the corresponding private keys, these coins can be spend by you.
legendary
Activity: 2730
Merit: 7065
March 23, 2021, 03:17:21 AM
#7
However, unlike a bank account, one wallet can have multiple receiving addresses generated by its public key.
A public key is derived from a private key. That public key can then be used to create addresses of various formats. So the same public key can be used to generate a legacy, a nested segwit, a multisig, a native segwit address... I assume that's what you were trying to say or was it something else?
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
March 16, 2021, 12:42:59 AM
#6
If possible, why would the wallets create a separate wallet file for each address type or you can have one recovery file but all addresses are separate.

This is because in their wallet files store either a seed phrase + a bunch of addresses/private keys or just a bunch of addresses/private keys and some parent key that derives all the other keys.

It's easier for them to just store a single field that indicates the type for all derived addresses than to store a field for each and every address, and this latter format introduces the question: "what type will I give newly derived addresses?" (This is especially true for Bitcoin Core which pre-generates several hundred private keys in one go but doesn't expose them to the user until they ask for another receiving address).
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
March 15, 2021, 11:00:12 AM
#5
that's a shame though because this could have been a very good feature for wallets, maybe more in a couple of years ago than now but still a good one.
people usually need both address types, the segwit one to decrease their fees and the legacy one to receive payments whenever the payer cannot pay to a segwit address.
having the ability to generate different addresses from the same seed in the same wallet (without needing extra work and importing individual keys) could be very useful.
Not really, nested segwit would be more than sufficient. The version bit (wrongly referred to as checksum by me, sorry) helps with normal users that aren't really that techsavvy, helping them to restore the wallet correctly years down the road. I don't think there's really any issue with separating the different address type as of now, would be confusing for some if suddenly different address types starts to spawn in the same wallet.

Anyways, it's not impossible to implement but they were fairly reluctant previously, or so when I was searching it up previously. There's an open github issue on this though: https://github.com/spesmilo/electrum/issues/6016.
legendary
Activity: 2114
Merit: 1293
There is trouble abrewing
March 15, 2021, 10:37:51 AM
#4
Electrum's checksum prevents this, probably to reduce the probability of newbies being confused when restoring their wallets.

that's a shame though because this could have been a very good feature for wallets, maybe more in a couple of years ago than now but still a good one.
people usually need both address types, the segwit one to decrease their fees and the legacy one to receive payments whenever the payer cannot pay to a segwit address.
having the ability to generate different addresses from the same seed in the same wallet (without needing extra work and importing individual keys) could be very useful.
legendary
Activity: 2268
Merit: 18711
March 15, 2021, 07:17:47 AM
#3
Can I create a transaction containing all Bitcoin address? P2PKH (1) P2SH (3) Bech32 (bc1)
Sure. Just import the private keys of all the individual addresses in to the same wallet together and create your transaction as normal.

The other question is, can I send money from several inputs one of those inputs is an address containing 0 Bitcoin or invalid one?
No. You cannot include an address with no coins in it as the input to a transaction. When you are selecting bitcoin to use in a transaction, you are selecting inputs, not addresses. The inputs just happen to be stored at various addresses. If there is no input to select, then you obviously cannot include it in a transaction.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
March 15, 2021, 07:16:39 AM
#2
Can I create a transaction containing all Bitcoin address? P2PKH (1) P2SH (3) Bech32 (bc1)
Spending from, yes. Sending to, yes.
If possible, why would the wallets create a separate wallet file for each address type or you can have one recovery file but all addresses are separate.
Not all. You can import addresses of different types on Electrum and Bitcoin Core as well. You can absolutely generate nested Segwit address from the same seeds but Electrum's checksum prevents this, probably to reduce the probability of newbies being confused when restoring their wallets.
The other question is, can I send money from several inputs one of those inputs is an address containing 0 Bitcoin or invalid one?
No, why would you do that? You have to reference a UTXO that is valid, OP_return inputs are not stored within the UTXO.
newbie
Activity: 9
Merit: 7
March 15, 2021, 06:59:16 AM
#1
Can I create a transaction containing all Bitcoin address? P2PKH (1) P2SH (3) Bech32 (bc1)
If possible, why would the wallets create a separate wallet file for each address type or you can have one recovery file but all addresses are separate.

The other question is, can I send money from several inputs one of those inputs is an address containing 0 Bitcoin or invalid one?
Jump to: