Author

Topic: segwit and address formats (Read 260 times)

legendary
Activity: 3472
Merit: 10611
February 19, 2021, 11:32:19 PM
#9
Segwit removes the signature from the transaction and bundles it separately.
SegWit does NOT remove anything from transactions, least of which the signature. The signature is still a part of each transaction and it is communicated and stored as the part of that transaction no different than its version, outputs, locktime,... in other words the structure is changed.
The only time it is removed is when sending a SegWit transaction to an old node and that's only because we want to continue letting them run while they are no longer "full nodes".
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
February 19, 2021, 11:13:41 AM
#8
Are transactions that contain SEGWIT addresses better to be listed in the next block because they often contain more fees than regular Legacy transactions?
For the transactions of the same raw size paying the same fees, Segwit transactions are more likely to be included into the next block. Their virtual size is much lower than the legacy transaction despite them having the same raw size. This results in the segwit transaction having a much larger fees/virtual size.
SEGWIT is soft forks are not implemented by all nodes and some block explore cant see SEGWIT addresses
Yes, but that doesn't affect anyone else. The majority of the network and the miners are recognizing segwit addresses right now; this means that segwit transactions will have a good propagation. Having nodes or block explorers that are un-upgraded will not result in miners not accepting segwit transactions. If they can't recognize it, then you shouldn't be using them.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
February 19, 2021, 06:09:42 AM
#7

The formula for fee calculation
Input*180 + output*34 + 10 plus or minus input

To use this formula for native/nested segvit I need to replace "180" and "34" with those values which are relevant to the type of both inputs and outputs, is this correct? What advantage in using this  formula  compared with  online calculators that allow to estimate the fee for given transaction?
Yes, only the input and the output will be changed, also know that the result is actually vsize or vbytes which is measure in weight of a transaction divided by four for segwit. Those input and output size are just for easy calculation sake which will also give the same result.

There is nothing bad to make use of online calculator, but making use of the ones that are not wrong in the calculation. The information above is just for knowing sake.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
February 18, 2021, 04:11:07 AM
#6
To make this clear, it is clear that segwit transaction are weighed not in size but weight unlike the legacy transactions. But, to make it short, the transaction fee can be known from the input and output vbytes of each addresses.

Input
Legacy= 149 vbytes for compressed addresses, while 180 vbytes for uncompressed addresses
Nested segwit= 93 vbytes
Native segwit= 68 vbytes

Output
Legacy= 34
Nested segwit= 32
Native segwit= 31

The transaction size in vbytes for 1 input and 2 output
Legacy= 226/228 for compressed dresses. While 257/259
Nested segwit= 166/168
Segwit= 139/141

Assuming the feerate is set to 100 satoshi/vbytes
Legacy= 226/228 for compressed dresses. While 257/259
100*226= 22600 satoshi for compressed legacy addresses
100*257= 25700 satoshi for uncompressed legacvy addresses

Nested segwit= 166/168
100*166= 16600 satohi

Segwit= 139/141
100*139= 13900 satoshi

Legacy addresses start with 1
Nested segwit addresses start with 3
Segwit addresses starts with bc1

So, with native segwit, you will save much fee. With nested segwit, much fee will also be saved but not as low as native segwit. With legacy, you will pay highest fee, especially if the address is uncompressed. In conclusion, use segwit addresses to pay cheapest fee, especially cheapest while using segwit address to pay segwit address.
legendary
Activity: 2380
Merit: 5213
February 18, 2021, 03:05:50 AM
#5
  • With same number of inputs and outputs, you can reduce the size with Segwit address and related transaction to and from Segwit address.
By using segwit addresses, you don't decrease the size.

Transactions fee is actually calculated based on weight unit. A transaction with segwit address(es) has lower weight unit (not lower size) and you can pay lower fee for it.
That's why we use virtual byte (weight unit / 4) when calculating fees.  

Segwit transactions include some witness data.
Since 1 byte of witness data is equivalent to 0.25 vbyte, segwit transactions have lower virtual size.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
February 18, 2021, 02:45:01 AM
#4
and what is benefits of using SEGWIT with other  wallet formats ?

I'll make it simple. The benefit for you would be the cost of transactions.

If you make a typical transaction with old type of wallet to old type of wallet, for 10 sat/vbyte you'll pay around 2570 satoshi. (see c71cfdbf267a23f1c512933d11305529f4dd9e036642ff11b4b26c38a25bd0ca)
If you make a typical transaction with segwit compatible wallet to segwit compatible wallet, for 10 sat/vbyte you'll pay around 1660 satoshi. (see 0cdadafb139f58666a146d4627cb2e891db8d93d0ec5321a86d6f4a5cd07338c)
If you make a typical transaction with segwit bech32 wallet to bech32, for 10 sat/vbyte you'll pay around 1410 satoshi. (see 116010d6a51087238ebc8f9e8e33a159ccee7f9fe818ef8aa00314bfd51f51e4)
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
February 18, 2021, 02:00:17 AM
#3
Your transaction fee will be decided by the formula
  • Transaction fee = transaction size * fee rate

If you're using a non-custodial wallet, you are fully controlling fee rate for your transactions. Now, let's assume you use a fixed fee rate for your transaction, so you will get a smaller transaction fee if you can reduce your transaction size.

It can be done by two main methods:
  • Reduce your total inputs and/ or total outputs for your transactions
  • With same number of inputs and outputs, you can reduce the size with Segwit address and related transaction to and from Segwit address.

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
February 18, 2021, 01:52:19 AM
#2
Segwit removes the signature from the transaction and bundles it separately. This also means that the convention for calculating transaction size has changed. With Segwit, the transaction are cheaper to make due to the method used when calculating the transaction size which makes it much cheaper than legacy transactions. I can't really see any downsides to be using segwit.

There's Bech32 which is also known as native Segwit as well as nested Segwit which is the witness being nested in the P2SH script. The latter starts with 3 and the former starts with bc1, the weight units of bech32 is smaller than nested Segwit but nested Segwit is compatible with all of the wallets and services while bech32 is not compatible with all.
member
Activity: 100
Merit: 30
Stay humble, be cool, make world better place.
February 18, 2021, 01:33:45 AM
#1
Hello , anybody can explain Why to use SEGWIT or why not ?
and what is benefits of using SEGWIT with other  wallet formats ?
Jump to: