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

libcream

v0.2.1

Published

A zkCREAM client library

Readme

A zkCREAM client library

libcream test

This repository contains an essential libraries for zkCREAM's client application.

Install

$ yarn add libcream
# or
$ npm install libcream

Test

$ yarn test
#or
$ npm run test

Usability

Deposit

Basically, the libcream library is intended to be used in conjunction with other zero-knowledge proof protocol frameworks.

import { MerkleTree } from 'cream-merkle-tree'
import { createDeposit, rbigInt } from 'libcream'

const len = 31
const levels = 4
const zero_value = 0

const tree = new MerkleTree(
	levels,
	zero_value
)

// Create deposit
const deposit = createDeposit(rbigInt(len), rbigInt(len))
const { commitment, nullifierHash, nullifier, secret } = deposit

// Update merkleTree
tree.insert(commitment)

Generate MerkleTree when sign up MACI

All you need is to pass deposit: Deposit, target contract: ethers.Contract and p: MerkleTreeParams

const deposit = generateDeposit(rbigInt(31), rbigInt(31))

const params = {
	depth: 4,
	zeroValue: "2558267815324835836571784235309882327407732303445109280607932348234378166811"
}

const { root, merkleProof } = await generateMerkleProof(deposit, contract, params)

Create message for casting your vote

In order to use in partnership with MACI, you need to cast a message. Here is a simple use case

import { createMessage } from 'libcream'

const userStateIndex = 1
const userKeypair = new Keypair()
const coordinatorPubKey = new Keypair().pubKey
const recipientIndex = 1
const nonce = 1

const [message, encKeyPair] = createMessage(
    userStateIndex,
    userKeypair,
    null,
    coordinatorPubKey,
    recipientIndex,
    null,
    nonce
)

console.log(message)

// Message {
//      asArray: [Function],
//      asContractParam: [Function],
//      asCircuitInputs: [Function],
//      hash: [Function],
//      copy: [Function],
//      iv: 185273743003989823918834017806979612739987020163142754605482722745160024803n,
//      data: [
//        12311909440282622154219983755552473244443894343591985567303227809516726503449n,
//        42729577740623276802940420404626285991521762172891067540023340839538206556899n,
//        12610050538445939413855066192801673022935035326976616644124715813192497313341n,
//        12721333521477588815865816033592770062962879825348546385071187996127267268651n,
//        6774715088538722956319688583602539994620352354964895156724986989935524816617n,
//        20907541856021682955741733730679929080263888556819984677346342338990513027077n,
//        23056247447894948214297584481553505239441791580133357164033722194508283028929n,
//        10135344687454730375787319542162517559656950295372471064854032077012631951921n,
//        33299670189126249157947569076192296241539085983903696063229178041352348127066n,
//        13903745421168434070568805183640706209745444163891865058811159780729482213771n
//      ]
//}