How is a bitcoin transaction created ? What are all the required parameters to create a transaction?
A Bitcoin transaction is created within the Bitcoin wallet software. There are two major types of transaction which can be created: Pay to Public Key Hash, which go to standard Bitcoin addresses beginning with a 1… or Pay to Script Key Hash, which go to multisig or SegWit addresses starting with a 3… To create the transaction, the wallet must contain the privkey(s) which match to the address(es) being spent from.
Many other pieces of data are included with the transaction, such as the version number, the list of inputs (these are the bitcoins to you from other addresses) and outputs (linked to the addresses to which you’re spending), and optionally, special instructions for the time in the future when the coins you’re sending will become spendable again (known as the locktime).
There’s quite a lot of data which goes into all transactions! Prior to SegWit, all this data was stored inside the blockchain but SegWit saves block space by separating everything besides the essential transaction data out into a different data structure. To study this in depth, see this detailed article on the Bitcoin wiki: