Ed25519Sha256

types~ Ed25519Sha256

ED25519: Ed25519 signature condition.

This condition implements Ed25519 signatures.

ED25519 is assigned the type ID 4. It relies only on the ED25519 feature suite which corresponds to a bitmask of 0x20.

Constructor

new Ed25519Sha256()

Source:

Methods

setPublicKey(publicKey)

Set the public publicKey.

This is the Ed25519 public key. It has to be provided as a buffer.

Parameters:
Name Type Description
publicKey Buffer

Public Ed25519 publicKey

Source:

setSignature(signature)

Set the signature.

Instead of using the private key to sign using the sign() method, we can also generate the signature elsewhere and pass it in.

Parameters:
Name Type Description
signature Buffer

64-byte signature.

Source:

sign(message, privateKey)

Sign a message.

This method will take a message and an Ed25519 private key and store a corresponding signature in this fulfillment.

Parameters:
Name Type Description
message Buffer

Message to sign.

privateKey String

Ed25519 private key.

Source:

validate(message) → {Boolean}

Verify the signature of this Ed25519 fulfillment.

The signature of this Ed25519 fulfillment is verified against the provided message and public key.

Parameters:
Name Type Description
message Buffer

Message to validate against.

Source:
Returns:

Whether this fulfillment is valid.

Type
Boolean