Bitcoin Forum
May 25, 2024, 03:08:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How Does Segwit Work?  (Read 314 times)
Gewinnermorte (OP)
Jr. Member
*
Offline Offline

Activity: 32
Merit: 28

Sidechain > Altcoin


View Profile WWW
March 19, 2019, 09:20:57 AM
 #1

How Does Segwit Works?
Is It Just As Simple As Changing The Blocksize From 1MB To 4WU, And Changing Signature Data Into Witness?
Or There's Anything Beyond That?

Buy Things With Bitcoin @ Bitrefill.com (It Support LN Too)
AmyBrown
Newbie
*
Offline Offline

Activity: 9
Merit: 2


View Profile
March 19, 2019, 09:34:17 AM
 #2

Segwit also weighs data to see how it affects the node performance and it has more efficient full-node security.
whotookmycrypto
Full Member
***
Offline Offline

Activity: 168
Merit: 214


WhoTookMyCrypto.com


View Profile WWW
March 19, 2019, 09:40:39 AM
Merited by tyz (1)
 #3

How Does Segwit Works?
Is It Just As Simple As Changing The Blocksize From 1MB To 4WU, And Changing Signature Data Into Witness?
Or There's Anything Beyond That?

Andreas has a great video on this. Do check it out:
https://www.youtube.com/watch?v=dtOjjB4mD8k

If you like his work, do support him on Patreon too:
https://www.patreon.com/aantonop

Retina
Member
**
Offline Offline

Activity: 252
Merit: 59


View Profile
March 19, 2019, 07:45:07 PM
 #4

You can just read this  https://www.coindesk.com/information/what-is-segwit I think main future is:

Quote
Building on top

Another big step forward made possible by SegWit is that it supports the development of second layer protocols, such as the lightning network. The malleability fix made any feature that relied on unconfirmed transactions less risky and easier to design.

The lightning network will further boost bitcoin’s transaction capacity by taking frequent, small transactions off-chain, only settling on the bitcoin blockchain when the users are ready.

SegWit activation also boosted development work on other features such as MAST (which enables more complex bitcoin smart contracts), Schnorr signatures (which would enable another transaction capacity boost) and TumbleBit (an anonymous top-layer network).

You can see the image now.
Quote
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10588



View Profile
March 20, 2019, 05:23:26 AM
 #5

2. SegWit transaction have smaller size, whether it's actual size ~

that is false. SegWit transactions have a bigger size in bytes, it is just in weight unit that is smaller. it is easy to confirm this too, take different similar transactions (legacy with 1 input/2 output and native segwit and nested segwit) and compare their raw transaction sizes in hex.
SegWit adds some overhead to each transaction which increases the total size in bytes:
1. the marker (0x0001) which is 2 bytes
2. item count inside each witness which is a compact int can be at least 1 byte per input
3. [only in nested segwit] the leftover script that you place inside ScriptSig (still not sure how big this is but i believe it is about 22 bytes)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
zekk
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
March 20, 2019, 11:58:06 AM
 #6

Here is a really good youtube video on the matter:

https://www.youtube.com/watch?v=QYZv92F2kCw
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10588



View Profile
March 20, 2019, 01:25:59 PM
 #7

1. Actual transaction size is smaller on very few cases, see https://bitcoincore.org/en/2016/10/28/segwit-

can you give an example of such few cases because I can't think of any and that link is also saying what I said about the overhead and has no mention of any special case where the size is smaller!

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

Activity: 3458
Merit: 10588



View Profile
March 21, 2019, 05:54:00 AM
Merited by ABCbits (3)
 #8


01000000
0001 <--2 extra bytes (seg marker)
01
a683124602722459c3f2f7a6bc1d95f65b8d2ff34a16eb64d7f17192218d26bc
00000000
00 <-- this still exists here so the 1 byte below (0x02) is extra
ffffffff
02
6010030000000000
16 00 14 abbcbaba01e2ece93bbb1c808c87cd4ddee215e1 <--3 less bytes compared to P2PKH
50c3000000000000
17 a9 14 87a5bbd4d212fde72e416e781c47c60a9b17b098 87

02 <--1 extra byte (compact int showing number of witnesses)
47 30 44
02 20 3b6b37f4105a0e51fe0db74d38f6a0e27423c86229da8b974fb2f93b3d662b71
02 20 798fc22bfda5c2d45b4f309e4d8fcf386172129766df38ebbe5c17cdba3645d2
01
21 03 1c27b1d58922b592a26f79494a1c90df2ceba02914054e71d11c0daedb163b33
00000000


the result is the same size in this case not smaller. and that is only because it is creating a new P2WPKH output (paying a bc1 address) otherwise that 3 less bytes wouldn't have existed (like when creating a new P2PKH output) and the tx was 3 byte bigger.

