# gettxoutsetinfo

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://bitcoin-mainnet.g.alchemy.com/v2/{apiKey}

Returns statistics about the unspent transaction output (UTXO) set. Only the current chain tip is supported; querying specific blocks is not available.


Reference: https://www.alchemy.com/docs/chains/bitcoin/bitcoin-api-endpoints/gettxoutsetinfo

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| use_index | boolean | No | Whether to use `coinstatsindex` if available. Defaults to true.  |

## Result

**result** (object): Statistics on the current state of the UTXO set.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "gettxoutsetinfo",
  "params": [
    false
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "height": 894719,
    "bestblock": "000000000000000000022d8a0f2096e71b1fe50b486dcda415857bb0cc5a2ca8",
    "txouts": 174434793,
    "bogosize": 13652712508,
    "hash_serialized_3": "d9183d9a82433fbd0b9370da065fb84bbd1bb5004816f242ce0f2268c0394b2e",
    "total_amount": 19858278.9908868,
    "transactions": 121919431,
    "disk_size": 12197514429
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "gettxoutsetinfo",
  "params": [
    false
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'gettxoutsetinfo', params: [false]})
};

fetch('https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "gettxoutsetinfo",
    "params": [False]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"gettxoutsetinfo\",\n  \"params\": [\n    false\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"gettxoutsetinfo\",\n  \"params\": [\n    false\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"gettxoutsetinfo\",\n  \"params\": [\n    false\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: gettxoutsetinfo
summary: Get statistics about the current UTXO set
description: |
  Returns statistics about the unspent transaction output (UTXO) set. Only the current chain tip is supported; querying specific blocks is not available.
params:
  - name: use_index
    required: false
    description: |
      Whether to use `coinstatsindex` if available. Defaults to true.
    schema:
      type: boolean
result:
  name: result
  description: Statistics on the current state of the UTXO set.
  schema:
    type: object
    properties:
      height:
        type: integer
        description: The current block height.
      bestblock:
        title: Bitcoin Block Hash
        type: string
        pattern: ^[a-fA-F0-9]{64}$
        description: A 64-character hex string representing the block hash.
      txouts:
        type: integer
        description: Total number of unspent outputs.
      bogosize:
        type: integer
        description: A meaningless metric used for comparison purposes.
      hash_serialized_3:
        type: string
        description: The serialized hash of the UTXO set.
      muhash:
        type: string
        description: A MuHash of the UTXO set, used for integrity checks.
      total_amount:
        type: number
        format: double
        description: Total amount in BTC of all UTXOs.
      transactions:
        type: integer
        description: Number of transactions with unspent outputs.
      disk_size:
        type: integer
        description: Estimated size of the UTXO set on disk, in bytes.
examples:
  - name: gettxoutsetinfo example
    params:
      - name: use_index
        value: false
    result:
      name: result
      value:
        height: 894719
        bestblock: 000000000000000000022d8a0f2096e71b1fe50b486dcda415857bb0cc5a2ca8
        txouts: 174434793
        bogosize: 13652712508
        hash_serialized_3: d9183d9a82433fbd0b9370da065fb84bbd1bb5004816f242ce0f2268c0394b2e
        total_amount: 19858278.9908868
        transactions: 121919431
        disk_size: 12197514429
```
