1.0.0-alpha.7 • Published 5 years ago

@helixnetwork/schnorr v1.0.0-alpha.7

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

@helixnetwork/schnorr

IOTA schnorr Scheme

Installation

Install using npm:

npm install @helixnetwork/schnorr

or using yarn:

yarn add @helixnetwork/schnorr

API Reference

  • schnorr

    * [~subseed

    Compute subseed based on the seed with an additional index(seed, index)](#module_schnorr..subseed Compute subseed based on the seed with an additional index)

    * [~key

    Split seed in fragments and hashed them then generate from each fragment a schnore private key;(subseed, securityLevel)](#module_schnorr..key Split seed in fragments and hashed them then generate from each fragment a schnore private key;)

    * [~digests(key)](#module_schnorr..digests)
    
    * [~address(digests)](#module_schnorr..address)
    
    * [~digest(normalizedBundleFragment, signatureFragment)](#module_schnorr..digest)
    
    * [~signatureFragment(normalizeBundleFragment, keyFragment)](#module_schnorr..signatureFragment)
    
    * [~validateSignatures(expectedAddress, signatureFragments, bundleHash)](#module_schnorr..validateSignatures)
    
    * [~normalizedBundleHash(bundlehash)](#module_schnorr..normalizedBundleHash)

schnorr~subseed

Compute subseed based on the seed with an additional index(seed, index)

ParamTypeDescription
seedInt8ArraySeed txBits
indexnumberPrivate key index

Returns: Int8Array - subseed txBits

schnorr~key

Split seed in fragments and hashed them then generate from each fragment a schnore private key;(subseed, securityLevel)

ParamTypeDescription
subseedInt8ArraySubseed txBits
securityLevelnumberPrivate key length

Returns: Int8Array - Private key bytes

schnorr~digests(key)

ParamTypeDescription
keyUint8ArrayPrivate key txBits

schnorr~address(digests)

ParamTypeDescription
digestsInt8ArrayDigests txBits

Returns: Int8Array - Address txBits

schnorr~digest(normalizedBundleFragment, signatureFragment)

ParamTypeDescription
normalizedBundleFragmentarrayNormalized bundle fragment
signatureFragmentInt8ArraySignature fragment txBits

Returns: Int8Array - Digest txBits

schnorr~signatureFragment(normalizeBundleFragment, keyFragment)

ParamTypeDescription
normalizeBundleFragmentarraynormalized bundle fragment
keyFragmentkeyFragmentkey fragment txBits

Returns: Uint8Array - Signature Fragment txBits

schnorr~validateSignatures(expectedAddress, signatureFragments, bundleHash)

ParamTypeDescription
expectedAddressstringExpected address txs
signatureFragmentsarrayArray of signatureFragments txs
bundleHashstringBundle hash txs

schnorr~normalizedBundleHash(bundlehash)

ParamTypeDescription
bundlehashHashBundle hash txs

Normalizes the bundle hash, with resulting digits summing to zero.

Returns: Int8Array - Normalized bundle hash