TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

ION Proof of Work

CI codecov NPM Version


The ION Proof of Work client allows to submit ION create, update and delete requests to an ION node which is using a challenge response system.

The IonPoW object will get the challenge from an IoN node, solve the challenge, and submit the request for you.

It can be used with @decentralized-identity/ION-SDK and Veramo's DID ION Provider

This project is based on ion-pow-sdk, but refactored, using Typescript and tested.

import {IonPoW} from '@sphereon/ion-pow'

const request =

// If params are not provided it will default to Microsoft's ION endpoints
const ionPoW = new IonPoW({
    challengeEnabled: true,
    challengeEndpoint: 'https://ion-node/api/v1.0/proof-of-work-challenge',
    solutionEndpoint: 'https://ion-node/api/v1.0/operations'
const result = await ionPow.submit(request)

Using Challenge / Response

The Challange Response is mostly used by Microsoft's ION node(s). If you are dealing with another ION node, you can disable the challenge/response by providing setting the challengeEnabled to false.

Enable debug logging

This package uses the debug NPM package. See it's documentation on how to enable debugging.

The short version is to add an environment variable called DEBUG with value sphereon:ion:*

React Native support

Next to NodeJS and Browser support, this package also works with react-native. You do need to install the following package using your package manager. This has to do with auto-linking not being available for transitive dependencies. We need some native Argon2 Android/IOS modules on React Native because WASM isn't available. As such you will have to install the dependency directly into your app. See https://github.com/react-native-community/cli/issues/870

npm: npm install @sphereon/react-native-argon2

yarn: yarn add @sphereon/react-native-argon2

Install NPM package

npm: npm install @sphereon/ion-pow

yarn: yarn add @sphereon/ion-pow


npm: npm build

yarn: yarn build


The test command runs:

  • eslint
  • prettier
  • unit
  • coverage

You can also run only a single section of these tests, using for example yarn test:unit.

yarn test

Utility scripts

There are several other utility scripts that help with development.

  • yarn fix - runs eslint --fix as well as prettier to fix code style.
  • yarn cov - generates code coverage report.



npm i @sphereon/ion-pow

DownloadsWeekly Downloads






Unpacked Size

39.2 kB

Total Files


Last publish


  • nklomp78
  • nklomp
  • spostma
  • bramtencate