# @arcblock/did-util

> Helper function to calculate did

Latest version **1.30.24** (published 2026-05-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @arcblock/did-util
pnpm add @arcblock/did-util
yarn add @arcblock/did-util
bun add @arcblock/did-util
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.30.24 |
| Published | 2026-05-14 |
| First published | 2019-04-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 25.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a, gxw |
| Keywords | did |

## Links

- npm: https://www.npmjs.com/package/@arcblock/did-util
- Repository: https://github.com/ArcBlock/blockchain.git#master
- Homepage: https://github.com/ArcBlock/blockchain/tree/master/did/did-util
- Issues: https://github.com/ArcBlock/blockchain/issues
- npm.io page: https://npm.io/package/@arcblock/did-util

## Dependencies (7)

- [@ocap/util](https://npm.io/package/@ocap/util.md) 1.30.24
- [@ocap/proto](https://npm.io/package/@ocap/proto.md) 1.30.24
- [@ocap/types](https://npm.io/package/@ocap/types.md) 1.30.24
- [@ocap/wallet](https://npm.io/package/@ocap/wallet.md) 1.30.24
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) 1.30.24
- [@ocap/mcrypto](https://npm.io/package/@ocap/mcrypto.md) 1.30.24
- [@ocap/message](https://npm.io/package/@ocap/message.md) 1.30.24

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

- 1.30.24 (latest) — 2026-05-14
- 1.30.23 — 2026-05-13
- 1.30.22 — 2026-05-13
- 1.30.21 — 2026-05-12
- 1.30.20 — 2026-05-12
- 1.30.19 — 2026-05-12
- 1.30.18 — 2026-05-11
- 1.30.17 — 2026-05-11
- 1.30.16 — 2026-05-10
- 1.30.15 — 2026-05-08
- 1.30.14 — 2026-05-08
- 1.30.13 — 2026-05-08
- 1.30.12 — 2026-05-05
- 1.30.11 — 2026-05-03
- 1.30.10 — 2026-04-22
- … 716 more at https://npm.io/package/@arcblock/did-util/versions

## README

![did-util](https://www.arcblock.io/.netlify/functions/badge/?text=did-util)

[![docs](https://img.shields.io/badge/powered%20by-arcblock-green.svg)](https://docs.arcblock.io)
[![Gitter](https://badges.gitter.im/ArcBlock/community.svg)](https://gitter.im/ArcBlock/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

> Helper functions to calculate did

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Documentation](#documentation)
- [Contributors](#contributors)

## Install

```sh
npm install @arcblock/did-util
// or
bun install @arcblock/did-util
```

## Usage

```js
const { types } = require('@ocap/mcrypto');
const { Authenticator, Handlers } = require('@arcblock/did-util');
const { fromSecretKey, WalletType } = require('@ocap/wallet');

const type = WalletType({
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
});

const wallet = fromSecretKey(process.env.APP_SK, type).toJSON();

module.exports = new Authenticator({
  wallet,
  baseUrl: 'http://wangshijun.natapp1.cc',
  appInfo: {
    chainHost: 'http://did-workshop.arcblock.co:8210/api',
    chainId: 'forge',
    chainToken: 'TBA',
    copyright: 'https://example-application/copyright',
    decimals: 16,
    description: 'Starter projects to develop web application on forge',
    icon: '/images/logo@2x.png',
    name: 'Forge Web Starter',
    path: 'https://arcwallet.io/i/',
    publisher: `did:abt:${wallet.address}`,
    subtitle: 'Starter projects to develop web application on forge',
  },
});
```

## Documentation

For full documentation, checkout [https://asset-chain.netlify.com](https://asset-chain.netlify.com/)

## Contributors

| Name           | Website                         |
| -------------- | ------------------------------- |
| **wangshijun** | <https://github.com/wangshijun> |

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