public void ShouldGenerateCardanoFromSeedAndPath(string path, string privateKey, string publicKey) { TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(ReferenceSeed2); var wallet = hdWallet.GetWalletFromPath <SampleWallet>(path); Assert.AreEqual(privateKey, wallet.PrivateKeyBytes.ToHexString()); Assert.AreEqual(publicKey, $"00{wallet.PublicKey.ToHexString()}"); }
public void ShouldGenerateMasterWalletFromPurposeAndPath(string path) { TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(ReferenceSeed); CardanoSampleWallet wallet = hdWallet.GetWalletFromPath <CardanoSampleWallet>(path); Assert.AreEqual(ReferencePrivateKey, wallet.PrivateKey.ToHexString()); Assert.AreEqual(ReferencePubKey, $"00{wallet.PublicKey.ToHexString()}"); }
public void ShouldGenerateFromSeed1(string path, string privateKey, string publicKey) { TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(ReferenceSeed); var account0 = hdWallet.GetWalletFromPath <SampleWallet>(path); Assert.AreEqual(privateKey, account0.PrivateKeyBytes.ToHexString()); Assert.AreEqual(publicKey, $"00{account0.PublicKey.ToHexString()}"); }
public void ShouldGenerateMasterWalletFromPurposeAndPath() { var testMne = "identify fatal close west parent myself awake impact shoot wide wrong derive ship doctor mushroom weather absent vacant armed chuckle swarm hip music wing"; TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(testMne, ""); var coinTypeWallet = hdWallet.GetWalletFromPath <PolkadotWallet>("m/44'/354'/0'/0'/1'"); var address = coinTypeWallet.GetNetworkAddress(AddressType.PolkadotLive); Console.WriteLine($"Address: {address}"); Console.WriteLine($"Public key: {coinTypeWallet.PublicKey.ToHexString()}"); Console.WriteLine($"Private key: {coinTypeWallet.PrivateKeyBytes.ToHexString()}"); }
public void ShouldGenerateMasterWalletFromPurposeAndPath(string path) { // 15fn3g9Ehu9FYTBUSzWPihcVfHnfm2AfFNtMtPNMHGkoWTEg m/44'/354'/0'/0'/0' // 1446qjMShfFgAtGzsLd5ykqC5cHXXDumcbNbPQTd9ZHsoePY m/44'/354'/1'/0'/0' // 13KpDbPsYHBsT8YDCP3LaDbZkKaTUMXQq4tM8y7hrYD2Hq6m m/44'/354'/2'/0'/0' // 14qrzk2kjH4gfs4Q2PCEKy6pWS3JeqHkEcvP3TFASm4mVtAW m/44'/354'/0'/0'/1' // TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(mnemonic, ""); TestHDWalletEd25519 hdWallet = new TestHDWalletEd25519(seed); var coinTypeWallet = hdWallet.GetWalletFromPath <PolkadotWallet>(path); var address = coinTypeWallet.GetNetworkAddress(AddressType.PolkadotLive); Console.WriteLine($"Path: {path}, address: {address}"); Console.WriteLine($"Public key: {coinTypeWallet.PublicKey.ToHexString()}"); Console.WriteLine($"Private key: {coinTypeWallet.PrivateKey.ToHexString()}"); }