new RiseSolution(proof, nonce, pubkey, epoch)
Interface for identity solutions.
Parameters:
Name | Type | Description |
---|---|---|
proof | buffer | Equihash proof value. |
nonce | number | Solution nonce. |
pubkey | buffer | Public key solution was seeded from. |
epoch | buffer | 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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
n | number | <optional> | RiseIdentity.N | Width in bits. |
k | number | <optional> | RiseIdentity.K | Proof length. |
Returns:
- Type:
- Promise.<boolean>
(static) fromJSON(json) → {module:rise~RiseSolution}
Constructs a RiseSolution from a JSON object.
Parameters:
Name | Type | Description |
---|---|---|
json | Object.<string, string> | Serialized solution. |
Returns:
- Type:
- module:rise~RiseSolution