# @arcblock/did-ext

> Extension to work with ArcBlock DID

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

## Install

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

## 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 | 2020-12-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a, gxw |
| Keywords | arcblock, did, sdk |

## Links

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

## Dependencies (5)

- [@ocap/util](https://npm.io/package/@ocap/util.md) 1.30.24
- [@ocap/wallet](https://npm.io/package/@ocap/wallet.md) 1.30.24
- [@scure/bip32](https://npm.io/package/@scure/bip32.md) ^2.0.1
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) 1.30.24
- [@ocap/mcrypto](https://npm.io/package/@ocap/mcrypto.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
- … 607 more at https://npm.io/package/@arcblock/did-ext/versions

## README

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

[![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)

> Extensions to work with ArcBlock DID

## Usage

```terminal
bun install @arcblock/did-ext
```

```javascript
const { WalletType } = require('@ocap/wallet');
const { fromAppDid } = require('@arcblock/did-ext');

const type = WalletType({ role: types.RoleType.ROLE_ACCOUNT });
const rootSk = '0x07abfceff5cdfb0cd164d2da98099c15b7223fc5a1b8c02c2cf1f74670c72aac27e1d28ed47cf4f2c4330a6e6e1dc0724721e80fa56177fdba926937a253fe7e';
let wallet = fromAppDid('', rootSk, type);
console.log(wallet.toJSON());
wallet = fromAppDid('zNKdqQxDUVz2YkfArfqc1CzjbX2QSNnMk1iW', rootSk, type);
console.log(wallet.toJSON());
```

Will output:

```js
{
  type: {
    role: 'ROLE_ACCOUNT',
    pk: 'ED25519',
    hash: 'SHA3',
    address: 'BASE58'
  },
  sk: '0x2e47d7b4c367c04cd594feac2c2bbe3eefe02723c3be2b682aabef1ec0c2902e9f16f990b2df33928c22b5b49a73eaa0ee52e40735eddd98e16e3c4538546546',
  pk: '0x9f16f990b2df33928c22b5b49a73eaa0ee52e40735eddd98e16e3c4538546546',
  address: 'z1Zhi9h6do1EUNkM63CEXHonyHx47WQKtxB'
}
{
  type: {
    role: 'ROLE_ACCOUNT',
    pk: 'ED25519',
    hash: 'SHA3',
    address: 'BASE58'
  },
  sk: '0x00b16a229aae56a4bc9e4cb2fdf3bfafcb1c81cca57120db9593e8711a9f859a3a0d2a698006ac0f2f62341a1ddb53404adb4e4b17d1a843af9791991fa4c302',
  pk: '0x3a0d2a698006ac0f2f62341a1ddb53404adb4e4b17d1a843af9791991fa4c302',
  address: 'z1m7dNPVzpgMwRSXDtKywWK6tp5mbK57bN5'
}
```

## Documentation

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

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