Skip to content

Get BTC UTXO returns utxos with runes on them in testnet #83

@Vanniix

Description

@Vanniix

The Get BTC UTXO api endpoint (/v1/indexer/address/{address}/utxo-data) is returning utxos with runes on them in testnet.

The docs for this endpoint simply state "Get non inscription UTXO list by address", so it doesn't specifically mention runes, however, based on its behaviour on mainnet, I am led to believe that this endpoint also does not give rune UTXO's. If this is the case, it is not behaving as expected on testnet.

This is quite concerning to me. If it is not working on testnet, it makes me question if this could also happen on mainnet. I assume this endpoint is being used by dapps to determine which UTXO's are safe to spend, so if this endpoint is returning incorrect data, it could lead to people losing runes.

In addition to the issue with testnet, it is also an issue that the docs are not specific about this endpoint. Since they do not mention runes, it unclear if it should be returning these UTXO's. Please add details indicating if this endpoint does or does not return UTXO's with runes in them. My assumption is that this endpoint returns UTXO's that are 'safe to spend', but this is not clear from the description. It should be made clear that the UTXO's returned from this endpoint are safe to spend, so there is no confusion for future developers.

Here is an example showing rune UTXO's being returned on testnet:
Make a request to this endpoint:
https://open-api-testnet.unisat.io/v1/indexer/runes/utxo/815762e3fcad0ce3d7492df0ddd47437c39e4da73f5d7cf127ee176767197c40/0/balance
It returns this response, indicating this UTXO has runes on it:

{
    "code": 0,
    "data": [
        {
            "rune": "VANNIXRUNETHREE",
            "runeid": "2588355:1773",
            "spacedRune": "VANNIX•RUNE•THREE",
            "amount": "346502700",
            "symbol": "$",
            "divisibility": 2
        }
    ]
}

Now, make a request to this endpoint:
https://open-api-testnet.unisat.io/v1/indexer/address/tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44/utxo-data
It returns this response:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "cursor": 0,
        "total": 9,
        "totalConfirmed": 9,
        "totalUnconfirmed": 0,
        "totalUnconfirmedSpend": 0,
        "totalRunes": 0,
        "utxo": [
            {
                "txid": "62b848acac3e32b273ab8b81bc889947fd9356e2c6fc1ff1af0da92d8662aac1",
                "vout": 2,
                "satoshi": 82007,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2866230,
                "idx": 486,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "62b848acac3e32b273ab8b81bc889947fd9356e2c6fc1ff1af0da92d8662aac1",
                "vout": 0,
                "satoshi": 546,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2866230,
                "idx": 486,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "66a9c41eb1e32dab140feb2e845d91c8a7e98cc9c99002131dc8adf95366fdbc",
                "vout": 0,
                "satoshi": 546,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865693,
                "idx": 1263,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "ca6fed1452662cb79ed76de796f0ec8011c3d89495a116524533532af70226aa",
                "vout": 3,
                "satoshi": 33317,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865517,
                "idx": 1046,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "ca6fed1452662cb79ed76de796f0ec8011c3d89495a116524533532af70226aa",
                "vout": 0,
                "satoshi": 546,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865517,
                "idx": 1046,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "bd6677770280a0febe1db5babe379a0a7af23293cec3fabb547b2e10f1a0d64f",
                "vout": 0,
                "satoshi": 546,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865517,
                "idx": 1045,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "283d3f05144d1d8205637a1f089b275b17e833bd9ea03e8ee831c76946eab43f",
                "vout": 0,
                "satoshi": 546,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865515,
                "idx": 599,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "9887dd6b22684bdb3a79f5240680b9805625ca45df0e540a7b4a4c810b09d506",
                "vout": 0,
                "satoshi": 45815,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865282,
                "idx": 545,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            },
            {
                "txid": "815762e3fcad0ce3d7492df0ddd47437c39e4da73f5d7cf127ee176767197c40",
                "vout": 0,
                "satoshi": 150000,
                "scriptType": "5120",
                "scriptPk": "5120028aa20c1af06c28408a9acb730bfe6e20bf15d27f2c3508b5c3d4c5267d8846",
                "codeType": 9,
                "address": "tb1pq292yrq67pkzssy2nt9hxzl7dcst79wj0ukr2z94c02v2fna3prqpylg44",
                "height": 2865270,
                "idx": 103,
                "isOpInRBF": false,
                "isSpent": false,
                "inscriptions": []
            }
        ]
    }
}

The final UTXO is 815762e3fcad0ce3d7492df0ddd47437c39e4da73f5d7cf127ee176767197c40:0. i.e. the same UTXO is the first request that has runes on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions