1
var crypto = require('crypto');
var ed25519 = require('./');

const seed = crypto.randomBytes(32);
const keyPair = ed25519.MakeKeypair(seed);
const base58encoded = base58.encode(keyPair.publicKey);

console.log('base58 pub key: ' + base58encoded);

When I run the above code, it shows me the following error

ed25519.MakeKeypair is not a function

Can anyone please guide me on how to proceed?

2

Try pytezos:

>>> from pytezos import Key
>>> public_key = 'edpku976gpuAD2bXyx1XGraeKuCo1gUZ3LAJcHM12W1ecxZwoiu22R'
>>> pytezos.Key.from_public_point(public_key.encode()).public_key_hash()
'tz1KtUYJRPHCYiakAji1pfi6JyjZngYmReKF'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.