> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Address.fromPublicKey

:::info
`Address.fromPublicKey` is a re-export of ox's [`Address.fromPublicKey`](https://oxlib.sh/api/Address/fromPublicKey). Refer to the ox documentation for the full reference.
:::

Converts an ECDSA public key to an [`Address.Address`](/docs/utilities/address/types#address).

## Imports

```ts
import { Address } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Address, PublicKey } from 'viem/utils'

const publicKey = PublicKey.from(
  '0x048318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5'
)
const address = Address.fromPublicKey(publicKey)
// @log: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
```

## Definition

```ts
function fromPublicKey(
  publicKey: PublicKey.PublicKey,
  options?: fromPublicKey.Options,
): Address
```

## Parameters

### publicKey

* **Type:** `PublicKey.PublicKey`

The ECDSA public key to convert to an [`Address.Address`](/docs/utilities/address/types#address).

#### publicKey.prefix

* **Type:** `numberType`

#### publicKey.x

* **Type:** `0x${string}`

#### publicKey.y

* **Type:** `0x${string}`

### options

* **Type:** `fromPublicKey.Options`
* **Optional**

Conversion options.

#### options.checksum

* **Type:** `boolean`
* **Optional**

Whether to checksum the address.

## Return Type

The [`Address.Address`](/docs/utilities/address/types#address) corresponding to the public key.

`Address`
