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

# Signature.toLegacy

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

Converts a [`Signature.Signature`](/docs/utilities/signature/types#signature) into a [`Signature.Legacy`](/docs/utilities/signature/types#legacy).

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Signature } from 'viem/utils'

const legacy = Signature.toLegacy({
  r: '0x01',
  s: '0x02',
  yParity: 1
})
// @log: { r: '0x01', s: '0x02', v: 28 }
```

## Definition

```ts
function toLegacy(
  signature: Signature,
): Legacy
```

## Parameters

### signature

* **Type:** `Signature`

The [`Signature.Signature`](/docs/utilities/signature/types#signature) to convert.

#### signature.r

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

#### signature.s

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

#### signature.yParity

* **Type:** `numberType`
* **Optional**

## Return Type

The converted [`Signature.Legacy`](/docs/utilities/signature/types#legacy).

[`Signature.Legacy`](/docs/utilities/signature/types#signaturelegacy)
