Skip to content

Commit 0e12f44

Browse files
committed
add private key generation
1 parent 39b6637 commit 0e12f44

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

LoopringSmartWalletPassphraseExtractor/LoopringSmartWalletRecoveryPhraseExtractor.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11+
<PackageReference Include="Nethereum.HdWallet" Version="4.15.2" />
1112
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1213
</ItemGroup>
1314

LoopringSmartWalletPassphraseExtractor/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using LoopringSmartWalletRecoveryPhraseExtractor;
2+
using Nethereum.HdWallet;
23
using Newtonsoft.Json;
34
using System.Security.Cryptography;
45
using System.Text;
@@ -65,7 +66,11 @@ static void QRCodeDecrypt(byte[] mnemonic, byte[] iv, byte[] salt, string passph
6566
byte[] result = new byte[decryptedBytes.Length - paddingLength];
6667
Array.Copy(decryptedBytes, result, result.Length);
6768
string decryptedMnemonic = Encoding.UTF8.GetString(result);
68-
Console.WriteLine("Your recovery phrase is: " + decryptedMnemonic);
69+
Console.WriteLine("Your recovery phrase for your owner wallet is: " + decryptedMnemonic);
70+
Wallet wallet = new Wallet(decryptedMnemonic, null);
71+
string walletPrivateKey = BitConverter.ToString(wallet.GetPrivateKey(0)).Replace("-", string.Empty).ToLower();
72+
Console.WriteLine("Your L1 private key for your owner wallet is: " + walletPrivateKey);
73+
6974
}
7075
catch(Exception)
7176
{

0 commit comments

Comments
 (0)