gettxoutproof

Provides a proof that "txid" was a part of a block in hexadecimal coding.

NOTE: By default, this feature is only occasionally functional. This is the case when the transaction's utxo has an unspent output. Maintaining a transaction index is necessary to ensure that it always functions. You can do this by using the -txindex command line option or by manually specifying the block in which the transaction is contained (by blockhash).

Example Request and Result for gettxoutproof method

In this section, we provide an illustrative example of a request made to retrieve details contents using the gettxoutproof method. Additionally, we present the resulting response containing information about the proof that "txid" was part of a block.

Parameters

FieldTypeDescription

txid*

array<string>

The txids to filter

blockhash

string

If specified, looks for txid in the block with this hash

The example in this section uses a non-existing project id.

Make sure you replace it with your Bitcoin mainnet or Bitcoin Testnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns details about an unspent transaction output.

POST https://bitcoin-mainnet.blastapi.io/<project-id>

Request Body

NameTypeDescription

jsonrpc*

string

1.0

id*

string

bwarelabs

method*

string

gettxoutproof

params*

array<string>

[["ee652f0b40209bd02468de0c6336854f5efdd79fb865560aef2c46f4fa0b4a07", "cee11bc3bb3d9db8c4813ed2072a14369a15fcfb9e6bc5cb37a0b5bcc6aa59aa"],null]

{
    "result": "000000202834abd71bdd0d3298542af4506918ea168ce002936b040000000000000000001da8757e4d756e848245cacf3e103c1b9f6ed2405c6d818a73172c8ec72856d4db3864606fdf0c17dcc1000ccb0300000cb86343fc64abcdab51e530303a4ee2b420fa6b5a12b435c9c76fe953ca5471ca074a0bfaf4462cef0a5665b89fd7fd5e4f8536630cde6824d09b20400b2f65eed9f744b2dc695b0ea0c4afd06310a21b93ddd7270a781acd0ada1afdd23b5750aa59aac6bcb5a037cbc56b9efbfc159a36142a07d23e81c4b89d3dbbc31be1cefe0bb7b0369ffc3b1d530e234987543a2613bbb8b06c86f993a930dee7b9d87f661ef556adc0174c7f180aa28006ee93ce2291302801ecd045c234c00b186ea35ff1e77eac3f113492e2eb12f38b9df452f5831f55c861865ac8f3c7dd06be2377f859ba1d12dea2ec44987796a27d42d5727250c1e0181d6a251f8272f21b9a2034069a2471de43de655619904d43b4665f6ce38741320998dc97838c32c79f1ada066ddf7a441357d55cc42a8906970bff2d5342be694002476733ff593af26f320c10df7ba9a76355438f462c040b598868dfb67c5e88d6d9a426ec8cdd74337d42df6b29e9fb319410848f3ff7228d00dc539e2962d185348ab9663a112a03ff6e00",
    "error": null,
    "id": "bwarelabs"
}

Curl Request example

curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>gettxoutproof' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": "bwarelabs",
    "method": "gettxoutproof",
    "params": [
        [
            "ee652f0b40209bd02468de0c6336854f5efdd79fb865560aef2c46f4fa0b4a07",
            "cee11bc3bb3d9db8c4813ed2072a14369a15fcfb9e6bc5cb37a0b5bcc6aa59aa"
        ],
        null
    ]
}'

Last updated