It seems like duplicated question, but i read many articles and posts to undestand about segwit.
Below links are something i read
What is block weight and how is it different from block size?
After Segwit Activation, what is the largest block size possible?
Understanding Segwit Block Size
But i need example to clearfy about block weight T_T
In Understanding Segwit Block Size article, writer said that
The Segwit blocks are restricted by something called Block Weight. Block Weight is a new concept introduced in Segwit, and it’s calculated on a per-transaction basis. Each transaction has a “weight” which is defined this way:
(tx size with witness data stripped) * 3 + (tx size)
I think tx size is
tx = transactions + witness data
Then i stuck in recursion... I cannot undetstand.
To me, it seems like contradictory.
Because to define a tx size, needs Block weight to restrict witness data size. But to get a weight, need a tx size.
I understood that if there is no witness data, then maximum block size is 1mb(Before segwit). Yes It is clear. But some people are using weight same with byte.
For example, some people said(especially bitcoin wiki - Block weight)
weight = 1mb * 3 + 1mb = 4mb
And others said(What is block weight and how is it different from block size?)
Even in this post, Sam Jone said 4,000,000 WU but block is still 1mb
weight = 1mb * 3 + 1mb = 4,000,000 Weight unit(WU) Or 4mWU
what is the exact expression?
and If there is no witness data then what is left 3mb or 3mWU filled? is it empty?
In Block #577639, Block size is 1158.038 kB
How witness data is sotred?
1mb transaction + witness data right...?
or
1mb block is shared by transactions and witness data?
Basic concept of segwit is keep a block size as 1mb for transactions and add witness data right...?
It means size of transactions(witness data is excluded) is 1158.038kB? or transactions + witness data is 1158.038kb?
As we know, maximum block weight is 4mWU or 4mb. Therefore, if transactions without witness data is about 1.1mb, then it seems like weird
block weight = 1.1mb * 3 + (1.1mb + witnessdata)
Because it is larger than possible maximum size.
If transactions + witness data is about 1.1mb
block weight = (1.1mb - witnessdata) * 3 + 1.1mb
this calculation seems more reasonable. But if witness data is less than 0.1mb then block weight is more than 4mb. Is it possible that so little witness data?
And If There is only transaction data and no witness data like 1mb transaction data and 0 witness data(block weight is 4mb or 4mWU which is theoritical maximum size) Then how Transaction Malleability problem is solved?
I am so sorry. Questions are quite long, but i hope it can be helpful not only me but also person who are studying about blockchain.
Thank you for reading