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

# Blob.isValid

> Check if data is valid blob (exactly 131,072 bytes)

<Card title="Try it Live" icon="play" href="https://playground.tevm.sh?example=primitives/blob.ts">
  Run Blob examples in the interactive playground
</Card>

<Tabs />

## Usage

### Before Blob Operations

```typescript theme={null}
import { Blob } from 'tevm';

// Validate before expensive operations
if (Blob.isValid(data)) {
  const commitment = Blob.toCommitment(data);
  const proof = Blob.toProof(data);
} else {
  // Encode data into blob format
  const blob = Blob.fromData(data);
}
```

### Type Guard Pattern

```typescript theme={null}
import { Blob, type BrandedBlob } from 'tevm';

function assertBlob(value: Uint8Array): asserts value is BrandedBlob {
  if (!Blob.isValid(value)) {
    throw new Error(`Invalid blob size: ${value.length}`);
  }
}

// Usage
const data = new Uint8Array(131072);
assertBlob(data); // Throws if invalid
// data is now typed as BrandedBlob
```

## See Also

* [from](./from) - Constructor with validation
* [isValidVersion](./isValidVersion) - Validate versioned hash
