public void TestParentKey() { string expectedParentKey = "e0eec84fe165cd427cb7bc9b6cfdef0555aa1cb6f9043ff1fe986c3c8ddd22e3"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var parentKey = wallet.Derive("m/44'/148'"); Assert.AreEqual(expectedParentKey, parentKey); }
public void TestIndex5() { string expectedPublicKey = "GBRQY5JFN5UBG5PGOSUOL4M6D7VRMAYU6WW2ZWXBMCKB7GPT3YCBU2XZ"; string expectedPrivateKey = "SCK27SFHI3WUDOEMJREV7ZJQG34SCBR6YWCE6OLEXUS2VVYTSNGCRS6X"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(5); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex4() { string expectedPublicKey = "GBCUXLFLSL2JE3NWLHAWXQZN6SQC6577YMAU3M3BEMWKYPFWXBSRCWV4"; string expectedPrivateKey = "SCPCY3CEHMOP2TADSV2ERNNZBNHBGP4V32VGOORIEV6QJLXD5NMCJUXI"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(4); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex3() { string expectedPublicKey = "GAOD5NRAEORFE34G5D4EOSKIJB6V4Z2FGPBCJNQI6MNICVITE6CSYIAE"; string expectedPrivateKey = "SBMWLNV75BPI2VB4G27RWOMABVRTSSF7352CCYGVELZDSHCXWCYFKXIX"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(3); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex2() { string expectedPublicKey = "GAY5PRAHJ2HIYBYCLZXTHID6SPVELOOYH2LBPH3LD4RUMXUW3DOYTLXW"; string expectedPrivateKey = "SDAILLEZCSA67DUEP3XUPZJ7NYG7KGVRM46XA7K5QWWUIGADUZCZWTJP"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(2); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex1() { string expectedPublicKey = "GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX"; string expectedPrivateKey = "SCEPFFWGAG5P2VX5DHIYK3XEMZYLTYWIPWYEKXFHSK25RVMIUNJ7CTIS"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(1); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex0() { string expectedPublicKey = "GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6"; string expectedPrivateKey = "SBGWSG6BTNCKCOB3DIFBGCVMUPQFYPA2G4O34RMTB343OYPXU5DJDVMN"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(0); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex9() { string expectedPublicKey = "GBTVYYDIYWGUQUTKX6ZMLGSZGMTESJYJKJWAATGZGITA25ZB6T5REF44"; string expectedPrivateKey = "SCJGVMJ66WAUHQHNLMWDFGY2E72QKSI3XGSBYV6BANDFUFE7VY4XNXXR"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(9); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex8() { string expectedPublicKey = "GDJTCF62UUYSAFAVIXHPRBR4AUZV6NYJR75INVDXLLRZLZQ62S44443R"; string expectedPrivateKey = "SCD5OSHUUC75MSJG44BAT3HFZL2HZMMQ5M4GPDL7KA6HJHV3FLMUJAME"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(8); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex7() { string expectedPublicKey = "GAY7T23Z34DWLSTEAUKVBPHHBUE4E3EMZBAQSLV6ZHS764U3TKUSNJOF"; string expectedPrivateKey = "SA3HXJUCE2N27TBIZ5JRBLEBF3TLPQEBINP47E6BTMIWW2RJ5UKR2B3L"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(7); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
public void TestIndex6() { string expectedPublicKey = "GBY27SJVFEWR3DUACNBSMJB6T4ZPR4C7ZXSTHT6GMZUDL23LAM5S2PQX"; string expectedPrivateKey = "SDJ4WDPOQAJYR3YIAJOJP3E6E4BMRB7VZ4QAEGCP7EYVDW6NQD3LRJMZ"; var wallet = StellarHDWallet.FromMnemonic(mnemonic); var keyPair = wallet.GetKeyPair(6); Assert.AreEqual(expectedPublicKey, keyPair.PublicKey); Assert.AreEqual(expectedPrivateKey, keyPair.PrivateKey); }
static void Main(string[] args) { Console.WriteLine("-- Wallet from Mnemonic --"); var mnemonic = StellarHDWallet.GenerateMnemonic(dotnetstandard_bip39.BIP39Wordlist.English); var wallet = StellarHDWallet.FromMnemonic(mnemonic); Console.WriteLine("Public/Private Key"); var publicKey = wallet.GetPublicKey(0); var privateKey = wallet.GetPrivateKey(0); Console.WriteLine($"PublicKey: {publicKey},\nPrivateKey: {privateKey}"); Console.WriteLine(); Console.WriteLine("KeyPair"); var keyPair = wallet.GetKeyPair(0); Console.WriteLine($"Pair: \n{keyPair.PublicKey},\n{keyPair.PrivateKey}"); Console.WriteLine(); Console.WriteLine("Key Derivation"); var rawKey = wallet.Derive("m/44'/148'/0'"); Console.WriteLine($"Raw Key: {rawKey}"); Console.WriteLine(); Console.WriteLine("-- Wallet from Seed Hex Bytes--"); var seedHex = "794fc27373add3ac7676358e868a787bcbf1edfac83edcecdb34d7f1068c645dbadba563f3f3a4287d273ac4f052d2fc650ba953e7af1a016d7b91f4d273378f"; var seedHexBytes = seedHex.HexToByteArray(); var walletFromHexBytes = StellarHDWallet.FromSeed(seedHexBytes); var keyPairFromHexBytesWallet = walletFromHexBytes.GetKeyPair(0); Console.WriteLine($"Pair: \n{keyPairFromHexBytesWallet.PublicKey},\n{keyPairFromHexBytesWallet.PrivateKey}"); Console.WriteLine(); Console.WriteLine("-- Wallet from Seed Hex String--"); var walletFromHexString = StellarHDWallet.FromSeed(seedHex); var keyPairFromHexStringWallet = walletFromHexBytes.GetKeyPair(0); Console.WriteLine($"Pair: \n{keyPairFromHexStringWallet.PublicKey},\n{keyPairFromHexStringWallet.PrivateKey}"); Console.WriteLine(); Console.WriteLine("-- Mnemonic Lengths --"); Console.WriteLine($"21 Word:\n{StellarHDWallet.GenerateMnemonic(BIP39Wordlist.English, 224)}"); Console.WriteLine(); Console.WriteLine($"18 Word:\n{StellarHDWallet.GenerateMnemonic(BIP39Wordlist.English, 160)}"); Console.WriteLine(); Console.WriteLine($"12 Word:\n{StellarHDWallet.GenerateMnemonic(BIP39Wordlist.English, 128)}"); var chinese = StellarHDWallet.GenerateMnemonic(BIP39Wordlist.French); Console.ReadLine(); }