Cost of single vs multiple outputs to the same address Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Cost of single vs multiple outputs to the same address without wasting too much if your time.

The question is published on by Tutorial Guruji team.

A transaction can have multiple outputs pointing to the same address however it’s not clear to me if and how this affects the transaction’s priority and cost?

As an example, let’s consider these two simple cases:

  • Case A: Two outputs pointing to the same address use the same input in a 50/50 split.
  • Case B: Two outputs pointing to the same address use two different inputs of equal amounts.

Answer

A transaction that has multiple output scripts that point to the same address would be no different from a transaction in which every output script pointed to a different address. So when you have two outputs to the same transaction, all that matters is that you have 2 outputs and the size of those outputs (byte-wise).

Transaction priority is calculated as follows:

priority = sum(input_value_in_base_units * input_age)/size_in_bytes

As you can see, only the tx size matters and the input value and age. None of these are influenced by the address to which coins are sent.

We are here to answer your question about Cost of single vs multiple outputs to the same address - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji