Get the sending address of a transaction from UTXO

Hey everyone, I’ve searched the Internet and this forum, tried asking in various Discord servers but haven’t found the answer.

What I’m trying to do: Given a UTXO, get the sender address.

I have tried the cardano cli, up to 1.26.1. I’m hoping for a solution that doesn’t involve spinning my own graphql for just this one applicaiton but I found this GitHub - input-output-hk/cardano-graphql: GraphQL API for Cardano.

I found this as an external option https://graphql-api.mainnet.dandelion.link/. But is there anything that can be done locally? I have a relay node running. I can build and send transactions. Basically I want the data that’s in every explorer such as https://cardanoscan.io/.

Thank you for the help I appreciate it.

1 Like

You can query your transaction details via cardano-db-sync (graphql/rest/etc query layers rely on this common backend)

1 Like

Hey thanks for your reply! Does this mean you have to get this running locally? GitHub - input-output-hk/cardano-graphql: GraphQL API for Cardano

Or is there a simpler way since it’s the infrastructure is fairly complex. I’m not quite sure what you mean by via cardano-db-sync? Do you have any docs or more concrete steps?

Thanks!

1 Like

It is simply a postgres DB with a node and a daemon, I’d say it’s pretty basic for blockchain architecture. You can find doco for each component at https://docs.cardano.org.
But if you’re simply looking to leverage off someone else’s node, then you can checkout https://blockfrost.io or https://dandelion.link

1 Like

This is really helpful, I’d seen dandelion but looking at blockfrost now too. Thank you so much!

1 Like

Newbie here – I have a node and wallet running and have also set up cardano-dy-sync-exented on my machine, and am curious on how exactly to query the transaction details of my wallet? I can locally query my wallet’s UTxOs and find respective txHash, but am stumped on how to find the sender’s address associated to the various txHashes. I have tried various queries such as

select tx_out.* from tx_out inner join tx on tx_out.tx_id = tx.id where tx.hash = '<my transaction hash>' ;

and

select tx_out.* from tx_out inner join tx_in on tx_out.tx_id = tx_in.tx_out_id inner join tx on tx.id = tx_in.tx_in_id and tx_in.tx_out_index = tx_out.index where tx.hash = '<my transaction hash>' ;

but always end up with an empty output.
Any insight would be appreciated :slight_smile:

Hi, Did you find out the anwer?

I guess you took that SQL from the reference given in the official doc. I tried the same query but could not determine which one is the sender and which ones are the receivers.