HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceCommunityDiscordBlogFAQBug BountyAnnouncementsChange Log
Guides

TRON’s signature algorithm is ECDSA, and the selected curve is SECP256K1.

From version 0.1.3, trident-java has implemented a wrapper class for SECP256K1.KeyPair in Core to facilitate the generation of private keys and the conversion of private keys to addresses. This classpath is: org.tron.trident.core.key.KeyPair;

  • Generate KeyPair
KeyPair keyPair = KeyPair.generate();
  • Import KeyPair with private key
KeyPair keyPair = new KeyPair("your private key");
  • Print Private & Public key
keyPair.toPrivateKey(); //String private key

keyPair.toPublicKey(); //String public key

🚧

Note

The public key does not equal to address.

  • Print Base58Check & Hex address
keyPair.toBase58CheckAddress();

keyPair.toHexAddress();