tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
423 stars 271 forks source link

private keys format differ #411

Closed 1garo closed 1 year ago

1garo commented 1 year ago

I would know why there is a difference in private key formats?

createAccount generates a private key with the following format: 08089C..., while fromMnemonic format is 0x....

My current problem is: I'm trying to use some functionalities that relies in have a private key set, when I try to use the 0x... private key, it says that the format are invalid, then if I use 08089C... it just works fine.

Am I missing something?

start940315 commented 1 year ago

The leading 0x implies the string is a hex string, no other meaning. If 0x... string is not working, just remove the leading 0x.

1garo commented 1 year ago

The leading 0x implies the string is a hex string, no other meaning. If 0x... string is not working, just remove the leading 0x.

Thank you for your help. It's working now.