Author

Topic: Is a transaction legal if it just sends funds back to itself? (Read 829 times)

legendary
Activity: 3472
Merit: 4801
1. It has one input and output with the same address which send the same amount funds to one another, i.e. no miners fee?
2. It has one input and output with the same address which send a reduced amount of funds to one another, i.e. there is a miners fee?

Transactions don't actually use addresses.  Therefore, it is impossible for an input and an output to have the same address.

The input of a transaction is just a reference to a previously unspent output. It includes the transaction ID of the transaction that created the output, and an offset that indicates which of the outputs from that previous transaction are being spent in the new transaction.  It also includes a script that is used to satisfy any conditions that the previous transaction encumbered the output with (typically this is an ECDSA signature). As long as the outputs that are supplying value to the transaction are valid and not yet spent, and the script satisfies the encumbrance, then the input can be used to supply value to the transaction.

The outputs of a transaction are each an integer value (expressed in satoshis) and a script that encumbers the output with certain requirements that must be met in order to use the output as the input of some future transaction.  Typically the script encumbers the output with a need for a signature that can be verified with a public key that hashes (using RIPEMD160) to a given value.  As long as the sum of the values from all the outputs doesn't exceed the sum of the value provided to the transaction from the inputs, and the script is a valid script, then the output can be used by the transaction.

The output script doesn't need to know anything about the input script or anything about the previous output which the input references, so it really doesn't matter what "address" is used to represent either of those output scripts.
legendary
Activity: 2702
Merit: 1261
The input amount that is not claimed by the outputs is the fee. Both transactions are valid.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
I'm sure this has been asked before but I can't find an answer on-line.

Is a bitcoin transaction valid if:

    1. It has one input and output with the same address which send the same amount funds to one another, i.e. no miners fee?
    2. It has one input and output with the same address which send a reduced amount of funds to one another, i.e. there is a miners fee?

1. Yes. There is no miners fee.
2. There is miners fee. Bitcoins cannot disappear like this.

In general input must = output.

CMIIW, this is how I understood it.
hero member
Activity: 906
Merit: 1034
BTC: the beginning of stake-based public resources
I'm sure this has been asked before but I can't find an answer on-line.

Is a bitcoin transaction valid if:

    1. It has one input and output with the same address which send the same amount funds to one another, i.e. no miners fee?
    2. It has one input and output with the same address which send a reduced amount of funds to one another, i.e. there is a miners fee?
Jump to: