OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Noble Secp256K1

Noble Secp256K1 is a TypeScript and JavaScript library implementing secp256k1 key generation, ECDSA and BIP340-compatible Schnorr signatures, signature verification and ECDH key agreement.

Independent OpenViST project profile, based on linked sources.

Noble Secp256K1 — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a JavaScript or TypeScript application needs the documented secp256k1 operations and a compact library. Consider the related noble-curves project when MSM, DER encoding or custom point precomputes are required.

Who it is for

  • JavaScript and TypeScript developers adding secp256k1 cryptographic operations to applications.
  • Developers implementing ECDSA or BIP340-compatible Schnorr signing and verification.
  • Teams that need ECDH shared-secret derivation in JavaScript software.

Documented uses

  • Generate a secp256k1 secret key and public key.
  • Sign a message and verify its signature using ECDSA or Schnorr.
  • Recover a public key from a recovered-format signature.
  • Derive an ECDH shared secret from a secret key and another party's public key.
Before you choose

Requirements & limits

The repository lists an MIT license and documents installation through npm or Deno. React Native requires additional polyfills; synchronous methods require @noble/hashes.

  • Asynchronous methods are available by default; synchronous methods require configuring hash functions from @noble/hashes.
  • The README says ECDSA messages are SHA-256 hashed by default and describes using a different hash with prehash disabled.
  • React Native requires additional support for secure random values and SHA-256.
  • The README identifies noble-curves as the related option for MSM, DER encoding and custom point precomputes.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install and use secp256k1 for asynchronous ECDSA signing and verification

Generate a key pair, sign a message, and verify the signature using the library’s asynchronous API.

Before you start

  • A JavaScript or TypeScript project using npm or Deno.
  • For npm, install @noble/secp256k1; for Deno, add jsr:@noble/secp256k1.

Steps

  1. Install the package with the command below or add it with deno add jsr:@noble/secp256k1.

    Documented command
    npm install @noble/secp256k1
  2. Import @noble/secp256k1 into the project.

  3. Generate a secret and public key with secp.keygen(), and encode the message as a Uint8Array, for example with new TextEncoder().encode('hello noble').

  4. Call await secp.signAsync(message, secretKey) and then await secp.verifyAsync(signature, message, publicKey).

Expected outcome

The documented example produces an ECDSA signature and a verification result for the message and public key.

Guide limitations

  • Only asynchronous methods are available by default; synchronous methods require installing @noble/hashes and configuring the library’s hash functions.
  • React Native requires additional polyfills for secure getRandomValues and SHA-256.
Source-based practical guide

Set up synchronous secp256k1 methods

Configure the library’s hash functions to enable its synchronous methods.

Before you start

  • A JavaScript or TypeScript project with @noble/secp256k1 installed.
  • Install @noble/hashes.

Steps

  1. Install @noble/hashes with the command below.

    Documented command
    npm install @noble/hashes
  2. Import hmac from @noble/hashes/hmac.js and sha256 from @noble/hashes/sha2.js.

  3. Set secp.hashes.hmacSha256 to (key, msg) => hmac(sha256, key, msg) and set secp.hashes.sha256 to sha256.

Expected outcome

The documented hash-function configuration enables synchronous methods in the library.

Guide limitations

  • Synchronous methods are not available by default; they require the additional hash package and configuration.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
9 October 2026
Original website title
paulmillr/noble-secp256k1 · Official homepage title · retained in its source language