> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmos.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Evidence

> gRPC queries and transaction messages defined by the evidence module in Cosmos SDK v0.55.

<Info>
  Generated from [`cosmos/cosmos-sdk@2086680ff8b0`](https://github.com/cosmos/cosmos-sdk/tree/2086680ff8b08fd269ee653e087ea577bab79534/proto) on ref `release/v0.55.x`.
</Info>

## Queries

A node exposes only the services its application registers:

* gRPC on port 9090
* REST on port 1317, if the method has an HTTP binding

Run `grpcurl -plaintext localhost:9090 list` to see what a node serves.

Queries are read-only and never pass through consensus. See [Queries](/sdk/latest/learn/concepts/transactions#queries).

Replace `<string>` placeholders with real values and omit unused filters. Payloads use protobuf JSON, and some `string` fields accept enum constants listed under Types. Field tables give the encoding each value takes.

Examples assume a local node. For TLS endpoints, use port 443 and omit `-plaintext`. See [gRPC services](/sdk/latest/api-reference/grpc/index) for reflection, address formats, and decimal encoding.

### AllEvidence

AllEvidence queries all evidence.

|      |                                             |
| ---- | ------------------------------------------- |
| gRPC | `cosmos.evidence.v1beta1.Query/AllEvidence` |
| REST | `GET /cosmos/evidence/v1beta1/evidence`     |

Request `QueryAllEvidenceRequest`:

| Field        | Type                                                    | Description                                                |
| ------------ | ------------------------------------------------------- | ---------------------------------------------------------- |
| `pagination` | [`PageRequest`](#cosmos-base-query-v1beta1-pagerequest) | pagination defines an optional pagination for the request. |

Response `QueryAllEvidenceResponse`:

| Field        | Type                                                      | Description                                        |
| ------------ | --------------------------------------------------------- | -------------------------------------------------- |
| `evidence`   | `Any`\[]                                                  | evidence returns all evidences.                    |
| `pagination` | [`PageResponse`](#cosmos-base-query-v1beta1-pageresponse) | pagination defines the pagination in the response. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"pagination":{"limit":"1"}}' \
  localhost:9090 cosmos.evidence.v1beta1.Query/AllEvidence
```

### Evidence

Evidence queries evidence based on evidence hash.

|      |                                                |
| ---- | ---------------------------------------------- |
| gRPC | `cosmos.evidence.v1beta1.Query/Evidence`       |
| REST | `GET /cosmos/evidence/v1beta1/evidence/{hash}` |

Request `QueryEvidenceRequest`:

| Field           | Type     | Description                                                                                                                 |
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `evidence_hash` | `bytes`  | evidence\_hash defines the hash of the requested evidence. Deprecated: Use hash, a HEX encoded string, instead. Deprecated. |
| `hash`          | `string` | hash defines the evidence hash of the requested evidence.                                                                   |

Response `QueryEvidenceResponse`:

| Field      | Type  | Description                              |
| ---------- | ----- | ---------------------------------------- |
| `evidence` | `Any` | evidence returns the requested evidence. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"hash":"<string>"}' \
  localhost:9090 cosmos.evidence.v1beta1.Query/Evidence
```

## Transaction messages

These messages are included in signed transactions, not called as endpoints. See [Transactions](/sdk/latest/learn/concepts/transactions#transactions) for the execution model, and [Sending transactions](/sdk/latest/api-reference/transactions) for the envelope they go into.

Examples use CLI transaction JSON. Decimal fields use values such as `"0.05"`, even when their proto type is `bytes`. The gRPC `TxEncode` method instead requires the scaled value `"50000000000000000"`. See [scalar encodings](/sdk/latest/api-reference/grpc/index#scalar-encodings).

* Handler: Generated client method
* Signer: Account that must sign
* Amino name: Legacy identifier used by hardware wallets and other Amino signers

### SubmitEvidence

SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or counterfactual signing.

|            |                                              |
| ---------- | -------------------------------------------- |
| Type URL   | `/cosmos.evidence.v1beta1.MsgSubmitEvidence` |
| Handler    | `cosmos.evidence.v1beta1.Msg/SubmitEvidence` |
| Signer     | `submitter`                                  |
| Amino name | `cosmos-sdk/MsgSubmitEvidence`               |

| Field       | Type     | Description                                                                                                      |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `submitter` | `string` | submitter is the signer account address of evidence. Encoded as cosmos.AddressString.                            |
| `evidence`  | `Any`    | evidence defines the evidence of misbehavior. Accepts any message implementing cosmos.evidence.v1beta1.Evidence. |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.evidence.v1beta1.MsgSubmitEvidence",
  "submitter": "<string>",
  "evidence": {
    "@type": "/cosmos.example.v1.MsgExample",
    "...": "the fields of that message, inline"
  }
}
```

Response `MsgSubmitEvidenceResponse`:

| Field  | Type    | Description                            |
| ------ | ------- | -------------------------------------- |
| `hash` | `bytes` | hash defines the hash of the evidence. |

## Types

Messages referenced by the fields above. Protocol buffers version 3 has no required fields, so every field is optional on the wire, and a `[]` suffix marks a repeated field.

### cosmos.base.query.v1beta1.PageRequest

PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex:

`message SomeRequest { Foo some_parameter = 1; PageRequest pagination = 2; }`

| Field         | Type     | Description                                                                                                                                                                                                                          |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `key`         | `bytes`  | key is a value returned in PageResponse.next\_key to begin querying the next page most efficiently. Only one of offset or key should be set.                                                                                         |
| `offset`      | `uint64` | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.                                                                                   |
| `limit`       | `uint64` | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.                                                                                              |
| `count_total` | `bool`   | count\_total is set to true  to indicate that the result set should include a count of the total number of items available for pagination in UIs. count\_total is only respected when offset is used. It is ignored when key is set. |
| `reverse`     | `bool`   | reverse is set to true if results are to be returned in the descending order.                                                                                                                                                        |

### cosmos.base.query.v1beta1.PageResponse

PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest.

`message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }`

| Field      | Type     | Description                                                                                                                                  |
| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `next_key` | `bytes`  | next\_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results. |
| `total`    | `uint64` | total is total number of results available if PageRequest.count\_total was set, its value is undefined otherwise                             |
