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

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

Converts a [`Signature.Signature`](/docs/utilities/signature/types#signature) to DER-encoded format.

## Imports

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

## Examples

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

const signature = Signature.from({
  r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
  s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8'
})

const signature_der = Signature.toDerBytes(signature)
// @log: Uint8Array [132, 51, 23, ...]
```

## Definition

```ts
function toDerBytes(
  signature: Signature<boolean>,
): Bytes.Bytes
```

## Parameters

### signature

* **Type:** `Signature<boolean>`

The signature to convert.

#### signature.r

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

#### signature.s

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

#### signature.yParity

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

## Return Type

The DER-encoded signature.

`Bytes.Bytes`
