You are viewing a single comment's thread from:

RE: Posting Authority Revoked.

in LeoFinance11 months ago

In case you miss it there's same example code available:

https://github.com/mahdiyari/hive-tx-js

const signature = hiveTx.Signature.from(string)
signature.getPublicKey(message)

const publicKey = signature.getPublicKey(digest).toString()
// STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF
// To find which account has this public key
const account = await hiveTx.call('condenser_api.get_key_references', 
        [["STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF"]])

Of course this is very black-box and doesn't show how we can actually extract the pubkey from the signature but whatever I assume it works on a practical level.