Vout n[2] in "issuefirst" transaction

+3 votes
Hi, somehow my previous question went to approvement once again, im duplicating it here.

So the question is - what is third vout in this transaction for: https://explorer.xfccoin.io/api/getrawtransaction?txid=9a65248b9e7007fabbdeef0054d7d0eb58f002b28a75ec6b1899fd6d5c21e3be&decrypt=1

I saw previous answer by admin, and it says that this vout is change for the address who issued new asset, but as far as i understand it is not the case. Cause change address is totally different from issuer address in this transaction.

Issuer: faCGaHimGTPf1bt3PJJfnjLLMadi4Vtc6gvuMp

Third vout: fPnjGLkQdBkc6CRecs4TPG1GnG1zuoKXgaueEe
asked Aug 4, 2022 by Tester

1 Answer

0 votes
Best answer

Using the online explorer you provided, we checked the previous UTXO which was spent by the transaction you linked, output 2 of txid 08f39b5abe2121175ac634af9bc5510d6009c481979f50e5453e6e71cff22f1b. I can confirm that the address which owns this output is fPnjGLkQdBkc6CRecs4TPG1GnG1zuoKXgaueEe, the same address used for the change output in the subsequent transaction. So the issuer was fPnjGLkQdBkc6CRecs4TPG1GnG1zuoKXgaueEe. The address faCGaHimGTPf1bt3PJJfnjLLMadi4Vtc6gvuMp was the recipient of the issuance of both XFCPMITYRONE and XFCPSALIBAWI assets.

answered Aug 4, 2022 by MultiChain
selected Aug 4, 2022 by Tester
Ok, that make sense, thank you!
So lets say, i have admin permissions over blockchain and my address is fPnjGLkQdBkc6CRecs4TPG1GnG1zuoKXgaueEe

And I am issuing new asset for another address faCGaHimGTPf1bt3PJJfnjLLMadi4Vtc6gvuMp, so this address will own all issued quantity of newly created asset and I will own none of it. Right?

I am confused of fact that recipient not owner address (pkh) mentioned within vout with new asset quantity metadata, and issuer address mentioned only in third vout with no value and no asset quantity.
Yes, that's correct, unless some of the asset is transferred after issuance.
Ok, i have another question. Lets say, I want to calculate current assets balance on particular address (pubkey), without using multichaind api and without importing public\private key to it;

So i have all transactions where my pubkey appears. I am parsing and found transaction like i mentioned above. Lets lay my address is faCGaHimGTPf1bt3PJJfnjLLMadi4Vtc6gvuMp

How could i understand that new asset issuance in this tx should go to faCGaHimGTPf1bt3PJJfnjLLMadi4Vtc6gvuMp asset balance and not to fPnjGLkQdBkc6CRecs4TPG1GnG1zuoKXgaueEe asset creator?

Overall question - how to calculate asset balance on particular address, using rawtransactions?
Still do not understand, in your answer you said that tx that I posted - consumes previous UTXO n[2], ok, but previous TX - again is issuing new asset TX, with strange vout n[2] with no value, and no assets associated with it. How could I understand who is recipient of "issuefirst" transactions.
First question: the asset balance for a particular address is the sum of all transaction outputs owned by the address, which have not yet been spent.

Second question: the recipient of the issuefirst transaction is the address which owns the output in which the issued assets are sitting.
In another words, the recipient of the issuefirst transaction is the address which owns the output with asset metadata, n[0] vout in this particular case?
Yes, the assets are sitting in the output where the "assets" structure appears.