How to find public address through private key on TRON

Viewed 889

How can I find user public address from his private key ? Already I found a way to convert public to hex Address also private to hex and reverse but get stuck in this one !

2 Answers

Using TronWeb, you can call this function:

const address = tronWeb.address.fromPrivateKey(newAccount.privateKey);

That code comes from one of TronWeb's tests

for bitcoin you need use this package to find public key => dart_wif

print('hex :::::: ${HEX.encode(index.privateKey!)}');

WIF decoded = WIF(version: 128, privateKey: index.privateKey!, compressed: true);

String key = wif.encode(decoded);
print(key);
Related