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.
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.
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, addjsr:@noble/secp256k1.
Steps
Install the package with the command below or add it with
deno add jsr:@noble/secp256k1.npm install @noble/secp256k1Import
@noble/secp256k1into the project.Generate a secret and public key with
secp.keygen(), and encode the message as aUint8Array, for example withnew TextEncoder().encode('hello noble').Call
await secp.signAsync(message, secretKey)and thenawait 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/hashesand configuring the library’s hash functions. - React Native requires additional polyfills for secure
getRandomValuesand SHA-256.
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/secp256k1installed. - Install
@noble/hashes.
Steps
Install
@noble/hasheswith the command below.npm install @noble/hashesImport
hmacfrom@noble/hashes/hmac.jsandsha256from@noble/hashes/sha2.js.Set
secp.hashes.hmacSha256to(key, msg) => hmac(sha256, key, msg)and setsecp.hashes.sha256tosha256.
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.
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

