In this video Andreas Antonopolous says an output is indivisible and therefore if a transaction smaller than the output is done, the rest is used as change and returned to your different address of same public key.

Is this true? How does lightning work with microtransactions then?

  • 1
    Small correction: there is no such thing as a different address of the same public key; if the key is the same, the address is the same. Change is usually sent to a different address, with a corresponding different key, but belonging to the same wallet. – Pieter Wuille Jun 14 '19 at 15:43

Is this true?

Yes, it is true. In very very simpler terms, think this to be in a way wherein someone sends you a coin worth that amount. In other words, if someone sends you 10 BTC, they are sending you a coin that is worth 10BTC, while when they send you 5 BTC, they send you a coin worth 5 BTC. So, while you are spending that money, you have to spend the entire coin. This is exactly the concept with UTXO. When you need to send some bitoins, you have to consume the entire UTXO amount and send the difference back to yourself through a change address.

How does lightning work with microtransactions then?

Lightning transaction works in the same way. When forwarding a HTLC you subtract the amount from your own balance and lock that in the HTLC. Eg. Alice and Bob have a channel. in the present state, the commitment transactions of the channel consumes their channel funding transaction and outputs to (1) Alice_pub_key and (2) Bob_pub_key. Say Alice wants to send X satoshis to Dave. Alice creates a commitment transaction with Bob that consumes the entire bitcoins from the funding transactions of Alice and Bob's channel, and outputs to (1) X satoshi to htlc; (2) Alice's balance - X satoshi (3) Bob's balance.

Similarly when Bob forwards to Charlie, he will be deducting X satoshi from his balance in his commitment transaction with Charlie. Same with Charlie and Dave. When Dave provides the preimage, he will claim the amount in HTLC output in the commitment transaction with Charlie. Charlie will then claim that amount from his commitment transaction with Bob and Bob will claim the amount from the htlc output in the commitment transaction with Alice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.