Altcoins Talks - Cryptocurrency Forum

Crypto Discussion Forum => Cryptocurrency discussions => Technical Discussion => Topic started by: NotATether on March 13, 2024, 10:14:41 AM

Title: Address types
Post by: NotATether on March 13, 2024, 10:14:41 AM
A short list of Bitcoin address types and detailed information about them:

1. P2PK addresses. Also called Legacy addresses. Starts with a 1. If you decode the Base58 to bytes it is 0x0. Its BIP32 derivation path begins with m/44'/0'/0' .

2. P2SH addresses. These contain scripts. Starts with a 3, or in bytes, 0x5. Some of these use special opcodes become a Nested Segwit address and save fees. Its BIP32 derivation path begins with m/49'/0'/0'  (Nested Segwit only).

3. P2WPKH addresses. Also called Native Segwit addresses. Starts with bc1q. In bytes, "bc" is the human readable part and the 1 is a placeholder. This type of address uses the bech32 alphabet where "q" is the first digit, "p" is the second, and so on. Its BIP32 derivation path begins with m/84'/0'/0'.

4. P2TR addresses. Also called Taproot address. Starts with bc1p.  Its BIP32 derivation path begins with m/86'/0'/0' . Most wallets do not support creating this address type yet, although it is mainly used by Ordinals.
Title: Re: Address types
Post by: bitmover on March 13, 2024, 07:31:57 PM
I will add a few  more:

Bitcoin test net addresses:
They are worthless.

Legacy - They stsrt with m or n.
Native Segwit - starts with tb1
p2sh - starts with 2
Title: Re: Address types
Post by: ABCbits on March 15, 2024, 09:33:40 AM
1. P2PK addresses. Also called Legacy addresses. Starts with a 1. If you decode the Base58 to bytes it is 0x0. Its BIP32 derivation path begins with m/44'/0'/0' .

When people say legacy address, they usually refer to P2PKH (Pay to public key hash), not P2PK.
Title: Re: Address types
Post by: Husna QA on March 15, 2024, 03:53:38 PM
1. P2PK addresses. Also called Legacy addresses. Starts with a 1. If you decode the Base58 to bytes it is 0x0. Its BIP32 derivation path begins with m/44'/0'/0' .

When people say legacy address, they usually refer to P2PKH (Pay to public key hash), not P2PK.

