On the Casper Network, wallets are linked to account hashes, which can be obtained by converting a public key hex. It is not possible to obtain a public key from an account hash on the network. This conversion is not supported by the network.
The following code sample demonstrates how to convert a public key to an account hash using the casper-js-sdk library:
const { PublicKey } = require("casper-js-sdk");
const publicKeyHex = "0119bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1";
const publicKey = PublicKey.fromHex(publicKeyHex);
const accountHash = publicKey.toAccountHash();
console.log(accountHash.toHex());
If you have any concerns, questions, or issues, please submit a request to our support team here: https://support.casperlabs.io/hc/en-gb/requests/new
Comments
0 comments
Please sign in to leave a comment.