Bitcoin transactions are messages, like email, which are digitally signed using cryptography and sent to the entire Bitcoin Network for verification. Transactions are public and can be found on the digital ledger known as the blockchain. Here are the steps of how bitcoin transactions actually work.
1. Amount, Input, Output
In any bitcoin transaction, there are three main variables: an amount, an input and an output. The input is the address from which the money is sent, and the output is the address from which the funds are collected.
Since a wallet can contain multiple input addresses, you can send money from one or more inputs to one or more outputs. There is also a data storage portion for each transaction, a kind of note that allows you to record data to the blockchain immutably.
But the unique thing about bitcoin transactions is that, if you initiate a transaction that’s worth less than the total amount in your input, you get your change back not to your original output, but through a new third address in your control. This means your wallet typically ends up containing multiple addresses, and you can pull funds from these addresses to make future transactions.