Understanding the Collateral Field in Cardano (Two Mined Transactions Spending the Same Output)

Hi All,

Recently, I came across two transactions in block 9668317 in which they are spending the same output from a previous transaction. Here are the transactions:

Transaction 1:

Hash: 920d1b137174bf9dc0c38a564d6fee2eb97fbfe4a7462e8cd0aec9b1e71bd893

in which Blockfrost API says it has two inputs with the following fields:

{
'tx_hash': '2ae671f088cc2ff5414e...2795e78a87', 
'output_index': 3, 
'collateral': False, 
'reference': False
}

and

{
'tx_hash': '2ae671f088cc2ff5414e68ae0a43168cfff6b5d082777dd88b04a82795e78a87', 
'output_index': 3,
'collateral': True,
'reference': False
}

Transaction 2:

Hash: 2ae671f088cc2ff5414e68ae0a43168cfff6b5d082777dd88b04a82795e78a87

in which Blockfrost API says it has an input with the following fields:

{
'tx_hash': '2ae671f088cc2ff5414e68ae0a43168cfff6b5d082777dd88b04a82795e78a87',
'output_index': 3,
'collateral': True,
'reference': False
}

However, Cardanoscan.io shows this input for transaction 2 and not transaction 1.

As I understand it, collateral is defined after scripts are introduced to Cardano. Therefore, in the second verification phase, if a transaction fails, the verifier gets paid for their efforts. Therefore, it should not add extra expectations since the transaction still spends the output regardless of whether it succeeds or fails.

Isn’t it impossible to put both on blockchain since they spend the same output if two inputs from transaction 1 and one input from transaction 2 conflict?

Yes, collateral was Introduced at the same time as smart contracts.

If Blockfrost is showing information which may be wrong (sorry I do not know the details of this stuff well enough to judge) and Cardanoscan.io does not show the same information, then I think it is reasonable to conclude that Blockfrost is probably wrong.

Hi Eric,

I also get the same information from my local synced node. I’m using tx_in and collateral_tx_in tables to reproduce Blockfrost data. Hence, it’s unlikely that this is a mistake since I can find the same problem in other transactions too.

Can you recommend any in-source sources where I can read more about collateral input/output in detail?

Best,
Soroush

In the “Collateral” tabs, it is shown for both transactions.

The difference is that Transaction 2 uses it as collateral input as well as “normal” input. That’s totally possible since collateral is only spent if the transaction fails in validation phase 2. So, it’s not conflicting if a transaction spends the same input normally if it succeeds and as collateral if it fails. Cannot happen both at the same time.

Transaction 1 did not use that input as “normal” input (otherwise it would have spent it in any case and Transaction 2 wouldn’t even have had it available). So, Cardanoscan does not show it in the “UTxOs” tab, but only in the “Collateral” tab.

Seems that Blockfrost’s data model is not really ready to show this difference.

3 Likes