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

# ENS and WASM

> The Ens module has no WASM entry point; how to use a WASM keccak256 for namehash and labelhash

> [card] [Try it Live](https://playground.tevm.sh?example=primitives/ens.ts)
>
> Run ENS examples in the interactive playground

# ENS and WASM

## Status

The TypeScript Ens module has **no WASM entry point**. There is no `Ens` export from `@tevm/voltaire/wasm`, no `*.wasm.ts` file for Ens, and no Ens function in the WASM loader or the C API.

| Operation | Runs on |
| - | - |
| `normalize`, `beautify`, `isValid`, `validate` | JavaScript, via `@adraffy/ens-normalize` |
| `namehash`, `labelhash` | JavaScript, via `hash` from `@tevm/voltaire/Keccak256` |
| `Namehash`, `Labelhash` factories | Whatever `keccak256` function you inject |
| `from`, `is`, `toString` | Plain JavaScript; no hashing |

The Zig package (`voltaire-zig`) contains an ENS module at `src/primitives/Ens/ens.zig` built on [z-ens-normalize](https://github.com/evmts/z-ens-normalize). It is not exported through `c_api.zig` and is not reachable from TypeScript.

## Using WASM keccak256 for hashing

The `Namehash` and `Labelhash` factories accept any `(data: Uint8Array) => Uint8Array` keccak256 function. `Keccak256Wasm.hash` from `@tevm/voltaire/wasm` matches that signature:

```typescript theme={null}
import { Namehash, Labelhash, normalize } from '@tevm/voltaire/Ens';
import { Keccak256Wasm } from '@tevm/voltaire/wasm';

await Keccak256Wasm.init();

const namehash = Namehash({ keccak256: Keccak256Wasm.hash });
const labelhash = Labelhash({ keccak256: Keccak256Wasm.hash });

const node = namehash(normalize("vitalik.eth"));
// Uint8Array(32): 0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835
const label = labelhash(normalize("vitalik"));
```

`Keccak256Wasm.hash` throws `WASM not initialized. Call Keccak256Wasm.init() first.` if you call it before `init()` resolves. Normalization still runs in JavaScript.

## See Also

* [ENS Overview](https://voltaire.tevm.sh/primitives/ens.md)
* [Encoding](https://voltaire.tevm.sh/primitives/ens/encoding.md) - `Namehash` and `Labelhash` factories
* [Keccak256 Implementations](https://voltaire.tevm.sh/crypto/keccak256/implementations.md) - JS, WASM, and native keccak256
* [WASM](https://voltaire.tevm.sh/getting-started/wasm.md) - Loading Voltaire's WASM build


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.