Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: poblico on February 05, 2015, 09:01:57 PM



Title: I thought trxid is unique
Post by: poblico on February 05, 2015, 09:01:57 PM
But then I came across this https://blockchain.info/tx/d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599

I see two reward blocks, so the same transaction id exists in two different blocks.
The output is to the same address and that address has only 1 input so it clearly is the same transaction but it was included in two blocks.

Why is that?


Title: Re: I thought trxid is unique
Post by: tacotime on February 05, 2015, 09:06:58 PM
see https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki


Title: Re: I thought trxid is unique
Post by: jbrnt on February 05, 2015, 09:14:56 PM
This is weird. I know duplicate txid is possible. I have no idea block explorers find it hard to interpret:

I don't trust blockchain.info as much as before. I use another explorer to check. Blockr.io shows only one transaction with that txid but shows 100btc, transactions of 50btc each in the address?

http://btc.blockr.io/tx/info/d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599
http://btc.blockr.io/address/info/16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom

Blockchain.info only shows 50btc in the address:
https://blockchain.info/address/16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom


Title: Re: I thought trxid is unique
Post by: johoe on February 05, 2015, 10:06:49 PM
Blockchain.info only shows 50btc in the address:
https://blockchain.info/address/16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom

In some sense Blockchain.info is right.  Only one of the two transactions is spendable.  To put it another way, there is only one transaction that just occurred in two blocks.


Title: Re: I thought trxid is unique
Post by: micaman on February 05, 2015, 11:45:48 PM
Blockchain.info only shows 50btc in the address:
https://blockchain.info/address/16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom

In some sense Blockchain.info is right.  Only one of the two transactions is spendable.  To put it another way, there is only one transaction that just occurred in two blocks.

So who did this just "ignored" 50 deserved coins by overwritting previous unspent ones?


Title: Re: I thought trxid is unique
Post by: domob on February 06, 2015, 06:45:46 AM
Blockchain.info only shows 50btc in the address:
https://blockchain.info/address/16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom

In some sense Blockchain.info is right.  Only one of the two transactions is spendable.  To put it another way, there is only one transaction that just occurred in two blocks.

So who did this just "ignored" 50 deserved coins by overwritting previous unspent ones?
Yes, exactly.  That was presumably a bug in their mining setup (and not done intentionally).


Title: Re: I thought trxid is unique
Post by: gmaxwell on February 06, 2015, 07:03:00 AM
I don't trust blockchain.info as much as before.
BC.i frequently shows outright incorrect information. Some of it is because some of the data they show is "unphysical" e.g. it's some synthesis of data in the blockchain, and the actual operation of the system is not well matched to the model the site presents, so the corner cases produce weird results.  E.g. there was (and still is? unsure) a bunch of "addresses" showing negative "balances". It's less surprising to see errors like that when you understand that there is nothing really like an "address balance" in the Bitcoin system itself.


Title: Re: I thought trxid is unique
Post by: newIndia on February 06, 2015, 09:29:11 AM
I don't trust blockchain.info as much as before.
BC.i frequently shows outright incorrect information. Some of it is because some of the data they show is "unphysical" e.g. it's some synthesis of data in the blockchain, and the actual operation of the system is not well matched to the model the site presents, so the corner cases produce weird results.  E.g. there was (and still is? unsure) a bunch of "addresses" showing negative "balances". It's less surprising to see errors like that when you understand that there is nothing really like an "address balance" in the Bitcoin system itself.

I see this statement time and again. What I understand that an address has its input & output transactions. So, by deducting output transaction balance from input transactions, what we get is address balance. True, it is a derived parameter, but it is there... is not it ?


Title: Re: I thought trxid is unique
Post by: amaclin on February 06, 2015, 10:23:05 AM
Quote
I see this statement time and again. What I understand that an address has its input & output transactions.
Wrong.

Quote
So, by deducting output transaction balance from input transactions, what we get is address balance. True, it is a derived parameter, but it is there... is not it ?

There are no "addresses" in raw bitcoin protocol.
There are "outputs" and "output scripts".

The trivial example is escrow output:
You sent some funds to an escrow script of Alice, Bob and Charley. Each two of them (2-of-3) can decide what to do with these funds.
OK, but what is the balance of you, Alice, Bod and Charley after you sent your funds? Who is an owner?

Sorry, I can not explain it in good English.


Title: Re: I thought trxid is unique
Post by: piotr_n on February 06, 2015, 06:02:38 PM
it wasn't initially the case for coinbase transactions.
now in blocks version 2 they must be unique, but the transactions you're talking about are from blocks version 1.
back then it was still possible for two coinbase transactions to have the same id.


Title: Re: I thought trxid is unique
Post by: hhanh00 on February 06, 2015, 07:24:27 PM
I don't trust blockchain.info as much as before.
BC.i frequently shows outright incorrect information. Some of it is because some of the data they show is "unphysical" e.g. it's some synthesis of data in the blockchain, and the actual operation of the system is not well matched to the model the site presents, so the corner cases produce weird results.  E.g. there was (and still is? unsure) a bunch of "addresses" showing negative "balances". It's less surprising to see errors like that when you understand that there is nothing really like an "address balance" in the Bitcoin system itself.

I see this statement time and again. What I understand that an address has its input & output transactions. So, by deducting output transaction balance from input transactions, what we get is address balance. True, it is a derived parameter, but it is there... is not it ?

True, but blockchain.info is notorious for doing the calculation poorly, i.e. including double spends, orphaned blocks, ignoring address versions, etc.


Title: Re: I thought trxid is unique
Post by: jbrnt on February 07, 2015, 03:01:41 AM
it wasn't initially the case for coinbase transactions.
now in blocks version 2 they must be unique, but the transactions you're talking about are from blocks version 1.
back then it was still possible for two coinbase transactions to have the same id.

The transaction in question is from 2010, that explains it. Found out version 2 was introduced in September 2012. Thanks for the insight.


Title: Re: I thought trxid is unique
Post by: poblico on February 07, 2015, 11:04:11 PM
I came across this with a Blockchain sync tool I am working on so this data exists on the blockchain its not a blockchain.info bad data mapping.

I see that in the early versions of the protocol this was possible so make sense as its an old transaction.

Thanks for the reply and help.