# @ucanto/principal

> ucanto principal

Latest version **9.0.3** (published 2025-10-24) · (Apache-2.0 AND MIT) license · 0 weekly downloads

## Install

```sh
npm install @ucanto/principal
pnpm add @ucanto/principal
yarn add @ucanto/principal
bun add @ucanto/principal
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.0.3 |
| Published | 2025-10-24 |
| First published | 2022-09-21 |
| Weekly downloads | 0 |
| License | (Apache-2.0 AND MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 95.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 62 |
| Maintainers | gozala, it-dag-house, hugomrdias |
| Keywords | UCAN, ed25519, did, issuer, audience |

## Links

- npm: https://www.npmjs.com/package/@ucanto/principal
- Repository: https://github.com/storacha/ucanto
- Issues: https://github.com/storacha/ucanto/issues
- npm.io page: https://npm.io/package/@ucanto/principal

## Dependencies (7)

- [multiformats](https://npm.io/package/multiformats.md) ^13.3.1
- [@noble/curves](https://npm.io/package/@noble/curves.md) ^1.2.0
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^1.3.2
- [one-webcrypto](https://npm.io/package/one-webcrypto.md) ^1.0.3
- [@ipld/dag-ucan](https://npm.io/package/@ipld/dag-ucan.md) ^3.4.5
- [@noble/ed25519](https://npm.io/package/@noble/ed25519.md) ^1.7.3
- [@ucanto/interface](https://npm.io/package/@ucanto/interface.md) ^11.0.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 9.0.3 (latest) — 2025-10-24
- 9.0.2 — 2025-01-22
- 9.0.1 — 2024-04-04
- 9.0.0 — 2023-10-05
- 8.1.0 — 2023-09-01
- 8.0.0 — 2023-05-22
- 7.0.0 — 2023-04-11
- 0.7.0 — 2023-04-11
- 5.1.0 — 2023-03-07
- 5.0.2 — 2023-03-03
- 5.0.1 — 2023-03-03
- 5.0.0 — 2023-03-01
- 4.4.0 — 2023-02-28
- 4.3.4 — 2023-02-28
- 4.2.3 — 2023-01-27
- … 11 more at https://npm.io/package/@ucanto/principal/versions

## README

# @ucanto/principal

`@ucanto/principal` provides identity management and cryptographic utilities for UCAN-based authentication and authorization. It enables secure key generation, signing, and verification of UCANs.

## What It Provides
- **Key Management**: Supports cryptographic key generation and handling.
- **UCAN Signing & Verification**: Ensures authenticity and integrity of UCAN tokens.
- **Identity Handling**: Manages decentralized identifiers (DIDs) for secure communication.

## How It Fits with Other Modules
- [`@ucanto/core`](../core/README.md): Uses principal identities for capability execution.
- [`@ucanto/server`](../server/README.md): Relies on identity verification for secure RPC handling.
- [`@ucanto/interface`](../interface/README.md): Defines standard identity-related types.
- [`@ucanto/transport`](../transport/README.md): Ensures encrypted and authenticated communication.

For an overview and detailed usage information, refer to the [main `ucanto` README](../../Readme.md).

## Installation
```sh
npm install @ucanto/principal
```

## Example Usage
```ts
import { ed25519 } from '@ucanto/principal';

const keypair = ed25519.generate();
const signature = keypair.sign(new Uint8Array([1, 2, 3]));
const isValid = keypair.verify(new Uint8Array([1, 2, 3]), signature);
```

For more details, see the [`ucanto` documentation](https://github.com/storacha/ucanto).

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