To understand “what is segregated witness?” we first need to know about block size and why it is kept fixed in blockchain. Block in a blockchain contains data in many forms such as block no., timestamp, nonce, transactions, previous hash and current hash together all they make up a block in a blockchain. and in a blockchain there is limit of maximum block size of a block which is 1 MB which means that you can not add much transactions in a block.
The reason for for having a fixed block size is that, when you have a block size that is too small you will be able to put only very few transactions and there will be bandwidth problems and people will need to wait for putting their transactions and on other hand if you make the block size more it will slow the network as the ledger has to be shared with everyone in the network and due to large size it will take a lot more time.
Due to all this reason middle ground was selected and it was decided that block size is going to 1 MB. But when the chain grew very large and number of transactions increased exponentially and blocks were not able to accomodate that due to their fixed size people started noticing problem related to slowness of network, now the main question was how we are going to solve this problem?
Well one option was to increase the block size and other was segregated witness so let’s understand how segregated witness works so what it does basically is that it looks for individual transactions and as we already know from previous articles about how transactions work in a blockchain and also that transactions not only contains message like “to” and “from” rather it contains private public keys and signature, and “to”, “from” and keys are generally small numbers they take less space while signature is a large hexadecimal number and it is about 60 percent of total transaction size in a block and also they are not direct part of transaction rather they are verification mechanism, so the basic idea behind segregated witness approach was to remove the signature part of transaction from a block which is also called scriptsig, strip it out of the block and send it separately through its own messaging service and on the network separately and by that way each one of this transactions reduces substantially in size and we can fit in more transactions.
So, what segregated witness or segwit does that it does not increase block size, rather it increases the capacity of a block to store more transactions data by removing and sending signature part of it as its own messaging service in a blockchain. And therefore it helps blockchain network to work smoothly.