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

eddsa-o1js

v0.0.1

Published

> ⚠️ **NOTE**: The current implementation produces circuits that are too large to fit within existing constraint limits. PRs that optimize this library are welcome!

Readme

eddsa-o1js

⚠️ NOTE: The current implementation produces circuits that are too large to fit within existing constraint limits. PRs that optimize this library are welcome!

License: Apache-2.0 npm version

A provable EdDSA signature verification library for o1js, enabling zkApp developers to verify EdDSA signatures inside zk-SNARKs.

Features

  • EdDSA Verification in ZK: Verify EdDSA signatures within provable o1js code
  • Edwards25519 Support: Built-in support for the popular Edwards25519 curve
  • Twisted Edwards Curves: Implementation of twisted Edwards curves for efficient elliptic curve operations
  • Fully Composable: Designed to work seamlessly with the o1js ecosystem

Installation

npm install eddsa-o1js

Usage

Here's a quick example of how to use eddsa-o1js to verify an EdDSA signature:

import { ZkProgram, Bool, Bytes } from 'o1js';
import { createEddsa, createForeignTwisted, TwistedCurves } from 'eddsa-o1js';

// Create a custom Edwards25519 curve class
class Edwards25519 extends createForeignTwisted(TwistedCurves.Edwards25519) {}
class Scalar extends Edwards25519.Scalar {}
class Eddsa extends createEddsa(Edwards25519) {}
class Bytes32 extends Bytes(32) {}

// Define a ZkProgram that verifies EdDSA signatures
const eddsa = ZkProgram({
  name: 'eddsa',
  publicInput: Bytes32,
  publicOutput: Bool,

  methods: {
    verifyEddsa: {
      privateInputs: [Eddsa, Edwards25519],
      async method(
        message: Bytes32,
        signature: Eddsa,
        publicKey: Edwards25519
      ) {
        return {
          publicOutput: signature.verify(message, publicKey),
        };
      },
    },
  },
});

// Example: Generate a signature and verify it
async function run() {
  // Generate a keypair
  let privateKey = Edwards25519.Scalar.random();
  let publicKey = Edwards25519.generator.scale(privateKey);

  // Sign a message
  let message = Bytes32.fromString('Hello, o1js!');
  let signature = Eddsa.sign(message.toBytes(), privateKey.toBigInt());

  // Compile the program
  await eddsa.compile();

  // Verify the signature in zk
  let { proof } = await eddsa.verifyEddsa(message, signature, publicKey);

  // Check the result
  proof.publicOutput.assertTrue('signature verifies');
}

Advanced Usage

For more detailed examples, please check the examples directory:

API Reference

Core Components

  • createEddsa(TwistedCurve): Factory function that creates an EdDSA implementation for a specific curve
  • createForeignTwisted(TwistedCurveParams): Creates a provable twisted Edwards curve implementation
  • TwistedCurves: Contains parameters for common twisted Edwards curves (e.g., Edwards25519)

Usage Patterns

  1. Define your curve by extending the base implementation
  2. Create your EdDSA implementation for that curve
  3. Use the signature verification methods in your ZkProgram

Development

# Build the project
npm run build

Related Projects

  • o1js - The main framework for writing zero-knowledge applications

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.