User A has 3 UTXOs which sum up to 10 XMR. How does the Key Image ensure that all three utxos cannot be double spent?
1 Answers
First, in Monero, each output has a unique corresponding key image. Therefore, if a transaction includes three (or multiple for that matter) outputs (that are used as inputs), there will be three (multiple) corresponding unique key images included in the transaction. This ensures none of the outputs can be spent twice. In addition, for each output that is used as input in the transaction, there will be a "ring" with decoy outputs to obfuscate the real input. Put differently, the ring is created to not reveal which output is being spent.
Practically speaking this works as follows. Alice has received, say, two outputs of 3 XMR and one output of 4 XMR. She subsequently creates a transaction for 10 XMR. Now, all three outputs and their corresponding key images will be included in the transaction. If she chose a ring size of 7, each input will be "surrounded" by six decoy outputs to create a ring of seven inputs.
Note that an example of a ring size 7 transaction with three inputs can be found here. As you can see, there are three key images included:
d215c7c214b5cf6e3d2ee5ddf10275054356081f278419801cd711ebe3ba37b78c7c48a9ee209f5da3542ee27e70451f9673731b876b6168adc67ca78ae844ad795b529ca0625f2a045b99ccd404bb9e3c8811ef30b63dd1a1acac7ad0b74593
In addition, each input has a ring of seven inputs.
Sources / Notes:
More information about the key image can be found here.
Technically Monero does not have UTXOs. All outputs are TXOs, because a blockchain observer is technically not able to determine whether an output has been spent or not.
- 15,417
- 18
- 60
- 114