> ## 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.

# Auth

> gRPC queries and transaction messages defined by the auth module in Cosmos SDK v0.55 (unreleased).

<Info>
  Generated from [`cosmos/cosmos-sdk@c1126e4e5460`](https://github.com/cosmos/cosmos-sdk/tree/c1126e4e5460571378bf9bd9c49cce476b0791e2/proto) on ref `main`.
</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/next/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/next/api-reference/grpc/index) for reflection, address formats, and decimal encoding.

### Account

Account returns account details based on address.

|      |                                               |
| ---- | --------------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/Account`           |
| REST | `GET /cosmos/auth/v1beta1/accounts/{address}` |

Request `QueryAccountRequest`:

| Field     | Type     | Description                                                                |
| --------- | -------- | -------------------------------------------------------------------------- |
| `address` | `string` | address defines the address to query for. Encoded as cosmos.AddressString. |

Response `QueryAccountResponse`:

| Field     | Type  | Description                                                                                           |
| --------- | ----- | ----------------------------------------------------------------------------------------------------- |
| `account` | `Any` | account defines the account of the corresponding address. One of: `/cosmos.auth.v1beta1.BaseAccount`. |

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

### AccountAddressByID

AccountAddressByID returns account address based on account number.

|      |                                                      |
| ---- | ---------------------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/AccountAddressByID`       |
| REST | `GET /cosmos/auth/v1beta1/address_by_id/{accountId}` |

Request `QueryAccountAddressByIDRequest`:

| Field        | Type     | Description                                                                                                                                                                                                                                   |
| ------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`         | `int64`  | Deprecated, use account\_id instead id is the account number of the address to be queried. This field should have been an uint64 (like all account numbers), and will be updated to uint64 in a future version of the auth query. Deprecated. |
| `account_id` | `uint64` | account\_id is the account number of the address to be queried.                                                                                                                                                                               |

Response `QueryAccountAddressByIDResponse`:

| Field             | Type     | Description                      |
| ----------------- | -------- | -------------------------------- |
| `account_address` | `string` | Encoded as cosmos.AddressString. |

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

### AccountInfo

AccountInfo queries account info which is common to all account types.

|      |                                                   |
| ---- | ------------------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/AccountInfo`           |
| REST | `GET /cosmos/auth/v1beta1/account_info/{address}` |

Request `QueryAccountInfoRequest`:

| Field     | Type     | Description                                                             |
| --------- | -------- | ----------------------------------------------------------------------- |
| `address` | `string` | address is the account address string. Encoded as cosmos.AddressString. |

Response `QueryAccountInfoResponse`:

| Field  | Type                                              | Description                                                   |
| ------ | ------------------------------------------------- | ------------------------------------------------------------- |
| `info` | [`BaseAccount`](#cosmos-auth-v1beta1-baseaccount) | info is the account info which is represented by BaseAccount. |

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

### Accounts

Accounts returns all the existing accounts.

When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set.

|      |                                      |
| ---- | ------------------------------------ |
| gRPC | `cosmos.auth.v1beta1.Query/Accounts` |
| REST | `GET /cosmos/auth/v1beta1/accounts`  |

Request `QueryAccountsRequest`:

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

Response `QueryAccountsResponse`:

| Field        | Type                                                      | Description                                                                    |
| ------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `accounts`   | `Any`\[]                                                  | accounts are the existing accounts One of: `/cosmos.auth.v1beta1.BaseAccount`. |
| `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.auth.v1beta1.Query/Accounts
```

### AddressBytesToString

AddressBytesToString converts Account Address bytes to string

|      |                                                  |
| ---- | ------------------------------------------------ |
| gRPC | `cosmos.auth.v1beta1.Query/AddressBytesToString` |
| REST | `GET /cosmos/auth/v1beta1/bech32/{addressBytes}` |

Request `AddressBytesToStringRequest`:

| Field           | Type    | Description |
| --------------- | ------- | ----------- |
| `address_bytes` | `bytes` |             |

Response `AddressBytesToStringResponse`:

| Field            | Type     | Description |
| ---------------- | -------- | ----------- |
| `address_string` | `string` |             |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"address_bytes":""}' \
  localhost:9090 cosmos.auth.v1beta1.Query/AddressBytesToString
```

### AddressStringToBytes

AddressStringToBytes converts Address string to bytes

|      |                                                   |
| ---- | ------------------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/AddressStringToBytes`  |
| REST | `GET /cosmos/auth/v1beta1/bech32/{addressString}` |

Request `AddressStringToBytesRequest`:

| Field            | Type     | Description |
| ---------------- | -------- | ----------- |
| `address_string` | `string` |             |

Response `AddressStringToBytesResponse`:

| Field           | Type    | Description |
| --------------- | ------- | ----------- |
| `address_bytes` | `bytes` |             |

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

### Bech32Prefix

Bech32Prefix queries bech32Prefix

