Socket
Book a DemoInstallSign in
Socket

@noble/secp256k1

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noble/secp256k1

Fastest 5KB JS implementation of secp256k1 ECDH & ECDSA signatures compliant with RFC6979

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
754K
1.94%
Maintainers
1
Weekly downloads
 
Created

What is @noble/secp256k1?

@noble/secp256k1 is a JavaScript library for elliptic curve cryptography, specifically for the secp256k1 curve. It is commonly used in blockchain and cryptocurrency applications for key generation, signing, and verification.

What are @noble/secp256k1's main functionalities?

Key Generation

This feature allows you to generate a random private key and derive the corresponding public key using the secp256k1 curve.

const secp = require('@noble/secp256k1');
const privateKey = secp.utils.randomPrivateKey();
const publicKey = secp.getPublicKey(privateKey);
console.log('Private Key:', privateKey);
console.log('Public Key:', publicKey);

Signing

This feature allows you to sign a message using a private key. The message is an array of bytes, and the signature is generated using the secp256k1 curve.

const secp = require('@noble/secp256k1');
const message = new Uint8Array([1, 2, 3]);
const privateKey = secp.utils.randomPrivateKey();
const signature = secp.sign(message, privateKey);
console.log('Signature:', signature);

Verification

This feature allows you to verify a signature using the corresponding public key and the original message. It returns a boolean indicating whether the signature is valid.

const secp = require('@noble/secp256k1');
const message = new Uint8Array([1, 2, 3]);
const privateKey = secp.utils.randomPrivateKey();
const publicKey = secp.getPublicKey(privateKey);
const signature = secp.sign(message, privateKey);
const isValid = secp.verify(signature, message, publicKey);
console.log('Is the signature valid?', isValid);

Other packages similar to @noble/secp256k1

Keywords

secp256k1

FAQs

Package last updated on 25 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.