IOTA uses an account-like scheme. This means that we have inputs (addresses) which you have to spend in order to transfer tokens. Addresses are generated from private keys, which in turn are derived from a trytes-encoded seed. A transfer in IOTA is a bundle consisting of outputs and inputs. Bundles are atomic transfers, meaning that either all transactions inside the bundle will be accepted by the network, or none. A typical transfer in IOTA is a bundle consisting of 4 transactions:
|0||Output. Recipient of the transaction||>0 (as defined by user)|
|1||First bundle entry that spends the entirety of the address input. This bundle entry also contains the first part of the signature (in the example case, it'll be the first half of Alice's signature)||<0 (spending of input)|
|2||Second half of Alice's signature.||0|
|3||Output. If there is a remainder (Alice didn't spend her entire balance at the respective key index), it will be sent to a remainder address.||>0 (input - output)|
A unique feature of bundles is that the transactions are identified via the bundle hash, but also via the
trunkTransaction . What this means is that the tail transaction (
currentIndex: 0), references in the
trunkTransaction the transaction hash at index: 1 ,
currentIndex 1 transaction references (and approves) index 2 and so on. This makes it possible to get the full bundle of transactions from just a tail transaction by traversing down the trunk transaction.
A single transaction can obviously contain multiple inputs and outputs.