The UTXOs already contain the txids so grouping is already possible on the client side if necessary. The question is whether this should happen on the indexing or client side. I would not agree that grouping avoids scanning all the outputs. It only avoids doing it a second → nth time if you’ve found an output on k=0
.
But if we were to offload grouping to the indexer, how would it look? How is the grouping done for donation wallet, is there any additional overhead for doing so? Especially on a per request basis. Which structure do you currently use? Something like this:
{
"txid1.." : [
{
"txid": "txid1...",
"vout": 1,
"value": 1000000,
"scriptpubkey": "...",
"block_height": 0,
"block_hash": "...",
"timestamp": 1715205985,
"spent": false
},
{
"txid": "txid1...",
"vout": 2,
"value": 1000000,
"scriptpubkey": "...",
"block_height": 0,
"block_hash": "...",
"timestamp": 1715205985,
"spent": false
},
...
],
"txid2": [
{
"txid": "txid2...",
"vout": 2,
"value": 1000000,
"scriptpubkey": "...",
"block_height": 0,
"block_hash": "...",
"timestamp": 1715205985,
"spent": false
},
]
}