|      |                                          |
| ---- | ---------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/Bech32Prefix` |
| REST | `GET /cosmos/auth/v1beta1/bech32`        |

Request `Bech32PrefixRequest`:

This message has no fields.

Response `Bech32PrefixResponse`:

| Field           | Type     | Description |
| --------------- | -------- | ----------- |
| `bech32_prefix` | `string` |             |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext localhost:9090 cosmos.auth.v1beta1.Query/Bech32Prefix
```

### ModuleAccountByName

ModuleAccountByName returns the module account info by module name

|      |                                                   |
| ---- | ------------------------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/ModuleAccountByName`   |
| REST | `GET /cosmos/auth/v1beta1/module_accounts/{name}` |

Request `QueryModuleAccountByNameRequest`:

| Field  | Type     | Description |
| ------ | -------- | ----------- |
| `name` | `string` |             |

Response `QueryModuleAccountByNameResponse`:

| Field     | Type  | Description                                   |
| --------- | ----- | --------------------------------------------- |
| `account` | `Any` | One of: `/cosmos.auth.v1beta1.ModuleAccount`. |

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

### ModuleAccounts

ModuleAccounts returns all the existing module accounts.

|      |                                            |
| ---- | ------------------------------------------ |
| gRPC | `cosmos.auth.v1beta1.Query/ModuleAccounts` |
| REST | `GET /cosmos/auth/v1beta1/module_accounts` |

Request `QueryModuleAccountsRequest`:

This message has no fields.

Response `QueryModuleAccountsResponse`:

| Field      | Type     | Description                                   |
| ---------- | -------- | --------------------------------------------- |
| `accounts` | `Any`\[] | One of: `/cosmos.auth.v1beta1.ModuleAccount`. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext localhost:9090 cosmos.auth.v1beta1.Query/ModuleAccounts
```

### Params

Params queries all parameters.

|      |                                    |
| ---- | ---------------------------------- |
| gRPC | `cosmos.auth.v1beta1.Query/Params` |
| REST | `GET /cosmos/auth/v1beta1/params`  |

Request `QueryParamsRequest`:

This message has no fields.

Response `QueryParamsResponse`:

| Field    | Type                                    | Description                                  |
| -------- | --------------------------------------- | -------------------------------------------- |
| `params` | [`Params`](#cosmos-auth-v1beta1-params) | params defines the parameters of the module. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext localhost:9090 cosmos.auth.v1beta1.Query/Params
```

## Transaction messages

These messages are included in signed transactions, not called as endpoints. See [Transactions](/sdk/next/learn/concepts/transactions#transactions) for the execution model, and [Sending transactions](/sdk/next/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/next/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

### UpdateParams

UpdateParams defines a (governance) operation for updating the x/auth module parameters. The authority defaults to the x/gov module account.

|            |                                        |
| ---------- | -------------------------------------- |
| Type URL   | `/cosmos.auth.v1beta1.MsgUpdateParams` |
| Handler    | `cosmos.auth.v1beta1.Msg/UpdateParams` |
| Signer     | `authority`                            |
| Amino name | `cosmos-sdk/x/auth/MsgUpdateParams`    |

<Note>The signer is the governance module account, which no user holds a key for. This message executes only through a passed governance proposal, not as a transaction you submit directly.</Note>

| Field       | Type                                    | Description                                                                                                                |
| ----------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `authority` | `string`                                | authority is the address that controls the module (defaults to x/gov unless overwritten). Encoded as cosmos.AddressString. |
| `params`    | [`Params`](#cosmos-auth-v1beta1-params) | params defines the x/auth parameters to update. NOTE: All parameters must be supplied.                                     |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.auth.v1beta1.MsgUpdateParams",
  "authority": "<string>",
  "params": {
    "max_memo_characters": "1",
    "tx_sig_limit": "1",
    "tx_size_cost_per_byte": "1",
    "sig_verify_cost_ed25519": "1",
    "sig_verify_cost_secp256k1": "1",
    "sig_verify_cost_mldsa65": "1"
  }
}
```

Response `MsgUpdateParamsResponse`:

This message has no fields.

## 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.auth.v1beta1.BaseAccount

BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).

| Field            | Type     | Description                      |
| ---------------- | -------- | -------------------------------- |
| `address`        | `string` | Encoded as cosmos.AddressString. |
| `pub_key`        | `Any`    |                                  |
| `account_number` | `uint64` |                                  |
| `sequence`       | `uint64` |                                  |

### cosmos.auth.v1beta1.Params

Params defines the parameters for the auth module.

| Field                       | Type     | Description |
| --------------------------- | -------- | ----------- |
| `max_memo_characters`       | `uint64` |             |
| `tx_sig_limit`              | `uint64` |             |
| `tx_size_cost_per_byte`     | `uint64` |             |
| `sig_verify_cost_ed25519`   | `uint64` |             |
| `sig_verify_cost_secp256k1` | `uint64` |             |
| `sig_verify_cost_mldsa65`   | `uint64` |             |

### 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                             |
