npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@totemsdk/statechain

v0.1.6

Published

Mercury-protocol state chain for Minima — privacy-preserving off-chain UTXO custody transfer with blind SE co-signatures

Readme

@totemsdk/statechain

Off-chain UTXO ownership transfer using the Mercury protocol.

A statechain lets you transfer ownership of a UTXO to a new owner without an on-chain transaction. A co-signing State Entity (SE) issues a blind signature so the transfer is provably authorized — but the SE never learns the UTXO value or the identities of sender or receiver.

Install

npm install @totemsdk/statechain

What's inside

| Export | What it does | |--------|-------------| | createStateChain(coin, se) | Lock a UTXO into a statechain with a co-signing State Entity | | transferOwnership(chain, newOwner, signer) | Transfer control to a new owner; the SE issues a blind signature | | verifyStateChain(chain) | Verify the full chain of custody from creation to current owner | | claimOwnership(chain, signer) | Cooperatively claim the UTXO on-chain with the SE's signature | | reclaimAbandoned(chain) | Unilateral claim after RECLAIM_TIMELOCK if the SE goes offline | | buildStatechainScript(pubKey) | Construct the KISSVM locking script for the UTXO | | scriptAddress(script) | Derive the Minima address for a statechain script | | RECLAIM_TIMELOCK | Configurable safety window (default: 2016 blocks ≈ 2 weeks) |

Privacy property

The State Entity uses blind signatures — it signs what the new owner presents without seeing the content. The SE knows a transfer happened but learns nothing about the UTXO value or the parties involved.

Usage

Lock a UTXO into a statechain

import { createStateChain } from '@totemsdk/statechain';

const chain = await createStateChain({
  coin,                          // the UTXO to lock
  stateEntityUrl: 'https://se.axia.to',
  ownerPublicKey: myPublicKey,
  signer,
  provider,
});

console.log('Statechain ID:', chain.id);
console.log('Lock script:', chain.script);

Transfer ownership off-chain

import { transferOwnership } from '@totemsdk/statechain';

const updatedChain = await transferOwnership(chain, {
  newOwnerPublicKey: recipientPublicKey,
  signer,
});

// Send updatedChain to the recipient (off-chain, e.g. QR code, message)

Verify the chain of custody

import { verifyStateChain } from '@totemsdk/statechain';

const valid = await verifyStateChain(chain);
console.log('Chain of custody valid:', valid);

Claim the UTXO on-chain

import { claimOwnership } from '@totemsdk/statechain';

const claimHex = await claimOwnership(chain, { signer });
await provider.broadcastTxPoW(claimHex);

Reclaim if State Entity goes offline

import { reclaimAbandoned, RECLAIM_TIMELOCK } from '@totemsdk/statechain';

// After RECLAIM_TIMELOCK blocks have passed without an SE response
const reclaimHex = await reclaimAbandoned(chain, { signer });
await provider.broadcastTxPoW(reclaimHex);

See also