Signing

Arbitrary messages

signMessage(msgHash, key, enc)

Sign transaction with key.

Arguments:
  • msgHash (Buffer) – hash of a message. Can technically be any Buffer, but it really is only secure if using a hash.
  • key (KeyPair) – key pair or private key
  • enc (signing.Encoding) –
Returns:

Promise<string>

verifySignature(msg, key, signature, enc)

Verify that a signature for msg was generated by key

Arguments:
  • msg (Buffer) –
  • key (KeyPair) – key pair or public key
  • signature (string) –
  • enc (signing.Encoding) –
Returns:

Promise<boolean>

Transactions

signTransaction(tx, key, enc)

Sign transaction with key.

Arguments:
  • tx (any) – transaction
  • key (KeyPair) – key pair or private key
  • enc (signing.Encoding) –
Returns:

Promise<string>

verifyTxSignature(tx, key, signature, enc)

Verify that a signature for tx was generated by key

Arguments:
  • tx (any) –
  • key (KeyPair) –
  • signature (string) –
  • enc (signing.Encoding) –
Returns:

Promise<boolean>