Bitcoin Forum
June 20, 2024, 07:46:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is a transaction legal if it just sends funds back to itself?  (Read 814 times)
No_2 (OP)
Hero Member
*****
Offline Offline

Activity: 901
Merit: 1033


BTC: the beginning of stake-based public resources


View Profile
December 07, 2015, 01:09:46 PM
 #1

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?
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
December 07, 2015, 01:20:25 PM
 #2

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.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
mezzomix
Legendary
*
Offline Offline

Activity: 2618
Merit: 1253


View Profile
December 07, 2015, 01:25:12 PM
 #3

The input amount that is not claimed by the outputs is the fee. Both transactions are valid.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4669



View Profile
December 07, 2015, 05:23:16 PM
 #4

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!