# @aztec/kv-store

> The Aztec KV store is an implementation of a durable key-value database with a pluggable backend.

Latest version **5.2.0** (published 2026-08-17) · 0 weekly downloads

## Install

```sh
npm install @aztec/kv-store
pnpm add @aztec/kv-store
yarn add @aztec/kv-store
bun add @aztec/kv-store
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.2.0 |
| Published | 2026-08-17 |
| First published | 2024-02-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.10 |
| Dependencies | 11 |
| Unpacked size | 632.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zac-williamson, leilawang, charlielye, jaosef, joss-aztecprotocol, ludamad |

## Links

- npm: https://www.npmjs.com/package/@aztec/kv-store
- npm.io page: https://npm.io/package/@aztec/kv-store

## Dependencies (11)

- [idb](https://npm.io/package/idb.md) ^8.0.0
- [lmdb](https://npm.io/package/lmdb.md) ^3.2.0
- [ohash](https://npm.io/package/ohash.md) ^2.0.11
- [msgpackr](https://npm.io/package/msgpackr.md) ^1.11.2
- [@aztec/native](https://npm.io/package/@aztec/native.md) 5.2.0
- [@aztec/stdlib](https://npm.io/package/@aztec/stdlib.md) 5.2.0
- [ordered-binary](https://npm.io/package/ordered-binary.md) ^1.5.3
- [@aztec/ethereum](https://npm.io/package/@aztec/ethereum.md) 5.2.0
- [@aztec/constants](https://npm.io/package/@aztec/constants.md) 5.2.0
- [@aztec/foundation](https://npm.io/package/@aztec/foundation.md) 5.2.0
- [@aztec/sqlite3mc-wasm](https://npm.io/package/@aztec/sqlite3mc-wasm.md) 5.2.0

## Recent versions

- 5.2.0 (latest) — 2026-08-17
- 5.3.0-nightly.20260919 (prerelease) — 2026-09-19
- 0.0.1-dev (dev) — 2026-06-26
- 4.4.0-nightly.20260618 (nightly) — 2026-06-18
- 4.3.0-rc.1 (rc) — 2026-05-15
- 0.0.1-commit.fff30aa (commit) — 2026-04-17
- 4.0.0-devnet.4-patch.0 (devnet) — 2026-04-06
- 4.2.0-aztecnr-rc.2 (aztecnr-rc) — 2026-03-26
- 5.0.0-private.20260319 (private) — 2026-03-19
- 5.0.0-patched.20260318 (patched) — 2026-03-18
- 4.0.0-spartan.20260218 (spartan) — 2026-02-18
- 2.0.3-zkpassport (zkpassport) — 2025-12-03
- 3.0.0-manual.20251030 (manual) — 2025-10-30
- 0.0.1-fake-ceab37513c (fake-ceab37513c) — 2025-10-30
- 0.0.1-fake-c83136db25 (fake-c83136db25) — 2025-10-30
- … 1239 more at https://npm.io/package/@aztec/kv-store/versions

## README

# KV Store

The Aztec KV store is an implementation of a durable key-value database with a pluggable backend.

This package exports a number of primitive data structures that can be used to build domain-specific databases in each node component (e.g. a PXE database or an Archiver database). The data structures supported:

- singleton - holds a single value. Great for when a value needs to be stored but it's not a collection (e.g. the latest block header or the length of an array)
- array - works like a normal in-memory JS array. It can't contain holes and it can be used as a stack (push-pop mechanics).
- map - a hashmap where keys can be numbers or strings
- multi-map - just like a map but each key holds multiple values. Can be used for indexing into other data structures

## Backend selection

The backend is selected at import time, you import `createStore` (and friends) from the entrypoint you want:

- `@aztec/kv-store/lmdb-v2`: server / Node. The current default for node components.
- `@aztec/kv-store/lmdb`: the legacy LMDB backend, backed by [`lmdb-js`](https://github.com/kriszyp/lmdb-js).
- `@aztec/kv-store/sqlite-opfs`: the recommended browser backend, encryption-at-rest capable, backed by SQLite over the Origin Private File System (OPFS).
- `@aztec/kv-store/deprecated/indexeddb`: **deprecated** browser backend, backed by IndexedDB. New browser code must use `@aztec/kv-store/sqlite-opfs`, as this backend is on its way to being fully deprecated.

---
_Source: https://npm.io/package/@aztec/kv-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
