Class: Point

Point

new Point(x, y) → {Point}

Instantiate a valid secp256k1 Point from the X and Y coordinates.

Parameters:
Name Type Description
x BN | String

The X coordinate

y BN | String

The Y coordinate

Source:
Throws:

A validation error if exists

Type
Error
Returns:

An instance of Point

Type
Point

Extends

  • elliptic.curve.point

Methods

<static> fromX(odd, x) → {Point}

Instantiate a valid secp256k1 Point from only the X coordinate

Parameters:
Name Type Description
odd boolean

If the Y coordinate is odd

x BN | String

The X coordinate

Source:
Throws:

A validation error if exists

Type
Error
Returns:

An instance of Point

Type
Point

<static> getG() → {Point}

Will return a secp256k1 ECDSA base point.

Source:
Returns:

An instance of the base point.

Type
Point

<static> getN() → {BN}

Will return the max of range of valid private keys as governed by the secp256k1 ECDSA standard.

Source:
Returns:

A BN instance of the number of points on the curve

Type
BN

getX() → {BN}

Will return the X coordinate of the Point

Source:
Returns:

A BN instance of the X coordinate

Type
BN

getY() → {BN}

Will return the Y coordinate of the Point

Source:
Returns:

A BN instance of the Y coordinate

Type
BN

validate(An) → {Point}

Will determine if the point is valid

Parameters:
Name Type Description
An Point

instance of Point

Source:
Throws:

A validation error if exists

Type
Error
Returns:

An instance of the same Point

Type
Point