rise~ RiseSolution

new RiseSolution(proof, nonce, pubkey, epoch)

Interface for identity solutions.

Parameters:
NameTypeDescription
proofbuffer

Equihash proof value.

noncenumber

Solution nonce.

pubkeybuffer

Public key solution was seeded from.

epochbuffer

Magic network number prepended to public key.

Members

difficulty :number

Number of leading zeroes in the proof.

Type:
  • number

epoch :buffer

Network magic number.

Type:
  • buffer

fingerprint :buffer

RIPEMD-160 hash for SHA-256 hash of serialized solution.

Type:
  • buffer

nonce :nuber

Solution nonce.

Type:
  • nuber

proof :buffer

Equihash proof.

Type:
  • buffer

pubkey :buffer

Public key.

Type:
  • buffer

Methods

getProofAsBinaryString() → {string}

Represents the proof as a string of 1's and 0's.

Returns:
Type: 
string

toJSON() → {Object.<string, string>}

Serilaizes the solution into a JSON object.

Returns:
Type: 
Object.<string, string>

verify(nopt, kopt) → {Promise.<boolean>}

Ensures that the solution is valid.

Parameters:
NameTypeAttributesDefaultDescription
nnumber<optional>
RiseIdentity.N

Width in bits.

knumber<optional>
RiseIdentity.K

Proof length.

Returns:
Type: 
Promise.<boolean>

(static) fromJSON(json) → {module:rise~RiseSolution}

Constructs a RiseSolution from a JSON object.

Parameters:
NameTypeDescription
jsonObject.<string, string>

Serialized solution.