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

# primitives/SignedData

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / primitives/SignedData

# primitives/SignedData

## Classes

### InvalidSignedDataFormatError

Defined in: [src/primitives/SignedData/errors.ts:17](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L17)

Error thrown when signed data has invalid format

#### Extends

* `Error`

#### Constructors

##### Constructor

> **new InvalidSignedDataFormatError**(`message`, `context?`): [`InvalidSignedDataFormatError`](#invalidsigneddataformaterror)

Defined in: [src/primitives/SignedData/errors.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L18)

###### Parameters

###### message

`string`

###### context?

`unknown`

###### Returns

[`InvalidSignedDataFormatError`](#invalidsigneddataformaterror)

###### Overrides

`Error.constructor`

#### Properties

##### context?

> `optional` **context**: `unknown`

Defined in: [src/primitives/SignedData/errors.ts:24](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L24)

***

### InvalidSignedDataVersionError

Defined in: [src/primitives/SignedData/errors.ts:4](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L4)

Error thrown when signed data has invalid version byte

#### Extends

* `Error`

#### Constructors

##### Constructor

> **new InvalidSignedDataVersionError**(`message`, `context?`): [`InvalidSignedDataVersionError`](#invalidsigneddataversionerror)

Defined in: [src/primitives/SignedData/errors.ts:5](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L5)

###### Parameters

###### message

`string`

###### context?

`unknown`

###### Returns

[`InvalidSignedDataVersionError`](#invalidsigneddataversionerror)

###### Overrides

`Error.constructor`

#### Properties

##### context?

> `optional` **context**: `unknown`

Defined in: [src/primitives/SignedData/errors.ts:11](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L11)

***

### SignatureVerificationError

Defined in: [src/primitives/SignedData/errors.ts:30](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L30)

Error thrown when signature verification fails

#### Extends

* `Error`

#### Constructors

##### Constructor

> **new SignatureVerificationError**(`message`, `context?`): [`SignatureVerificationError`](#signatureverificationerror)

Defined in: [src/primitives/SignedData/errors.ts:31](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L31)

###### Parameters

###### message

`string`

###### context?

`unknown`

###### Returns

[`SignatureVerificationError`](#signatureverificationerror)

###### Overrides

`Error.constructor`

#### Properties

##### context?

> `optional` **context**: `unknown`

Defined in: [src/primitives/SignedData/errors.ts:37](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/errors.ts#L37)

## Type Aliases

### SignedDataType

> **SignedDataType** = `Uint8Array` & `object`

Defined in: [src/primitives/SignedData/SignedDataType.ts:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/SignedDataType.ts#L12)

EIP-191 signed data type

Represents signed data according to EIP-191 specification.
The version byte determines the signature format:

* 0x00: Data with validator address
* 0x01: Structured data (EIP-712)
* 0x45: Personal message ("E" for Ethereum Signed Message)

#### Type Declaration

##### \_\_tag

> `readonly` **\_\_tag**: `"SignedData"`

#### See

[https://eips.ethereum.org/EIPS/eip-191](https://eips.ethereum.org/EIPS/eip-191)

***

### SignedDataVersion

> **SignedDataVersion** = `0` | `1` | `69`

Defined in: [src/primitives/SignedData/SignedDataType.ts:24](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/SignedDataType.ts#L24)

EIP-191 version byte

Determines the format and validation rules for signed data:

* 0x00: Data with intended validator (contract address)
* 0x01: Structured data following EIP-712
* 0x45: Personal message with "\x19Ethereum Signed Message:\n" prefix

## Variables

### EIP191\_PREFIX

> `const` **EIP191\_PREFIX**: `25` = `0x19`

Defined in: [src/primitives/SignedData/constants.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/constants.js#L15)

EIP-191 prefix byte

***

### PERSONAL\_MESSAGE\_PREFIX

> `const` **PERSONAL\_MESSAGE\_PREFIX**: "\u0019Ethereum Signed Message:\n" = `"\x19Ethereum Signed Message:\n"`

Defined in: [src/primitives/SignedData/constants.js:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/constants.js#L18)

Personal message prefix string

***

### VERSION\_DATA\_WITH\_VALIDATOR

> `const` **VERSION\_DATA\_WITH\_VALIDATOR**: `0` = `0x00`

Defined in: [src/primitives/SignedData/constants.js:6](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/constants.js#L6)

Version 0x00: Data with validator

***

### VERSION\_PERSONAL\_MESSAGE

> `const` **VERSION\_PERSONAL\_MESSAGE**: `69` = `0x45`

Defined in: [src/primitives/SignedData/constants.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/constants.js#L12)

Version 0x45: Personal message

***

### VERSION\_STRUCTURED\_DATA

> `const` **VERSION\_STRUCTURED\_DATA**: `1` = `0x01`

Defined in: [src/primitives/SignedData/constants.js:9](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/constants.js#L9)

Version 0x01: Structured data (EIP-712)

## Functions

### from()

> **from**(`version`, `versionData`, `data`): [`SignedDataType`](#signeddatatype)

Defined in: [src/primitives/SignedData/from.js:35](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/from.js#L35)

Create EIP-191 signed data from components

Format: `0x19 <version byte> <version specific data>`

* Version 0x00: `0x19 0x00 <validator address (20 bytes)> <data>`
* Version 0x01: `0x19 0x01 <domainSeparator (32 bytes)> <data>`
* Version 0x45: `0x19 0x45 <ascii "thereum Signed Message:\n" + len> <data>`

#### Parameters

##### version

`number`

Version byte (0x00, 0x01, or 0x45)

##### versionData

`Uint8Array`\<`ArrayBufferLike`>

Version-specific data (validator address or domain separator)

##### data

`Uint8Array`\<`ArrayBufferLike`>

Message data

#### Returns

[`SignedDataType`](#signeddatatype)

EIP-191 formatted signed data

#### Throws

If version is not valid

#### Example

```javascript theme={null}
import { from } from './primitives/SignedData/from.js';

// Personal message (0x45)
const signedData = from(0x45, new Uint8Array(), message);

// Data with validator (0x00)
const signedData = from(0x00, validatorAddress, data);
```

***

### Hash()

> **Hash**(`deps`): (`message`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/primitives/SignedData/hash.js:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/hash.js#L10)

Factory: Create EIP-191 personal message hash function

#### Parameters

##### deps

Crypto dependencies

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

#### Returns

> (`message`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### Parameters

###### message

`string` | `Uint8Array`\<`ArrayBufferLike`>

##### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

***

### Verify()

> **Verify**(`deps`): (`message`, `signature`, `expectedAddress`) => `boolean`

Defined in: [src/primitives/SignedData/verify.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/SignedData/verify.js#L12)

Factory: Create signature verification function for EIP-191 personal messages

#### Parameters

##### deps

Crypto dependencies

###### addressFromPublicKey

(`x`, `y`) => [`AddressType`](Address.mdx#addresstype)

Address derivation from public key

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### recoverPublicKey

(`signature`, `messageHash`) => `Uint8Array`

secp256k1 public key recovery

#### Returns

> (`message`, `signature`, `expectedAddress`): `boolean`

##### Parameters

###### message

`string` | `Uint8Array`\<`ArrayBufferLike`>

###### signature

###### r

`Uint8Array`

###### s

`Uint8Array`

###### v

`number`

###### expectedAddress

[`AddressType`](Address.mdx#addresstype)

##### Returns

`boolean`
