Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bls-eth-wasm

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bls-eth-wasm

BLS signature for Node.js by WebAssembly for Ethereum 2.0

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

BLS signature for Node.js by WebAssembly

Abstract

This module is built with BLS_ETH=1 for Ethereum 2.0 spec.

News

setETHmode() supports hash-to-curve defined at draft-irtf-cfrg-hash-to-curve at March 2020.

Init as the followings:

bls.init(bls.BLS12_381)
bls.setETHmode(2)

(old) The new eth2.0 functions are supported. This mode will be removed in the future.

Init as the followings:

bls.init(bls.BLS12_381)
bls.setETHmode(1)

then, you can use the following functions.

bls-eth-wasmeth2.0 spec name
SecretKey::signSign
PublicKey::verifyVerify
Sign::aggregateAggregate
Sign::fastAggregateVerifyFastAggregateVerify
Sign::aggregateVerifyNoCheckAggregateVerify

The size of message must be 32 byte.

Check functions:

  • verifySignatureOrder ; make deserialize check the correctness of the order
  • Sign::isValidOrder ; check the correctness of the order
  • verifyPublicKeyOrder ; make deserialize check the correctness of the order
  • PublicKey::isValidOrder ; check the correctness of the order
  • areAllMsgDifferent ; check that all messages are different each other

Old eth2.0 spec

The msg in the following means 40 bytes Uint8Array data.

  • SecretKey.signHashWithDomain(msg)
    • sign msg by secretKey
  • PublicKey.verifyHashWithDomain(sig, msg)
    • verify sig with msg by publickey
  • Signature.verifyAggregatedHashWithDomain(pubVec, msgVec)
    • pubVec[i] = secVec[i].getPublicKey()
    • sigVec[i] = secVec[i].signHashWithDomain(msgVec[i])
    • aggSig = sum of sigVec[i]
    • aggSig.verifyAggregatedHashWithDomain(pubVec, msgVec)
    • see aggTest() in test.js

see bls

For Node.js

node test.js

License

modified new BSD License http://opensource.org/licenses/BSD-3-Clause

Author

MITSUNARI Shigeo(herumi@nifty.com)

Keywords

FAQs

Package last updated on 02 Apr 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc