I need to confirm that I understand how transactions work in the Bitcoin network. Ok, so:
- Alice is a network node. Alice wants to send bitcoins to someone in the network. Alice is creating a transaction using her wallet.
- Every transaction has inputs and outputs. The inputs of every transaction are just references to some previous outputs of some other, older transactions that previously sent funds to Alice addresses.
- To send bitcoins Alice needs to resolve the puzzle given in the
scriptPubKeyof a previous transaction's output by using her
scriptSigwhich her wallet generates upon making a transaction. Basically Alice just needs to prove that she is in control of private key (related to address previous bitcoins were sent to) by signing the new transaction.
Did I get these steps right?
My confusion started when I was exploring the
hash type because I saw many sentences that said the Output of a transaction is signed correctly. With my understanding (from above) I assume that the previous output is signed correctly? And therefor, an input of a new transaction is considered valid. But I couldn't find confirmation for this. Am I missing something? Thank you!