Re: [Bitcoin-development] Self-dependency transaction question...

2014-07-14 Thread Mike Hearn
Conceptually all transactions in the block chain lie on a single timeline.
The fact that we quantise that timeline into blocks is in many ways neither
here nor there - it's still a strict line.

What *can* happen and you must be aware of is duplicated transactions.
Satoshi sort of assumed this could never happen because everything is hash
based, but forgot that duplicating coinbases is possible and at one point
this did happen. It was banned by a rule change afterwards but you still
must be able to process the older parts of the chain that have this. There
is a BIP that covers the new rule.
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck#174;
Code Sight#153; - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Self-dependency transaction question...

2014-07-14 Thread Matt Whitlock
On Sunday, 13 July 2014, at 7:32 pm, Richard Moore wrote:
 P.S. If it is valid, another question; what would happen if a transaction was 
 self-referencing? I realize it would be very difficult to find one, but if I 
 could find a transaction X whose input was X and had an output Y, would Y be 
 a new valid utxo, without being a generation transaction input?

Even if you could find such a transaction that contained its own digest, and 
even if such a transaction were valid, it still couldn't conjure new coins into 
existence. The sum of the outputs must be less than or equal to the sum of the 
inputs (except in the case of a coinbase transaction). If a transaction were to 
spend its own output, then the input would be completely used up by the output, 
leaving no balance for a second output.

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Self-dependency transaction question...

2014-07-13 Thread Aaron Voisine
I believe tx have to be ordered sequentially within a block. Also
since a tx is referenced by it's hash, it's practically impossible to
make a self referential tx.

Aaron Voisine
breadwallet.com


On Sun, Jul 13, 2014 at 4:32 PM, Richard Moore m...@ricmoo.com wrote:
 Hey all,

 I'm working on the UTXO database for my Python implementation of bitcoind
 and have found a situation I did not realize was valid, but since it seems
 to be, had a quick question.

 If you look at block #546 the 4th transaction's first input uses its own
 block's 3rd transaction as an input.
 https://blockchain.info/block/5a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6

 My question is, would the other way be valid, that is, could the 3rd
 transaction of a block, use the 4th transaction from the same block as an
 input? Or are transactions processed strictly top to bottom?

 Thanks,
 RicMoo

 P.S. If it is valid, another question; what would happen if a transaction
 was self-referencing? I realize it would be very difficult to find one, but
 if I could find a transaction X whose input was X and had an output Y, would
 Y be a new valid utxo, without being a generation transaction input?

 .·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸(((º

 Richard Moore ~ Founder
 Genetic Mistakes Software inc.
 phone: (778) 882-6125
 email: ric...@geneticmistakes.com
 www: http://GeneticMistakes.com


 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck#174;
 Code Sight#153; - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds
 ___
 Bitcoin-development mailing list
 Bitcoin-development@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bitcoin-development


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck#174;
Code Sight#153; - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Self-dependency transaction question...

2014-07-13 Thread Jeff Garzik
On Sun, Jul 13, 2014 at 10:25 PM, Aaron Voisine vois...@gmail.com wrote:
 I believe tx have to be ordered sequentially within a block. Also
 since a tx is referenced by it's hash, it's practically impossible to
 make a self referential tx.

Correct.  A TX will not reference a later TX in the same block (or itself).

This would be a good invalid-block test to add to the test suite.  Any
volunteers?

-- 
Jeff Garzik
Bitcoin core developer and open source evangelist
BitPay, Inc.  https://bitpay.com/

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck#174;
Code Sight#153; - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development