DEV Community

jared1106
jared1106

Posted on • Edited on

How to generates Tron private key and address offline

NuGet Import dependency libraries

PM> Install-Package Tron.Wallet
Enter fullscreen mode Exit fullscreen mode

Generate private key and addresse randomly

using Tron.Wallet;

namespace ConsoleApp1 {
    internal class Program {
        static async Task Main(string[] args) {
            var tronECKey = TronECKey.GenerateKey(TronNetwork.MainNet);
            var privateKey = tronECKey.GetPrivateKey(); //Private key
            var address = tronECKey.GetPublicAddress(); //Address

            Console.WriteLine($"{privateKey}\t{address}");
            Console.Readkey();
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more