# Verify Proof

### Verify the proof of a transaction in the tree

> Code samples

```javascript
const inputBody = '{
  "proof": "string",
  "key": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/tree/verify-proof',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

`POST /tree/verify-proof`

> Body parameter

```json
{
  "proof": "string",
  "key": "string"
}
```

#### Parameters <a href="#post__tree_verify-proof-parameters" id="post__tree_verify-proof-parameters"></a>

| Name  | Type           | Required | Restrictions | Description                       |
| ----- | -------------- | -------- | ------------ | --------------------------------- |
| proof | string(string) | true     | none         | The proof to be verified          |
| key   | string(string) | true     | none         | The key associated with the proof |

> Example responses

> 200 Response

```json
{
  "code": 0,
  "message": "string",
  "data": {
    "valid": true,
    "key": "string",
    "value": {
      "txid": "string",
      "version": 0,
      "locktime": 0,
      "vin": [
        {}
      ],
      "vout": [
        {}
      ],
      "size": 0,
      "weight": 0,
      "fee": 0,
      "status": {
        "confirmed": true,
        "block_height": 0,
        "block_hash": "string",
        "block_time": 0
      }
    }
  }
}
```

#### Responses <a href="#post__tree_verify-proof-responses" id="post__tree_verify-proof-responses"></a>

| Status | Meaning                                                 | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | none        | Inline |

#### Response Schema <a href="#post__tree_verify-proof-responseschema" id="post__tree_verify-proof-responseschema"></a>

Status Code **200**

| Name               | Type           | Required | Restrictions | Description                                       |
| ------------------ | -------------- | -------- | ------------ | ------------------------------------------------- |
| » code             | integer(int)   | false    | none         | Error code                                        |
| » message          | string(string) | false    | none         | Error message                                     |
| » data             | object         | false    | none         | Result data                                       |
| »» valid           | boolean(bool)  | false    | none         | Indicates whether the proof is valid              |
| »» key             | string(string) | false    | none         | The key associated with the proof                 |
| »» value           | object         | false    | none         | none                                              |
| »»» txid           | string(string) | false    | none         | Transaction ID                                    |
| »»» version        | integer(int)   | false    | none         | Transaction version                               |
| »»» locktime       | integer(int)   | false    | none         | Transaction locktime                              |
| »»» vin            | object         | false    | none         | Transaction inputs                                |
| »»» vout           | object         | false    | none         | Transaction outputs                               |
| »»» size           | integer(int)   | false    | none         | Transaction size in bytes                         |
| »»» weight         | integer(int)   | false    | none         | Transaction weight                                |
| »»» fee            | integer(int)   | false    | none         | Transaction fee                                   |
| »»» status         | object         | false    | none         | none                                              |
| »»»» confirmed     | boolean(bool)  | false    | none         | Whether the transaction is confirmed              |
| »»»» block\_height | integer(int)   | false    | none         | Block height at which the transaction is included |
| »»»» block\_hash   | string(string) | false    | none         | Block hash at which the transaction is included   |
| »»»» block\_time   | integer(int)   | false    | none         | Time at which the block was mined                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tna-btc.gitbook.io/tna-whitepaper-2/developer-guide/developer-apis/data-availability/verify-proof.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
