deso-protocol / deso-protocol/backend

/transaction-info: missing outputs for UtxoType: Unknown

Open
#297 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
139
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Hello there,

The `/transaction-info` endpoint doesn't seem to return all available transaction data on certain transaction kinds (notably `CREATOR_COIN`, perhaps others).

For example, consider one UTXO as given by `/balance` for Nader's pubkey (`BC1YLhyuDGeWVgHmh3UQEoKstda525T1LnonYWURBdpgWbFBfRuntP5`) :

```json
{
"TransactionIDBase58Check": "3JuETTXwzS794FmWKxGVBgsfZ7oWTUhBVLynsVrzWW8JovXfQMqgUB",
"Index": 1,
"AmountNanos": 8457601,
"PublicKeyBase58Check": "BC1YLhyuDGeWVgHmh3UQEoKstda525T1LnonYWURBdpgWbFBfRuntP5",
"Confirmations": 20,
"UtxoType": "UtxoTypeUnknown",
"BlockHeight": 104460
},
```
(Note `UtxoType=Unknown`.)

Now consider the above transaction's data as given by `/transaction-info`:

```json
{
"TransactionIDBase58Check": "3JuETTXwzS794FmWKxGVBgsfZ7oWTUhBVLynsVrzWW8JovXfQMqgUB",
"RawTransactionHex": "018437fe92f4a8032f0c6a78e1546adacd2e8149f78c745133e4a2327b353261e70001033d6b39419e5ba43da78015bd0229b175374d723cc91d74094497c76893fe05c78eb4e2260b2d21033054df257f9d7905cfe85d0a805691e5d1379ca926389896dac88ddc9d2c1bc2009ed0aa280000008d8a7421033d6b39419e5ba43da78015bd0229b175374d723cc91d74094497c76893fe05c7004630440220614180fb520f208123db7889ce8ff4a3a2e50546e90bde27b26f4fda3744d2ec02206ee62693090ab5d733686c228949775ca309518423e658b832e81cc95663101f",
"Inputs": [
{
"TransactionIDBase58Check": "3JuETk151gcVAS6NnnxRqpUJYHTsSJ8jQNsFivygKPMF62Q2Dzwiuk",
"Index": 0
}
],
"Outputs": [
{
"PublicKeyBase58Check": "BC1YLi5fWYZ6TvyUNojfb1pY6P9JBpSAezpYPi3bttdFgcySnpn7K4v",
"AmountNanos": 81304078
}
],
"SignatureHex": "30440220614180fb520f208123db7889ce8ff4a3a2e50546e90bde27b26f4fda3744d2ec02206ee62693090ab5d733686c228949775ca309518423e658b832e81cc95663101f",
"TransactionType": "CREATOR_COIN",
"BlockHashHex": "0000000000004a73b1d3523ca4c063be1000e395466e761329ff7bbe2940fc76",
"TransactionMetadata": {
"BlockHashHex": "0000000000004a73b1d3523ca4c063be1000e395466e761329ff7bbe2940fc76",
"TxnIndexInBlock": 66,
"TxnType": "CREATOR_COIN",
"TransactorPublicKeyBase58Check": "BC1YLi5fWYZ6TvyUNojfb1pY6P9JBpSAezpYPi3bttdFgcySnpn7K4v",
"AffectedPublicKeys": [
{
"PublicKeyBase58Check": "BC1YLi5fWYZ6TvyUNojfb1pY6P9JBpSAezpYPi3bttdFgcySnpn7K4v",
"Metadata": "BasicTransferOutput"
},
{
"PublicKeyBase58Check": "BC1YLhyuDGeWVgHmh3UQEoKstda525T1LnonYWURBdpgWbFBfRuntP5",
"Metadata": "CreatorPublicKey"
}
],
"TxnOutputs": [
{
"PublicKey": "Az1rOUGeW6Q9p4AVvQIpsXU3TXI8yR10CUSXx2iT/gXH",
"AmountNanos": 81304078
}
],
"BasicTransferTxindexMetadata": {
"TotalInputNanos": 165888789,
"TotalOutputNanos": 165888556,
"FeeNanos": 233,
"UtxoOpsDump": "",
"UtxoOps": null,
"DiamondLevel": 0,
"PostHashHex": ""
},
"CreatorCoinTxindexMetadata": {
"OperationType": "buy",
"DeSoToSellNanos": 84584478,
"CreatorCoinToSellNanos": 0,
"DeSoToAddNanos": 0,
"DESOLockedNanosDiff": 76118418
}
}
},
```

This is a `CREATOR_COIN` transaction, which (as far as my understanding goes) means someone has bought Nader's CC. Due to the FR%, Nader receives a DeSo credit which produces an UTXO bound to this transaction at Index=1, but such output is not even listed as a TXO in the transaction info dump.

In this particular case I have verified that manually calculating a pubkey's balance (UTXOs - STXOs) differs exactly by the amount of nanos from `UtxoType=Unknowns` missing in the `transaction-info` output. Adding all such UTXOs allow us to calculate the correct balance.

This seems to be a core bug or missing feature in the `/transaction-info` backend or perhaps in the core lib.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.