using System.Collections.Generic;
static void Main(string[] args)
BigDecimal.Precision = 5000;
List<int> listaInt = new List<int> { 54 };
List<string> addresses = new List<string> { "16RGFo6hjq9ym6Pj7N5H7L1NR1rVPJyw2v" };
Random random = new Random();
string maxExample = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140";
List<BigDecimal> privateKeyList = new List<BigDecimal>();
foreach (int NUM in listaInt)
double d = random.NextDouble() * (0.288 - 0.111) + 0.111;
Console.WriteLine($"z found: {z}");
Console.WriteLine($"y found: {y}");
Console.WriteLine($"x1 found: {x1}");
Console.WriteLine($"x2 found: {x2}");
BigDecimal misecret1 = new BigDecimal(Math.Pow(2, x1));
BigDecimal misecret2 = new BigDecimal(Math.Pow(2, x2));
privateKeyList.Add(misecret1.WholeValue);
privateKeyList.Add(misecret2.WholeValue);
Console.WriteLine($"misecret1 found: {misecret1.WholeValue}");
Console.WriteLine($"misecret2 found: {misecret2.WholeValue}");
foreach (var keyI in privateKeyList)
BigInteger bigInteger = BigInteger.Parse(keyI.ToString());
string hexadecimalValue = bigInteger.ToString("X");
Console.WriteLine($"hexadecimalValue found: {hexadecimalValue}");
string hexadecimal = hexadecimalValue.PadLeft(maxExample.Length, '0').ToLower();
byte[] privateKeyBytes = Enumerable.Range(0, hexadecimal.Length).Where(x => x % 2 == 0).Select(x => Convert.ToByte(hexadecimal.Substring(x, 2), 16)).ToArray();
Console.WriteLine($"privateKeyHex found: {hexadecimal} bigInteger found: {bigInteger}");
if (privateKeyBytes.Length > 32)
byte[] trimmedPrivateKeyBytes = new byte[32];
Array.Copy(privateKeyBytes, privateKeyBytes.Length - 32, trimmedPrivateKeyBytes, 0, 32);
privateKeyBytes = trimmedPrivateKeyBytes;
else if (privateKeyBytes.Length < 32)
byte[] paddedPrivateKeyBytes = new byte[32];
Array.Copy(privateKeyBytes, 0, paddedPrivateKeyBytes, 32 - privateKeyBytes.Length, privateKeyBytes.Length);
privateKeyBytes = paddedPrivateKeyBytes;
var privateKey = new Key(privateKeyBytes);
string privateKeyHex = privateKey.ToHex();
BigInteger privateKeyBigInt = BigInteger.Parse(privateKeyHex, System.Globalization.NumberStyles.HexNumber);
Console.WriteLine($"privateKey found: {privateKeyBigInt}");
PubKey publicKey = privateKey.PubKey;
BitcoinAddress bitcoinAddress = publicKey.GetAddress(ScriptPubKeyType.Legacy, Network.Main);
Console.WriteLine($"Address found: {bitcoinAddress} privateKeyHex found: {hexadecimal}");
if (addresses.Contains(bitcoinAddress.ToString()))
BitcoinSecret mainNetPrivateKey = privateKey.GetBitcoinSecret(Network.Main);
string textToWrite = $"Private Key: {privateKey}\nAddress: {bitcoinAddress}\nWIF: {mainNetPrivateKey}\n";
string filePath = "found_addresses.txt";
File.AppendAllText(filePath, textToWrite);
Console.WriteLine($"Address found: {bitcoinAddress} Private Key: {privateKey} WIF: {mainNetPrivateKey}");