Are trades done on exchanges added to blocks?
Or are they only added once you withdraw the funds to your own wallet?
If this is the case, how does the exchange decide on transaction fees?
Fees for trading are just a property of the exchange, transaction fees on Bitcoin transactions for withdrawals are just their choice to make. They might ...
"txs" : n, (numeric) The number of transactions (including coinbase)
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockcount
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockstats 627251 | findstr /C:"\"txs\":"
The full output contains ...
When a miner finds a valid block, the coinbase transaction they included in their block pays out the mining reward to their own address. Mining rewards can be sent to any type of output. The only special restriction on coinbase transaction outputs is that they can only be spent after a maturation period of 100 confirmations.
You are looking at two different ...
A coinbase transaction can have as many outputs as the miner who created it wants. You may see that there are not just one output for the reward, sometimes there are multiple outputs so that the coinbase transaction pays to multiple miners. Additionally, there may be other 0 value OP_RETURN outputs if the miner so chooses. Typically this is because the miner ...
Segwit changed the transaction format. This new format is specified in BIP 144. This new format is actually a modification to the original transaction format. The changes are just additions to it.
Specifically, what you are missing is that the field immediately following the version number is a single 0 byte (referred to as the marker byte), instead of the ...