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

@fabrknt/veil-core

v1.0.3

Published

Chain-agnostic encryption and privacy primitives (NaCl box, Shamir, payload serialization) with optional Solana-specific extensions (ZK compression, shielded transfers, Arcium MPC)

Readme

@fabrknt/veil-core

npm version npm downloads

Chain-agnostic encryption and privacy primitives for DeFi protocols, with optional Solana extensions.

Not every DeFi protocol needs TradFi compliance -- but if yours does, you shouldn't have to rebuild from scratch. Fabrknt plugs into your existing protocol with composable SDKs and APIs. No permissioned forks, no separate deployments.

Install

npm install @fabrknt/veil-core

Quick Start

import {
  generateEncryptionKeypair,
  encrypt,
  decrypt,
  splitSecret,
  combineShares,
} from '@fabrknt/veil-core';

const alice = generateEncryptionKeypair();
const bob = generateEncryptionKeypair();

const plaintext = new TextEncoder().encode('private order data');
const encrypted = encrypt(plaintext, bob.publicKey, alice);
const decrypted = decrypt(encrypted.bytes, alice.publicKey, bob);

Features

  • NaCl Box encryption (Curve25519-XSalsa20-Poly1305) -- encrypt for single or multiple recipients
  • Shamir's Secret Sharing -- M-of-N threshold splitting and reconstruction
  • Binary payload serialization with built-in schemas (swap orders, RWA assets)
  • Noir ZK proofs -- swap validity, range proofs, order commitment proofs
  • ZK Compression via Light Protocol (Solana) -- ~99% on-chain cost reduction
  • Shielded transfers via Privacy Cash (Solana) -- hidden amounts and participants
  • Arcium MPC integration (Solana) -- encrypted shared state for dark pools
  • Key encoding utilities -- base58 (Solana/Bitcoin) and hex (EVM) conversions

API Summary

Chain-Agnostic

| Module | Key Exports | |--------|-------------| | NaCl Box | generateEncryptionKeypair, deriveEncryptionKeypair, encrypt, decrypt, encryptForMultiple, validateEncryptedData | | Threshold | splitSecret, combineShares, verifyShares, createThresholdEncryption, decryptWithThreshold | | Payload | serializePayload, deserializePayload, calculateSchemaSize, SWAP_ORDER_SCHEMA, RWA_ASSET_SCHEMA | | Noir ZK | generateSwapProof, verifySwapProof, generateRangeProof, createNoirProver, createNoirVerifier |

Solana-Specific (optional)

| Module | Key Exports | |--------|-------------| | ZK Compression | createZkRpc, compressData, decompressData, createCompressedMint, transferCompressedTokens | | Shielded Transfers | PrivacyCashClient, createShieldedTransfer, shieldTokens, unshieldTokens | | Arcium MPC | createArciumClient, createDarkPoolManager, ArciumClient, DarkPoolStateManager | | RPC Config | createRpcConnections, createHeliusRpc, createRpcFromEnv |

Solana modules require @solana/web3.js as an optional peer dependency.

Types

interface EncryptionKeypair {
  publicKey: Uint8Array;  // 32 bytes, X25519
  secretKey: Uint8Array;  // 32 bytes
}

interface EncryptedData {
  nonce: Uint8Array;      // 24 bytes
  ciphertext: Uint8Array;
  bytes: Uint8Array;      // nonce + ciphertext combined
}

interface SecretShare {
  index: number;
  value: Uint8Array;      // 32 bytes
}

Documentation

Full documentation, usage examples, and Solana app guides are available in the main repository README.

License

MIT