Browse Source

add HDKey.sign/HDKey.verify methods

master
Daniel Cousens 7 years ago
parent
commit
61c511b1cc
  1. 8
      lib/hdkey.js

8
lib/hdkey.js

@ -152,6 +152,14 @@ HDKey.prototype.deriveChild = function (index) {
return hd
}
HDKey.prototype.sign = function (hash) {
return secp256k1.sign(hash, this.privateKey).signature
}
HDKey.prototype.verify = function (hash, signature) {
return secp256k1.verify(hash, signature, this.publicKey)
}
HDKey.prototype.toJSON = function () {
return {
xpriv: this.privateExtendedKey,

Loading…
Cancel
Save