now this is where things become so much bigger, P2SH-P2WPKH (link):
01000000
0001 <--2 extra bytes
01
db6b1b20aa0fd7b23880be2ecbd4a98130974cf4748fb66092ac4d3ceb1a5477
01000000
17 <-- this would have existed anyways so we ignore it here
16 00 14 79091972186c449eb1ded22b78e40d009bdf0089 <-- 23 extra bytes
feffffff
02
b8b4eb0b00000000
19 76 a9 14 a457b684d7f0d539a46a45bbc043f35b59d0d963 88 ac
0008af2f00000000
19 76 a9 14 fd270b1ee6abcaea97fea7ad0402e8bd8ad6d77c 88 ac

02 <--1 extra byte
47 30 44
02 20 47ac8e878352d3ebbde1c94ce3a10d057c24175747116f8288e5d794d12d482f
02 20 217f36a485cae903c713331d877c1f64677e3622ad4010726870540656fe9dcb
01
21 03 ad1d8e89212f0b92c74d23bb710c00662ad1470198ac48c43f7d6f93a2a26873
92040000


so the total overhead here is 26 bytes
(i think the parts in these transactions are clear although i didn't name them, if some part is unclear i can explain more)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
tbct_mt2
Hero Member
*****
Offline Offline

Activity: 2338
Merit: 835



View Profile WWW
March 21, 2019, 07:39:03 AM
 #9

Today, transactions with Segwit take long period to finish.
Mine has still not got first confirmations after 2 hours.
Are there reasonable explanations with this situation today? I have never experienced such long unconfirmed transactions with Segwit like today.
Today, I sent Bitcoin using Segwit eligible address (Bench32), with minimum fees.
I often sent my bitcoin out of Electrum with fee option set at minimum, because I don't have reason to hurry too much that put me to increase transaction fees.
Transactions via Bench32 addresses often finished in less than 30 minutes, or even faster.
However, it has not been confirmed fastly like usual today.
My transaction has still been unconfirmed around one hour and a half of hour.

On the other hand, there are more than 8000 unconfirmed transactions on the Bitcoin legacy network.
https://www.blockchain.com/btc/unconfirmed-transactions

To conclude, I would like to announce this current situation for someone who wanted to make transactions via Bench32 addresses today, they should inrease fees much higher than minimum figures if they have urgent needs.

By the way, I appreciated if someone can guide me how to see statistics on unconfirmed transaction on Segwit network, like we can get on blockchain.info site: https://www.blockchain.com/btc/unconfirmed-transactions
For example, how to get this statistics on this site: https://blockstream.info/
Adriano2010
Hero Member
*****
Offline Offline

Activity: 1414
Merit: 516


View Profile WWW
March 24, 2019, 10:31:50 PM
 #10

Hi. Can someone explain in easy steps if i can check and how to, if a bitcoin starting with "3" is segwit standard or is legacy or is not possible?
TryNinja
Legendary
*
Offline Offline

Activity: 2842
Merit: 7040


Crypto Swap Exchange


View Profile WWW
March 24, 2019, 11:58:33 PM
Last edit: March 25, 2019, 12:10:43 AM by TryNinja
 #11

Hi. Can someone explain in easy steps if i can check and how to, if a bitcoin starting with "3" is segwit standard or is legacy or is not possible?
You can’t really know unless the address spends some coins. Then, you can search for it through https://blockchair.com to see if it has any witness data.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
1miau
Legendary
*
Offline Offline

Activity: 2142
Merit: 6845


Currently not much available - see my websitelink


View Profile WWW
March 25, 2019, 01:05:46 AM
 #12

Hi. Can someone explain in easy steps if i can check and how to, if a bitcoin starting with "3" is segwit standard or is legacy or is not possible?
As TryNinja already said it's only possible to know when a transaction is made from the address, some examples:


Using https://blockchair.com

SegWit: https://blockchair.com/bitcoin/transaction/db6d2b441a5964cd4c3ccdb7316738b020def1fdf2726201f07cc74016844e50
Non-SegWit: https://blockchair.com/bitcoin/transaction/b4262cc5ac3be3899c6d840408eb4252c150bdf82534921360aa5946ded9d62a

(check has witness data?)

 
SegWit No SegWit
_____________________________________________________________________________________________________________________________



Or you can use https://btc.com/ and compare input scripts:

SegWit: https://btc.com/db6d2b441a5964cd4c3ccdb7316738b020def1fdf2726201f07cc74016844e50
Non-SegWit: https://btc.com/b4262cc5ac3be3899c6d840408eb4252c150bdf82534921360aa5946ded9d62a

SegWit (witness)

Non-SegWit (no witness)

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!