# @dcl/crypto

> Crypto auth for Decentraland

Latest version **3.7.0** (published 2026-04-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dcl/crypto
pnpm add @dcl/crypto
yarn add @dcl/crypto
bun add @dcl/crypto
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.7.0 |
| Published | 2026-04-23 |
| First published | 2022-05-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 3 |
| Unpacked size | 75.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Decentraland |
| Maintainers | decentralandbot, imazzara |
| Keywords | decentraland, crypto, authentication, ethereum |

## Links

- npm: https://www.npmjs.com/package/@dcl/crypto
- npm.io page: https://npm.io/package/@dcl/crypto

## Dependencies (3)

- [eth-connect](https://npm.io/package/eth-connect.md) ^6.0.3
- [@dcl/schemas](https://npm.io/package/@dcl/schemas.md) ^25.2.0
- [ethereum-cryptography](https://npm.io/package/ethereum-cryptography.md) ^2.0.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 3.7.0 (latest) — 2026-04-23
- 3.7.1-20260423125335.commit-0567687 (next) — 2026-04-23
- 3.6.0 — 2026-04-21
- 3.5.1-20260421194804.commit-073aed0 — 2026-04-21
- 3.5.0 — 2026-03-25
- 3.4.6-20260325221227.commit-aa01b4a — 2026-03-25
- 3.4.5 — 2023-09-04
- 3.4.5-20230904151900.commit-a038f56 — 2023-09-04
- 3.4.5-20230904151645.commit-8e11614 — 2023-09-04
- 3.4.5-20230904151444.commit-1c4f09c — 2023-09-04
- 3.4.4 — 2023-08-15
- 3.4.4-20230815175748.commit-ed3b44b — 2023-08-15
- 3.4.4-20230815175531.commit-0a4e4b4 — 2023-08-15
- 3.4.4-20230815175350.commit-4743360 — 2023-08-15
- 3.4.4-20230725170639.commit-4e9d6d1 — 2023-07-25
- … 82 more at https://npm.io/package/@dcl/crypto/versions

## README

# @dcl/crypto

Crypto auth for Decentraland. Provides `Authenticator` utilities, signature validation, and authentication chain helpers used across Decentraland services and clients.

## Install

```bash
pnpm add @dcl/crypto
```

## Create a new Identity using Ethers

```typescript
import { Authenticator, AuthIdentity } from '@dcl/crypto'
import { Wallet } from '@ethersproject/wallet'
import { Web3Provider, ExternalProvider } from '@ethersproject/providers'

/**
 * @param provider   - any ethereum provider (e.g. window.ethereum)
 * @param expiration - ttl in minutes of the identity
 */
export async function createIdentity(
  provider: ExternalProvider,
  expiration: number
): Promise<AuthIdentity> {
  const signer = new Web3Provider(provider).getSigner()
  const address = await signer.getAddress()

  const wallet = Wallet.createRandom()
  const payload = {
    address: wallet.address,
    privateKey: wallet.privateKey,
    publicKey: wallet.publicKey
  }

  return Authenticator.initializeAuthChain(
    address,
    payload,
    expiration,
    (message) => new Web3Provider(provider).getSigner().signMessage(message)
  )
}
```

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