Posts

Showing posts with the label blockchain

Query LOCAL Bitcoin blockchain with C# .NET

Image
Clash Royale CLAN TAG #URR8PPP Query LOCAL Bitcoin blockchain with C# .NET I am trying to check the balance of a given Bitcoin address by using ONLY the locally stored blockchain (downloaded via Bitcoin Core). Something similar to this (by using NBitCoin and/or QBitNinja), but without needing access to the network: private static readonly QBitNinjaClient client = new QBitNinjaClient(Network.Main); public decimal CheckBalance(BitcoinPubKeyAddress address) { var balanceModel = client.GetBalance(address, true).Result; decimal balance = 0; if (balanceModel.Operations.Count > 0) { var unspentCoins = new List<Coin>(); foreach (var operation in balanceModel.Operations) unspentCoins.AddRange(operation.ReceivedCoins.Select(coin => coin as Coin)); balance = unspentCoins.Sum(x => x.Amount.ToDecimal(MoneyUnit.BTC)); } return balance; } The example above needs access to the network. I need to do the same thing offline. I c...

Why its impossible to find private key with the public key

Why its impossible to find private key with the public key Based on this article: https://medium.com/coinmonks/private-and-public-key-cryptography-explained-simply-4c374d371736 For what I understand in the article, the public key is generated by performing `n' tangent + mirroring operations from G point (having G point defined at secp256k1 and begin n a natural number that directly relates to the private key) My question is: as I know the public key and the seed value `G', I could start a process computing G·G, G·G·G, and comparing those results with the public key value until it matches. If your answer would be that this process is very slow I have another question: If this process is slow, the same applies to, knowing the private key, and compute the public key (Because the operations are the same except for the check operation), so how it is possible to compute the public key in a very fast way? By clicking ...