Skycoin’s UTXOs and You

What is a UTXO and why are they in the Advanced Send option in the Skycoin wallet?

Fray
Skyfleet Captain’s Log
4 min readMay 8, 2019

--

Many cryptocurrencies, like Skycoin and Bitcoin, have UTXOs. (Ethereum does not.)

Your Skycoin wallet does a lot of work to make transactions as simple and seamless as possible. The wallet creates the convenient illusion that when you receive Skycoin, it resides in your wallet in the same way dollar bills might be present in your billfold, until you decide to spend some portion of it. This is a useful abstraction, because it is how bank accounts and actual wallets have always worked. However, if you try using the “advanced send” option in some versions of the Skycoin wallet, you will get a glimpse of how the Skycoin blockchain really works, as you’re confronted with a list of UTXOs, or Unspent Transaction Outputs and asked to select which one(s) to use.

You balance is the sum total of the address’ UTXOs.

What your wallet displays as your “balance”, is really just the total sum of all of your Unspent Transaction Outputs, because they all came to your wallet originally as inputs. Because wallet addresses don’t ‘hold’ currency in the way traditional bank accounts do; they simply mark and store transactions, either inputs or outputs. When you “receive” Skycoin, that’s classified as an input to your wallet address. It then becomes an output, classified as an unspent transaction output; literally a transaction output that has not been spent yet.

If you understand a little about how the blockchain works, then you know that these transactions get hashed and signed to a block in a way that cryptographically links it permanently to the block prior (and therefore all prior blocks), and by the same measure, inextricably linked to every subsequent block posted to the chain.

These are the UTXOs for this wallet address. In the Advanced Send option, you can choose which UTXOs to use in the transation.

“Skycoin wallet software gives the impression that coins are sent from and to wallets, but they are really chained together, moving from transaction to transaction. Each transaction spends the coins previously received in one or more earlier transactions, so the input of one transaction is the output of a previous transaction.” —Skycoin.net

When you send Skycoin normally using your wallet, behind the scenes it is selecting one or more of your UTXOs equal to or greater than the amount you are attempting to send. It sends that total amount, and returns the difference (“change”) back to your account. In the “Advanced Send” options of the Skycoin wallet, you can even specify to which address or addresses you wish to receive the change.

Here is an example. Let’s say your neighbour owes you for helping them paint their fence, and you wish to be paid in Skycoin. She sends you four Skycoin. Another friend is buying your used guitar for six Skycoin. You now have one UTXO for 4 $SKY, and another for 6 $SKY. If you don’t already have Skycoin in this address, your balance will be displayed as 10 Skycoin, which is the sum total of these two unspent transactions.

These two transaction inputs to your wallet address will soon become two unspent transaction outputs.

A few weeks later you’re on vacation in South Holland and come across a trendy women’s fashion boutique that accepts Skycoin as payment, and there is a dress you want that costs nine Skycoin. If you were using the normal send function in your wallet, it would use both the 4 $SKY UTXO from your neighbour, and the 6 $SKY UTXO from the sale of your guitar. Then those unspent outputs would become inputs in the transaction to the store’s wallet, while the 1 Skycoin difference between your UTXOs and the purchase price would be returned to your wallet as ‘change’, in turn becoming a new UTXO, ready to spend again.

This being Skycoin, of course each UTXO has Coin Hours attached as well, some of which will be sent along with the Skycoin, some you will keep, and a portion which will be “burned” as a transaction fee.

If I needed to send 67 Skycoin, I might select these lower two UTXOs, and only burn 5599 Coin Hours, rather than include the UTXO with over 38,000 Coin Hours, which would result in a much higher number of burned Coin Hours.

Using the Advanced Send option in the Skycoin wallet allows you to choose which UTXOs to use in order to facilitate the transaction you are wanting to execute. For instance, you might choose to use a UTXO with sufficient Skycoin to cover your transaction, but a relatively small number of Coin Hours, thus reducing the total amount of Coin Hours that might otherwise be spent in the transaction.

So don’t be afraid to use the Advanced Send and take control of how to make new inputs out of your unspent outputs!

If you liked my writing and would like to contribute to me making more feel free to donate some Skycoin: GCB5KK9LmJzxxxh2hMoKm3HRXwaJe9vRfd

--

--