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

@luxfi/lamport

v1.0.2

Published

Lamport One-Time Signatures for Lux Network - Post-quantum secure signatures using only keccak256

Readme

@luxfi/lamport

Quantum-resistant Lamport One-Time Signatures for EVM smart contracts.

npm version License: BSD-3-Clause

Features

  • 🔐 Quantum-resistant - Uses only keccak256, secure against Grover's algorithm
  • Gas-optimized - Assembly verification at 164K gas (7.5x improvement)
  • 🔒 Constant-time - Side-channel resistant verification variant
  • 🏦 Safe integration - Gnosis Safe module with atomic key rotation
  • 🤝 Threshold support - T-of-N MPC coordination for distributed signing
  • 📦 TypeScript SDK - Complete key generation, signing, and verification

Installation

# npm
npm install @luxfi/lamport viem

# pnpm
pnpm add @luxfi/lamport viem

# yarn
yarn add @luxfi/lamport viem

Quick Start

Key Generation

import { generateKeyPair, generateKeyChain } from '@luxfi/lamport'

// Generate a single key pair
const keyPair = generateKeyPair()
console.log('PKH:', keyPair.pkh)

// Generate a key chain (100 pre-generated keys)
const keyChain = generateKeyChain(100)

Signing

import { sign, signWithRotation, keccak256, toBytes } from '@luxfi/lamport'

// Sign a message
const message = keccak256(toBytes('Hello, Quantum World!'))
const signature = sign(message, keyPair.privateKey)

// Sign with key rotation (recommended)
const { signature, nextPKH } = signWithRotation(
  message,
  currentKeyPair,
  nextKeyPair
)

Verification

import { verify, computePKH } from '@luxfi/lamport'

// Off-chain verification
const valid = verify(message, signature, publicKey)

// Compute PKH for on-chain registration
const pkh = computePKH(publicKey)

Safe Integration

import { prepareSafeTransaction } from '@luxfi/lamport'

const txData = prepareSafeTransaction(
  { to, value, data, operation },
  currentKeyPair,
  nextKeyPair,
  moduleAddress,
  chainId,
  safeTxHash
)

// Use txData.signature and txData.publicKey with LamportSafe contract

Threshold Signing

import {
  generateKeyShares,
  createSigningSession,
  signPartial,
  combineSignatures,
} from '@luxfi/lamport'

// Distributed key generation
const shares = generateKeyShares({
  threshold: 3,
  total: 5,
  signers: ['alice', 'bob', 'carol', 'dave', 'eve'],
})

// Create signing session
let session = createSigningSession(message, config)

// Each signer contributes their partial
const partial = signPartial(session, myShare)
session = addPartialSignature(session, partial)

// Combine when threshold reached
if (session.complete) {
  const signature = combineSignatures(session)
}

Solidity Contracts

Import contracts directly:

import "@luxfi/lamport/contracts/Lamport.sol";
import "@luxfi/lamport/contracts/LamportSafe.sol";
import "@luxfi/lamport/contracts/LamportThreshold.sol";
import "@luxfi/lamport/contracts/LamportOptimized.sol";

Contract ABIs

import {
  LamportVerifierAbi,
  LamportSafeAbi,
  LamportThresholdAbi,
  LamportOptimizedAbi,
} from '@luxfi/lamport'

Gas Costs

| Method | Gas | Constant Time | | ------------------------- | --------- | ------------- | | Lamport.verifyMem | 1,231,432 | No | | LamportOptimized.verify | 163,848 | No | | verifyUnrolled | 137,390 | No | | verifyConstantTime | 145,051 | Yes |

Security

  • Quantum-resistant: 128-bit security against Grover's algorithm
  • One-time use: Each key can only sign ONE message
  • Domain separation: Prevents cross-chain and cross-contract replay
  • Constant-time: Optional side-channel resistant verification

⚠️ WARNING: Lamport keys are ONE-TIME USE. Never sign two different messages with the same key pair!

Architecture

┌─────────────────────────────────────────────────────────┐
│                    @luxfi/lamport                        │
├─────────────────────────────────────────────────────────┤
│  TypeScript SDK                                          │
│  ├── generateKeyPair() / generateKeyChain()             │
│  ├── sign() / signWithRotation()                        │
│  ├── verify() / computePKH()                            │
│  └── Threshold: generateKeyShares(), combineSignatures()│
├─────────────────────────────────────────────────────────┤
│  Solidity Contracts                                      │
│  ├── Lamport.sol        - Pure Solidity library         │
│  ├── LamportOptimized.sol - Assembly (164K gas)         │
│  ├── LamportSafe.sol    - Gnosis Safe module            │
│  └── LamportThreshold.sol - MPC key chain               │
└─────────────────────────────────────────────────────────┘

References

License

BSD-3-Clause © Lux Network Team