Merge pull request #2006 from imachug/cryptmessage-bitcoin

Add privToPub and pubToAddr commands
This commit is contained in:
ZeroNet 2019-05-20 17:04:38 +02:00 committed by GitHub
commit dbcaa6bf85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,6 +124,15 @@ class UiWebsocketPlugin(object):
def actionEcdsaVerify(self, to, data, address, signature):
self.response(to, CryptBitcoin.verify(data, address, signature))
# Gets the publickey of a given privatekey
def actionEccPrivToPub(self, to, privatekey):
self.response(to, btctools.privtopub(privatekey))
# Gets the address of a given publickey
def actionEccPubToAddr(self, to, publickey):
address = btctools.pubtoaddr(btctools.decode_pubkey(publickey))
self.response(to, address)
@PluginManager.registerTo("User")
class UserPlugin(object):