# @ethersphere/core-sdk

> Framework-agnostic TypeScript primitives for the Swarm decentralised storage network

Latest version **0.1.1** (published 2026-08-18) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @ethersphere/core-sdk
pnpm add @ethersphere/core-sdk
yarn add @ethersphere/core-sdk
bun add @ethersphere/core-sdk
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-08-18 |
| First published | 2026-08-18 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 2 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | ethersphereowner, ethswarm-devops |

## Links

- npm: https://www.npmjs.com/package/@ethersphere/core-sdk
- Repository: https://github.com/ethersphere/core-sdk
- Issues: https://github.com/ethersphere/core-sdk/issues/
- npm.io page: https://npm.io/package/@ethersphere/core-sdk

## Dependencies (2)

- [@noble/curves](https://npm.io/package/@noble/curves.md) ^1.9.7
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^1.8.0

## Recent versions

- 0.1.1 (latest) — 2026-08-18
- 0.0.1 — 2026-08-18

## README

# Swarm Core

Framework-agnostic TypeScript primitives for the [Swarm](https://www.ethswarm.org/) decentralised storage network: typed byte wrappers, content-addressed and single-owner chunks, the Mantaray manifest trie, Reed-Solomon erasure coding, encryption, and postage stamp signing.

No network I/O — this library only builds and parses Swarm's on-disk/on-wire data structures. Talking to a Bee node is left to the consumer (e.g. [bee-js](https://github.com/ethersphere/bee-js)).

## Install

```sh
npm install @ethersphere/core-sdk
```

Ships as both ESM and CommonJS, with full TypeScript types. Import from the subpath you need:

```ts
import { Bytes, Reference } from '@ethersphere/core-sdk/bytes'
import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk'
```

## Quick example

```ts
import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk'

const chunk = makeContentAddressedChunk('Hello, Swarm!')
console.log(chunk.address.toHex())
```

## What's included

| Subpath | Contents |
|---|---|
| `@ethersphere/core-sdk/bytes` | `Bytes` and typed wrappers (`Reference`, `BatchId`, `EthAddress`, `PrivateKey`, `PublicKey`, `Signature`, `Span`, `Topic`, `Identifier`, `FeedIndex`, `PeerAddress`, `TransactionId`) plus low-level encoding helpers (hex/base32/base64, concat, slice, integer packing) |
| `@ethersphere/core-sdk/crypto` | Keccak-256, ECDSA sign/recover/verify, public/private key derivation |
| `@ethersphere/core-sdk/chunk` | Content Addressed Chunks (CAC), Single Owner Chunks (SOC/SOC replicas), the BMT chunk hash, and `ChunkSplitter`/`ChunkJoiner` for building and reconstructing chunk trees |
| `@ethersphere/core-sdk/mantaray` | `MantarayNode` — the manifest trie used for directory/collection uploads |
| `@ethersphere/core-sdk/erasure-coding` | Reed-Solomon parity, redundancy-level tables, and the batching logic used to add parity chunks to a stream |
| `@ethersphere/core-sdk/encryption` | Chunk-level stream cipher and XOR helpers |
| `@ethersphere/core-sdk/stamper` | Postage stamp signing (`Stamper`, `stamp()`) and effective-capacity math |

Every subpath is also re-exported from the package root (`@ethersphere/core-sdk`), so `import { Bytes } from '@ethersphere/core-sdk'` works too.

## Development

```sh
pnpm install
pnpm test          # vitest
pnpm typecheck
pnpm format:check
pnpm build          # esbuild (ESM + CJS) + tsc (.d.ts)
pnpm bench          # perf-sensitive functions, checked against a stored baseline
```

Requires Node.js 22+.

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