And as far as I know, in P2PK (Pay To Public Key), the address remains the complete public key.
The following is an example of a P2PK address:
0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3 (https://mempool.space/address/0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3)

(https://i.ibb.co/xCvsxM4/Screen-Shot-2024-03-15-at-21-46-34.png)


Difference between P2PK and P2PKH:

(https://academy.bit2me.com/wp-content/uploads/2020/09/p2pk-p2pkh.webp)
Image source: https://academy.bit2me.com/en/what-is-a-p2pk/ (https://academy.bit2me.com/en/what-is-a-p2pk/)
Title: Re: Address types
Post by: Don Pedro Dinero on March 19, 2024, 04:12:14 PM
If you are going to talk exclusively about bitcoin in this part of the forum, you'd better specify it in the title since we are in 'cryptocurrency discussions', not 'bitcoin discussions'. Let's change the mentality, we are not in bitcointalk. A title like 'Bitcoin address types' would be more correct.
Title: Re: Address types
Post by: yhiaali3 on March 19, 2024, 11:39:03 PM
Thanks for the useful information.

I have a question here: Why do most centralized exchanges still use old addresses that start with 1 and few of them start with 3? Although, as we know, Segwit addresses have more features, especially saving fees?

I tried many central exchanges to get a Segwit address starting with bc1, but most of them give old addresses. Among the exchanges I tried, there are only Binance and OKX, and maybe two or three exchanges, no more.
Title: Re: Address types
Post by: ABCbits on March 20, 2024, 01:15:08 PM
I have a question here: Why do most centralized exchanges still use old addresses that start with 1 and few of them start with 3? Although, as we know, Segwit addresses have more features, especially saving fees?

We don't know. But many people usually say it's either due to laziness or attitude not touching something that isn't broken. They also gain some money from high withdraw fee, so total money can be saved from using SegWit address not significant for them.
Title: Re: Address types
Post by: bitmover on March 20, 2024, 03:52:24 PM
I have a question here: Why do most centralized exchanges still use old addresses that start with 1 and few of them start with 3? Although, as we know, Segwit addresses have more features, especially saving fees?

We don't know. But many people usually say it's either due to laziness or attitude not touching something that isn't broken. They also gain some money from high withdraw fee, so total money can be saved from using SegWit address not significant for them.

As they do not pay withdrawal fee, I think they have little incentive to upgrade.

I will also add that there is a cost and risk to migrate to another address type.
They will have to hire developers to update their infrastructure (wallets, api, address generators, etc.. ). This is more complex and risky than it looks like. Imagine users depositing money to addresses that the exchange do not control.

So, I think most exchanges just decide not to touch what is already working
Title: Re: Address types
Post by: yhiaali3 on March 20, 2024, 09:13:31 PM
We don't know. But many people usually say it's either due to laziness or attitude not touching something that isn't broken. They also gain some money from high withdraw fee, so total money can be saved from using SegWit address not significant for them.
As they do not pay withdrawal fee, I think they have little incentive to upgrade.

I will also add that there is a cost and risk to migrate to another address type.
They will have to hire developers to update their infrastructure (wallets, api, address generators, etc.. ). This is more complex and risky than it looks like. Imagine users depositing money to addresses that the exchange do not control.

So, I think most exchanges just decide not to touch what is already working
Probably as you both mentioned, because they don't want to pay the cost of development and they also take fees from the user so they have no problem.

Here another question comes to me: Why aren't all DEXs forced to upgrade by the Bitcoin community, since we suffer from time to time from high fees? Why aren't all old addresses canceled and everyone, including DEXs, forced to use Segwit or Taproot addresses?

I mean, forcing the upgrade on everyone could reduce the problem of high fees.
Title: Re: Address types
Post by: Yamane_Keto on March 20, 2024, 09:27:05 PM
Knowing the account type is an essential part of calculating your fees correctly, and if you do not overpay to do this, you must know the Transaction size.

This table below will show you the basic differences and how to calculate them manually, but you can use the tool https://bitcoinops.org/en/tools/calc-size/ that will help you do this directly.

          Type         |  Input  vbyte | Output vbyte |  transaction vbyte
-------------------------+----------------- +----------------------+--------------------------
       Legacy         |      140        |            34          |           192 
         segwit        |        93        |           32           |           134
 Native segwit      |        68        |           31           |         109.5
          P2TR         |      57.5       |           43           |           111

If you notice that for the same number of input and output addresses, the transaction size differs because we use a different address type or in other words Using an address type saves more fees than other types, so it is always recommended to use addresses starting with bc1 to reduce fees.

The wallet performs this step automatically, so if you do not understand it, always remember to use an address that begins with bc1.

After using the address, you need to search for the appropriate fees, which are what you find in mempool priorities. These fees are an estimate of the time that you have to wait, but this time may differ from the truth, and we can say that the difference between them is:


They are all guesses.

If you are in a hurry to confirm your transaction, use the bc1 address open https://mempool.space and set the High Priority fee (more than these fees will help confirm your transaction, but do not pay much more than them. If it is 90, put in your wallet any number between 90 and 120)

This way, you will be able to calculate your fees correctly and know whether you are paying the appropriate fees or not.
I've already talked about the topic here

https://www.altcoinstalks.com/index.php?topic=315253.msg1472626#msg1472626
https://www.altcoinstalks.com/index.php?topic=315253.msg1468310#msg1468310
Title: Re: Address types
Post by: Husna QA on March 21, 2024, 01:55:17 AM
-snip- Here another question comes to me: Why aren't all DEXs forced to upgrade by the Bitcoin community, since we suffer from time to time from high fees? Why aren't all old addresses canceled and everyone, including DEXs, forced to use Segwit or Taproot addresses?

I mean, forcing the upgrade on everyone could reduce the problem of high fees.

As long as the Legacy address still exists, a Bitcoin user or any DEX has the freedom to use that type of Bitcoin address.

There must be an agreement in consensus* to remove the Legacy address type, just like when a new address type will be implemented (for example, P2TR type).

* https://github.com/bitcoin/bips (https://github.com/bitcoin/bips)
Title: Re: Address types
Post by: ABCbits on March 21, 2024, 09:37:35 AM
Here another question comes to me: Why aren't all DEXs forced to upgrade by the Bitcoin community, since we suffer from time to time from high fees? Why aren't all old addresses canceled and everyone, including DEXs, forced to use Segwit or Taproot addresses?

I mean, forcing the upgrade on everyone could reduce the problem of high fees.

Bitcoin community greatly value backward compatibility, so forcing upgrade which disallow usage of old address won't happen. Besides, DEX isn't part of Bitcoin protocol and usually support multiple coins at once.
Title: Re: Address types
Post by: bitmover on March 21, 2024, 06:34:24 PM
Here another question comes to me: Why aren't all DEXs forced to upgrade by the Bitcoin community, since we suffer from time to time from high fees? Why aren't all old addresses canceled and everyone, including DEXs, forced to use Segwit or Taproot addresses?

I mean, forcing the upgrade on everyone could reduce the problem of high fees.

Forcing upgrade to Segwit/Taproot would not solve scalability issues.

Layer 1 will probably always be somewhat expensive. You can find cheap (nearly free) transactions in layer 2 solutions. Lightning, liquid...
Title: Re: Address types
Post by: yhiaali3 on March 21, 2024, 06:55:49 PM
Layer 1 will probably always be somewhat expensive. You can find cheap (nearly free) transactions in layer 2 solutions. Lightning, liquid...
Yes, you are correct. Layer 2 solutions are much cheaper. I thought about using the Lightning Network, but I ran into the same problem.

When using the Electreum wallet, for example, there is no problem, but the problem is when using DEX. Because most exchanges give old Bitcoin addresses and do not support Lightning, with the exception of a few such as Binance and OKX.

The problem is that I don't want to use these two exchanges (Binance and OKX) because they ask for KYC and also block my country.
Title: Re: Address types
Post by: bitmover on March 21, 2024, 07:46:32 PM
Layer 1 will probably always be somewhat expensive. You can find cheap (nearly free) transactions in layer 2 solutions. Lightning, liquid...
Yes, you are correct. Layer 2 solutions are much cheaper. I thought about using the Lightning Network, but I ran into the same problem.

When using the Electreum wallet, for example, there is no problem, but the problem is when using DEX. Because most exchanges give old Bitcoin addresses and do not support Lightning, with the exception of a few such as Binance and OKX.

The problem is that I don't want to use these two exchanges (Binance and OKX) because they ask for KYC and also block my country.

Have you tried exch.cx?
No kyc, and they accept bitcoin lightning payments.
Title: Re: Address types
Post by: dkbit98 on March 21, 2024, 09:09:23 PM
There must be an agreement in consensus* to remove the Legacy address type, just like when a new address type will be implemented (for example, P2TR type).
There is no chance for this will ever happen with any consensus.
Removing old addresses would mean hard fork and totally new supply of coins, and many old coins would be gone forever, including Satoshi's :P
Imagine someone who holds coins for years in cold sdtorage and then bunch of experts decides to make them worthless and unusable  ::)
Title: Re: Address types
Post by: yhiaali3 on March 21, 2024, 11:16:07 PM
Have you tried exch.cx?
No kyc, and they accept bitcoin lightning payments.
I haven't tried it, I know it's through BTT, as exch are Automatic cryptocurrency swaps but that's not what I want. Then their fees are not cheap, around 5%.

In any case, this is not a problem, and so as not to go off topic, my question was why exchanges are not forced to upgrade? and it seems that the closest answer is that they do not have to pay additional costs for the upgrade, as users are the ones who pay the fees, so they will most likely not change anything.

I also believe that soon all exchanges will switch to KYC so the wallet remains the best solution even if there is an increase in fees.
Title: Re: Address types
Post by: Husna QA on March 22, 2024, 12:52:32 AM
There is no chance for this will ever happen with any consensus.
Removing old addresses would mean hard fork and totally new supply of coins, and many old coins would be gone forever, including Satoshi's :P
Imagine someone who holds coins for years in cold sdtorage and then bunch of experts decides to make them worthless and unusable  ::)

I also indirectly deny that it will happen. Even if a proposal proposes this, it will most likely also be rejected. Besides the fact that many old Bitcoins are still stored in the Legacy address type (P2PKH), this type is still safe to use, unlike P2PK, which has several risks, so Satoshi replaced it.

Regarding yhiaali3's question below

my question was why exchanges are not forced to upgrade?

The only thing that still allows users is to look for exchanges that have many options for Bitcoin address types other than legacy types.
Title: Re: Address types
Post by: dkbit98 on March 22, 2024, 05:11:01 PM
I haven't tried it, I know it's through BTT, as exch are Automatic cryptocurrency swaps but that's not what I want. Then their fees are not cheap, around 5%.
I don't know who told you that, but this is not the same fee you need to pay for all coins available on eXch exchange, it is only for Monero pairs.
For example exchanging Bitcoin to Litecoin fee is from 0.5% to 1%, it is the same for Lightning Network, USDT, and all other available coins.
No other fees, no registration, and it all works fast.
Title: Re: Address types
Post by: yhiaali3 on March 22, 2024, 07:57:03 PM
I don't know who told you that, but this is not the same fee you need to pay for all coins available on eXch exchange, it is only for Monero pairs.
For example exchanging Bitcoin to Litecoin fee is from 0.5% to 1%, it is the same for Lightning Network, USDT, and all other available coins.
No other fees, no registration, and it all works fast.
Thanks for the clarification. Yes, this is a misunderstanding on my part. I only tried exchanging between Bitcoin and Monero, so I got a 5% fee. I did not try the other pairs, so thanks for pointing out this point.

I wanted to transfer using USDT on the Tron network, but I did not find it among the options. I only found USDT on the Ethereum network, so I tried Monero.
Title: Re: Address types
Post by: bitmover on March 22, 2024, 10:13:05 PM
Have you tried exch.cx?
No kyc, and they accept bitcoin lightning payments.
I haven't tried it, I know it's through BTT, as exch are Automatic cryptocurrency swaps but that's not what I want. Then their fees are not cheap, around 5%.

They are very cheap. Their fees are 0.5%.
No withdrawal fees. For small values, it is much cheaper than usual CEX, and as I said, no KYC and no smartcontract fees.

You will pay about 80 USD in mining fees for the same service using uniswap.
Title: Re: Address types
Post by: dkbit98 on March 23, 2024, 08:40:57 PM
I wanted to transfer using USDT on the Tron network, but I did not find it among the options. I only found USDT on the Ethereum network, so I tried Monero.
I think they are working on adding more option for USDT and other stable coins, Tron support could be added in future, and probably L-USDT on Liquid Network.
My suggestion for you is to try Aqua wallet for mobile devices with support for BTC, Liquid L-BTC and L-USDT.
Transactions are much cheaper and there is an option to receive/send transactions from and to Tron and Ethereum with 1% additional fee, and it converts it to liquid.
Aqua is open source:
https://aquawallet.io
Title: Re: Address types
Post by: bitmover on March 24, 2024, 10:09:23 PM
I wanted to transfer using USDT on the Tron network, but I did not find it among the options. I only found USDT on the Ethereum network, so I tried Monero.
I think they are working on adding more option for USDT and other stable coins, Tron support could be added in future, and probably L-USDT on Liquid Network.
My suggestion for you is to try Aqua wallet for mobile devices with support for BTC, Liquid L-BTC and L-USDT.
Transactions are much cheaper and there is an option to receive/send transactions from and to Tron and Ethereum with 1% additional fee, and it converts it to liquid.
Aqua is open source:
https://aquawallet.io

The lightning implementation is very good. I used it a few times and it worked very well.
Title: Re: Address types
Post by: yhiaali3 on March 25, 2024, 09:25:28 PM
My suggestion for you is to try Aqua wallet for mobile devices with support for BTC, Liquid L-BTC and L-USDT.
Transactions are much cheaper and there is an option to receive/send transactions from and to Tron and Ethereum with 1% additional fee, and it converts it to liquid.
Aqua is open source:
https://aquawallet.io
Thank you, Aqua Wallet This seems to be what I'm looking for, a non-custodial and open source wallet, it seems like a perfect fit for me.

Since it supports BTC, Liquid L-BTC and L-USDT I expect I can convert BTC to USDT easily without the need for a centralized exchange.

I will try downloading the application and depositing some Bitcoin, then I will explore the available options. I hope it will do the trick.