Title: segwit and address formats Post by: 10_sjdovn_10 on February 18, 2021, 06:33:45 AM Hello , anybody can explain Why to use SEGWIT or why not ?
and what is benefits of using SEGWIT with other wallet formats ? Title: Re: segwit and address formats Post by: ranochigo on February 18, 2021, 06:52:19 AM 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. Title: Re: segwit and address formats Post by: notocactus on February 18, 2021, 07:00:17 AM Your transaction fee will be decided by the formula
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:
Title: Re: segwit and address formats Post by: NeuroticFish on February 18, 2021, 07:45:01 AM 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) Title: Re: segwit and address formats Post by: hosemary on February 18, 2021, 08:05:50 AM
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. Title: Re: segwit and address formats Post by: Charles-Tim on February 18, 2021, 09:11:07 AM 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. Title: Re: segwit and address formats Post by: Charles-Tim on February 19, 2021, 11:09:42 AM 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? 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. Title: Re: segwit and address formats Post by: ranochigo on February 19, 2021, 04:13:41 PM 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.Title: Re: segwit and address formats Post by: pooya87 on February 20, 2021, 04:32:19 AM 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". |