<p>Thanks for your question.</p>
<blockquote>
<p>send about 6000ada to bob then he sends the two UTXOs to bob i.e. 5000ada and 2000ada (total 7000 ada) and he receives a new UTXOs of 1000ada back, right?</p>
</blockquote>
<p>Correct. For regular transactions, the sum of the transaction inputs values must match the sum of the outputs (This isn't strictly true, as there are fees and the possibility to create native assets in a transaction too)</p>
<blockquote>
<p>for alice, is not 7000ada stored in tx_out table and 1000ada in tx_in table?</p>
</blockquote>
<p>Correct. A total of 7,000 ₳ would appear in Alice's tx_out and 1000 ₳ in Alice's tx_in, while Bob would see just the outputs of 6,000 ₳ - balancing the transaction inputs and outputs.</p>
<blockquote>
<p>Will the receiver(alice) get the 1000ada back to same address or different?</p>
</blockquote>
<p>Alice will receive the change to the same address which created the transaction.</p>
<blockquote>
<p>Will they have the same transaction id?</p>
</blockquote>
<p>Yes, any given transaction can have multiple inputs and multiple outputs.</p>
<p>If you want a patiently presented video that describes the model in an adequate amount of details, I'd recommend <a href="https://youtu.be/_zr3W8cgzIQ?t=403" rel="nofollow noreferrer">The first lecture in the Plutus Pioneers program.</a></p>

CC BY-SA 4.0
2021-08-31T21:19:36.730Z
One more thing to add maybe, Alice doesn't "send" the transactions to Bob, they're marked as "spent" and 2 completely new EUTXOs are crated: one with 6000 ADA and the other with 1000 ADA
Aron Neewart
CC BY-SA 4.0
2021-08-30T10:37:18.853Z
2021-08-30T10:37:18.853Z
spirois
<p>I am confused with the <code>tx_in</code> and <code>tx_out</code> schema on Cardano dbsync and the transaction process as a whole. For example:</p>
<p>Alice has 10000 ADA distributed as 3000, 5000 and 2000 ADA in three different EUTXOs. If she wants to send 6000 ADA to Bob then she can sends two EUTXOs to Bob, e.g. 5000 and 2000 ADA (total 7000 ADA) and receives a new EUTXOs of 1000 ADA back, right?.</p>
<p>For Alice, are those 7000 ADA stored in the <code>tx_out</code> table and the 1000 ADA in the <code>tx_in</code> table? Will she get the 1000 ADA back into the same address or a different one? If she receives the 1000 ADA back to a different address, will the same transaction block contain both transaction, i.e. address used to send ADA to Bob and the other address used to receive ADA back? Will they have the same transaction id?</p>

<utxo><cardano-db-sync>
Confusion with cardano db sync schema and UTXO model
# Confusion with cardano db sync schema and UTXO model

(Asked by: username_0 on 2021-08-30)

I am confused with the `tx_in` and `tx_out` schema on Cardano dbsync and the transaction process as a whole. For example:

Alice has 10000 ADA distributed as 3000, 5000 and 2000 ADA in three different EUTXOs. If she wants to send 6000 ADA to Bob then she can sends two EUTXOs to Bob, e.g. 5000 and 2000 ADA (total 7000 ADA) and receives a new EUTXOs of 1000 ADA back, right?.

For Alice, are those 7000 ADA stored in the `tx_out` table and the 1000 ADA in the `tx_in` table? Will she get the 1000 ADA back into the same address or a different one? If she receives the 1000 ADA back to a different address, will the same transaction block contain both transaction, i.e. address used to send ADA to Bob and the other address used to receive ADA back? Will they have the same transaction id?

**Tags:** utxo, cardano-db-sync

---

## 1 answers

### Answer by username_1 on 2021-08-30. Score: 4 | Accepted answer

Thanks for your question.

> send about 6000ada to bob then he sends the two UTXOs to bob i.e. 5000ada and 2000ada (total 7000 ada) and he receives a new UTXOs of 1000ada back, right?

Correct. For regular transactions, the sum of the transaction inputs values must match the sum of the outputs (This isn't strictly true, as there are fees and the possibility to create native assets in a transaction too)

> for alice, is not 7000ada stored in tx\_out table and 1000ada in tx\_in table?

Correct. A total of 7,000 ₳ would appear in Alice's tx\_out and 1000 ₳ in Alice's tx\_in, while Bob would see just the outputs of 6,000 ₳ - balancing the transaction inputs and outputs.

> Will the receiver(alice) get the 1000ada back to same address or different?

Alice will receive the change to the same address which created the transaction.

> Will they have the same transaction id?

Yes, any given transaction can have multiple inputs and multiple outputs.

If you want a patiently presented video that describes the model in an adequate amount of details, I'd recommend [The first lecture in the Plutus Pioneers program.](https://youtu.be/_zr3W8cgzIQ?t=403)

> **Comments:**
> **username_2**: One more thing to add maybe, Alice doesn't "send" the transactions to Bob, they're marked as "spent" and 2 completely new EUTXOs are crated: one with 6000 ADA and the other with 1000 ADA  

---

