I have one minor nitpick about the format of the utxos
endpoint from the spec, which is given as:
[
{
"txid": "355cce4314a...",
"vout": 1,
"value": 1000000,
"scriptpubkey": "...",
"block_height": 0,
"block_hash": "...",
"timestamp": 1715205985,
"spent": false
},
{
"txid": "355cce4314a...",
"vout": 2,
"value": 1000000,
"scriptpubkey": "...",
"block_height": 0,
"block_hash": "...",
"timestamp": 1715205985,
"spent": false
},
...
]
I think it’s better to group the utxos by their txid
. Since Step 2 only calculates the ScriptPubKey
for k=0
, we still need to discover the ScriptPubkey
s where k>0
in Step 6. The only way to do that is to group all the outputs of a transaction first, and then scan them at once.
Since the utxos
aren’t requested that often (only when the filter returns a match), it’s not that much of a hassle to just group them on the client side. Still I think every client will have to do this, so might as well account for it.