blockchain_utils icon indicating copy to clipboard operation
blockchain_utils copied to clipboard

Generate a public address from a private key in the TRON network

Open kostasoft opened this issue 5 months ago • 0 comments

Please tell me how to generate a public address from a private key in the TRON network?

final keyBytes = BytesUtils.fromHexString(privateKeyHex);
final privKey = Secp256k1PrivateKey.fromBytes(keyBytes);
final pubKey = privKey.publicKey.publicKey;
final pubBytes = pubKey.toBytes();
return Base58Encoder.encode(pubBytes);
// The result is incorrect

kostasoft avatar Nov 16 '25 13:11 kostasoft