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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@spacesprotocol/veritas

v0.0.6

Published

Veritas is a <strong>stateless way</strong> to verify <strong><a href="https://spacesprotocol.org">Spaces on Bitcoin</a></strong> using a permissionless <strong>trust anchor</strong> (a 32-byte hash), without needing a full Bitcoin node on your phone!

Readme

🔑 Veritas

Veritas is a stateless way to verify Spaces on Bitcoin using a permissionless trust anchor (a 32-byte hash), without needing a full Bitcoin node on your phone!

🚀 What Can Your App Do?

  • Scan or fetch a trust anchor from a trusted node to sync instantly.
  • Use it to verify any space -> pubkey mapping with a Merkle inclusion proof.
  • Messages & DNS packets are signed with the space's pubkey—records can be resolved and updated off-chain without modifying the trust anchor itself.
  • Display the trust anchor for transparency—users can compare it against public explorers or services they trust.
  • Re-scan or fetch periodically to include recent changes, such as new space registrations or transfers.

Note: Trust anchors are 32-byte Merkle tree roots that represent a summary of the entire protocol state at a specific Bitcoin block height.


Javascript Example

Verifying proofs

const veritas = new Veritas();

// Set up a trust anchor
const root = Buffer.from(
    "a44ad8bca3184798d75f69b9c50bfbc67dd1bcf550a9ce3a943ff6501ab60693",
    "hex"
);
veritas.addAnchor(root);

const rawProof = Buffer.from(
    "AQEAAouXDhe+rJKxqcvRzRIthc2QkNuPDt34M2NmW8nLoqk0AQACD5+x6CJLkmxgKPTyS0Nq9Ci03Lev9Fm20W+kyCzvewMBAAEAAvNWZU+az0t38K0pMm5Ny5fWGFZskajtKZ+On2Z4PkGqAQACXb+CBVIEjx7wDHZbG/FWKuczR8WgyHSelZBwXIzjflIBAAJo/bDo+osV3y5G7AGeMv6i/LMbCozs2tk3jUg0+0L8nwEAAQABAAEAAiMCqoVnipJoF4xoNhz7owXgN+ozXdgce3MZX/M7WCXOAG4seB00O3x87+y2CM1e1uZhmTkmmkyUwyjxv/IronYzADcBAQdtZW1wb29sAfzA3gEAAPuaAiJRIHj13+6+2Wc7tWB+ZswSvzvEKCzhUjuwUsQyFJX0f8SHAklClIvNFftzNbqMoAe7bdDpm4pnWyU6o+abgq+22xEgAiNAa7W4k9sjy7lYKzZtx1ag2VVcz+XzwDLPZU02XiIDAqh+BDASBJSQYgMZPd/BAgbND21I/8FFfcpHsJqqsb4lAnHXQmQvzKYfAhWXtBD687lb4qqZudMBPZY0UQsqNWBC",
    "base64"
);

// Verify a proof with veritas
const proof = veritas.verifyProof(rawProof);

// Iterate over the proof entries
for (const {key, value: utxo} of proof.entries()) {
    const space = utxo.getSpace();
    console.log('✅ Space: ', space.getName().toString());
    console.log('🔑 Public key: ', Buffer.from(utxo.getPublicKey()).toString('hex'));
}

Verifying messages

const veritas = new Veritas();

// Set up a trust anchor
const anchor = Buffer.from(
    "a44ad8bca3184798d75f69b9c50bfbc67dd1bcf550a9ce3a943ff6501ab60693",
    "hex"
);
veritas.addAnchor(anchor);

const rawProof = Buffer.from(
    "AQEAAouXDhe+rJKxqcvRzRIthc2QkNuPDt34M2NmW8nLoqk0AQACD5+x6CJLkmxgKPTyS0Nq9Ci03Lev9Fm20W+kyCzvewMBAAEAAvNWZU+az0t38K0pMm5Ny5fWGFZskajtKZ+On2Z4PkGqAQACXb+CBVIEjx7wDHZbG/FWKuczR8WgyHSelZBwXIzjflIBAAJo/bDo+osV3y5G7AGeMv6i/LMbCozs2tk3jUg0+0L8nwEAAQABAAEAAiMCqoVnipJoF4xoNhz7owXgN+ozXdgce3MZX/M7WCXOAG4seB00O3x87+y2CM1e1uZhmTkmmkyUwyjxv/IronYzADcBAQdtZW1wb29sAfzA3gEAAPuaAiJRIHj13+6+2Wc7tWB+ZswSvzvEKCzhUjuwUsQyFJX0f8SHAklClIvNFftzNbqMoAe7bdDpm4pnWyU6o+abgq+22xEgAiNAa7W4k9sjy7lYKzZtx1ag2VVcz+XzwDLPZU02XiIDAqh+BDASBJSQYgMZPd/BAgbND21I/8FFfcpHsJqqsb4lAnHXQmQvzKYfAhWXtBD687lb4qqZudMBPZY0UQsqNWBC",
    "base64"
);

// Verify proof with veritas
const proof = veritas.verifyProof(rawProof);

// Prepare space, message, and signature.
const space = new SLabel("@mempool");
const msg = Buffer.from("hello world", "utf-8");
const sig = Buffer.from(
    "c13064e2bc671c5444f610110d7bf9cebe7a003cb09279fd0b04ab34415913c2cacd22e7795a49fe7310e3bcde4df58055d89ccc7cfbd002f612d2fe74271b4a",
    "hex"
);

// Find a UTXO associated with the space withtin the proof 
// to verify a message signed with it
const utxo = proof.findSpace(space.computeHash());
veritas.verifyMessage(utxo, msg, sig);

console.log("✅ Verified message:", msg.toString("utf-8"));
console.log("- Signed by: ", space.toString());
console.log("- Public Key:", Buffer.from(utxo.getPublicKey()).toString("hex"));
console.log("- Signature: ", sig.toString('hex'));

Multiple anchors

Since the Spaces client generates a new trust anchor every 6 hours to include recent updates, it’s recommended to retain older anchors to verify against older proofs while prioritizing the most recent one when available. Depending on your use case and the availability of older proofs, your app could need to re-scan/sync a new anchor once a day, week, month or even longer!

Compiling from Source

To compile from source, use wasm-pack you need to have clang installed.

./wasm.sh

License

Licensed under the MIT license.