# TxEnvelopeEip4844.hash

Hashes a [`TxEnvelopeEip4844.TxEnvelopeEip4844`](/api/TxEnvelopeEip4844/types#txenvelopeeip4844). This is the "transaction hash".

## Imports

:::code-group
```ts [Named]
import { TxEnvelopeEip4844 } from 'ox'
```

```ts [Entrypoint]
import * as TxEnvelopeEip4844 from 'ox/TxEnvelopeEip4844'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Blobs, TxEnvelopeEip4844 } from 'ox'
import { kzg } from './kzg'

const blobs = Blobs.from('0xdeadbeef')
const blobVersionedHashes = Blobs.toVersionedHashes(blobs, {
  kzg
})

const envelope = TxEnvelopeEip4844.from({
  blobVersionedHashes,
  chainId: 1,
  nonce: 0n,
  maxFeePerGas: 1000000000n,
  gas: 21000n,
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: 1000000000000000000n
})

const hash = TxEnvelopeEip4844.hash(envelope) // [!code focus]
```

## Definition

```ts
function hash<presign>(
  envelope: TxEnvelopeEip4844<presign extends true ? false : true>,
  options?: hash.Options<presign>,
): hash.ReturnType
```

**Source:** [src/core/TxEnvelopeEip4844.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelopeEip4844.ts#L889)

## Parameters

### envelope

* **Type:** `TxEnvelopeEip4844<presign extends true ? false : true>`

The EIP-4844 Transaction Envelope to hash.

#### envelope.accessList

* **Type:** `readonly { address: abitype_Address; storageKeys: readonly 0x${string}[]; }[]`
* **Optional**

EIP-2930 Access List.

#### envelope.blobVersionedHashes

* **Type:** `readonly 0x${string}[]`

Versioned hashes of blobs to be included in the transaction.

#### envelope.chainId

* **Type:** `numberType`

EIP-155 Chain ID.

#### envelope.data

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

Contract code or a hashed method call with encoded args

#### envelope.from

* **Type:** `Address.Address | undefined`
* **Optional**

Sender of the transaction. RPC-only metadata; not part of the
serialized envelope. Carried here for parity with
[`TransactionRequest.TransactionRequest`](/api/TransactionRequest/types#transactionrequest) and
[`Transaction.Transaction`](/api/Transaction/types#transaction).

#### envelope.gas

* **Type:** `bigintType`
* **Optional**

Gas provided for transaction execution

#### envelope.input

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

#### envelope.maxFeePerBlobGas

* **Type:** `bigintType`
* **Optional**

Maximum total fee per gas sender is willing to pay for blob gas (in wei).

#### envelope.maxFeePerGas

* **Type:** `bigintType`
* **Optional**

Total fee per gas in wei (gasPrice/baseFeePerGas + maxPriorityFeePerGas).

#### envelope.maxPriorityFeePerGas

* **Type:** `bigintType`
* **Optional**

Max priority fee per gas (in wei).

#### envelope.nonce

* **Type:** `bigintType`
* **Optional**

Unique number identifying this transaction

#### envelope.r

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

#### envelope.s

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

#### envelope.sidecars

* **Type:** `Sidecars`
* **Optional**

PeerDAS (EIP-7594) sidecars associated with this transaction. When
defined, the envelope serializes into the 5-element "PooledTransactions"
network wrapper (`rlp([tx_body, wrapper_version, blobs, commitments,
cell_proofs])`).

#### envelope.to

* **Type:** `Address.Address | null | undefined`
* **Optional**

Transaction recipient

#### envelope.type

* **Type:** `type`

Transaction type

#### envelope.v

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

#### envelope.value

* **Type:** `bigintType`
* **Optional**

Value in wei sent with this transaction

#### envelope.yParity

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

ECDSA signature yParity.

### options

* **Type:** `hash.Options<presign>`
* **Optional**

Options.

#### options.presign

* **Type:** `boolean | presign`
* **Optional**

Whether to hash this transaction for signing.

## Return Type

The hash of the transaction envelope.

`hash.ReturnType`
