One transaction id with 2 transfer?! why?!

Please see this transaction:

Why OUTPUTS have 2 address?
I only transfer 25 ada and I get this transaction id.
But in explorer show 2 addresses!

Thats how eutxo works.

Imagine you have to pay 25$ in a shop but you only have a 100$ bill in your pocket. Whats happening there is you give the 100$ and receive the 75$ back while the seller keeps the 25$.

So if you only have a utxo with 100 ADA, it will spend that one but you will get back the rest of the amount in a new utxo in your wallet.

1 Like

So, how can I find real send money?!
I use api and I get this result:

            "hash": "e88ba841fbf6b4340019310c04ed57a2daad046279fbac5c6d6a1a3b6b8f0bca",
            "block": "ff18e5ba41c4f5696d04eccf9429ad35c5ace3a5b2b6dd086c601027c68a4b2d",
            "block_height": 7452329,
            "block_time": 1656873157,
            "slot": 65306866,
            "index": 3,
            "output_amount": [
                    "unit": "lovelace",
                    "quantity": "103650194"
            "fees": "180285",
            "deposit": "0",
            "size": 365,
            "invalid_before": "0",
            "invalid_hereafter": "65316863",
            "utxo_count": 3,
            "withdrawal_count": 0,
            "mir_cert_count": 0,
            "delegation_count": 0,
            "stake_cert_count": 0,
            "pool_update_count": 0,
            "pool_retire_count": 0,
            "asset_mint_or_burn_count": 0,
            "redeemer_count": 0,
            "valid_contract": true

Im dont understand what you are asking here. What do you mean?

You can get all the UTxOs of the transaction with:{hash}~1utxos/get

In order to analyse, which of them “really” went out, you’d have to look at the addresses of the outputs. If they are in the same wallet as the inputs, then it is change going back to the same wallet. If they are in a different wallet, it is “real send money”.

To which wallet an address belongs can be found, for example, with:{address}/get The stake address is the same for all addresses of a wallet.

If you want your code to be really resilient, you’d have to also consider the case, where the inputs are not all from the same wallet. This happens regularly, when dealing with DApps (one of the inputs is a contract/script address). But it can also happen, when someone crafts a transaction taking inputs from several wallets manually.

1 Like

Thank you @HeptaSean