About the title here are transaction example with different SIGHASHes :
https://github.com/petertodd/python-bitcoinlib/blob/05cbb3c9560b36cfe71bac06085a231a6244e13a/bitcoin/tests/data/tx_valid.json#L39i have been learning more about how transactions are signed and already finished all output types but all with SIGHASH_ALL. i feel like all the documentations are lacking when it comes to different SIGHASH types.
I've found
https://en.bitcoin.it/wiki/OP_CHECKSIG quite exhaustive when learning about sighashes (especially the image at the right). What would you want to see added ?
are transactions signed with these types even final/valid?
what is the scriptpub of the outputs they are signing?
The sighash is put aside the signature to be able to verify it : you need to know which data was signed in order to be able to verify the signature against this data. This we want to sign the transaction we are putting the signature in, the SIGHASH (represented as a single byte) is kind of a metadata indicating which part of the transaction has been signed.
EDIT: This is tweakings but it might help you to understand,
here is the permalink to the line where the sighash is appended in a transaction signing function in some (dirty) script I wrote. You might be able to find a more clean version on Peter Todd's
python-bitcoinlib.