when you are doing
BitcoinAddress address1 = **pubKey**.Derive([some client data]).PubKey.GetAddress(Network.Main);
You are getting the bitcoin address, but not the master public key. (ExtPubKey)
A HD pub key have more information than just the pubkey.
The correct code is
string wifStr = **pubkey**.Derive([some client data]).ToString(Network.Main)
How about running a QBitNinja server locally?
var client = new QBitNinjaClient(baseAddress:"specify host here, you probably want localhost", Network.TestNet);
var balanceModel = client.GetBalance(dest: [Add any IDestination here, like new BitcoinAddress("mivD5GHroixrzgjv6Ww73pV5R55PcL8JdM", Network.TestNet)], unspentOnly: true).Result;
Testnet code has been modified to lessen the impact of fluctuations of hashing power mining against testnet:
If you wish to test against your own testnet, or think you might interfere with others needlessly, then Testnet-In-A-Box is for you.
Now this doesn't mean you shouldn't use Testnet -- especially if you ...
I use the Newtonsoft.Json.Linq library as shown below to get the data. Soon, I'll be posting Strongly typed C# client libraries at http://www.coinapi.net
The main trick to getting the JSON error code is to call GetWebResponse() again in the catch method. Then return and parse the data. I've debated about including the WebException itself in the return ...
That's odd, since BAU's docs say that they ought to work with Litecoin. In the drop-down menu that selects the coin type, have you selected Litecoin?
Alternately, if you're willing to run an RPC node, you could use BitcoinLib, and call CoinService.GetNewAddress(String).
Generally, it's exactly the same as generating Bitcoin addresses, except that the ...
Here's one thing I'm pretty sure is a bug, in your compact to BigInteger method:
ret = ret << (int)amountToShift;
amountToShift = 8 * (size - 3);
Ought to be:
amountToShift = 8 * (size - 3);
ret = ret << (int)amountToShift;
Found another, in your BigInteger to compact method:
ret = ret << (...
The base58 number 16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH is a base58Check encoding of the (compressed) public key:
which corresponds toKwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh, and whose address is 16reZXagkyToongduimD25SEerXwP3MQ4n. Note that your private key is ...
1) Here's an old project to start from
2) Here is the Bitcoin.it wiki entry on pool servers, including the derelict PoolServerJ
Mining is changing radically right now, with new hardware technology (ASICs) soon to be delivered which will likely increase the network hashrate by some orders of magnitude in the coming months. As a result, the ...
To normalize leading zeros is documented in this link, namely this text at the bottom:
In a standard base conversion, the 0x00 byte on the left would be
irrelevant (like writing 052 instead of 52) but in the BTC network the
left most zero chars are carried through the conversion. So for every
0x00 byte on the left end of the binary address, we will ...
Have you guys see this recent GitHub? I too have been poking around looking for a standalone library.
I have it downloaded, just trying to fix dependencies so I can compile.
The public key is in the format returned by OpenSSL and is a straight hex-encoding of the bytes. If the first byte is 0x04, then it is a 65-byte uncompressed key (32-byte X and 32-byte Y). If the first byte is 0x02 or 0x03, it is a 33-byte compressed key (32-byte X and one bit for Y sign).
The recID is encoded as part of the signed message. Check the ...
You should basically never choose FIPS-140 unless you have no choice. FIPS-140 compliance is provided primarily for people who must comply with FIPS-140 for regulatory or policy reasons.
Note that that's not to say FIPS-140 validation is bad. It's great. If it finds bugs or problems, that's a pure win. If you have a choice between an implementation that has ...
////////////////1st offline SERVER//////////////////
//Create Master Private Key with a seed
ExtKey privateKey = new ExtKey("16236c2028fd2018eb7049825e6b4f0191de4dbff003579918de7b7348ff06ac");
//create master public key from this privateKey
ExtPubKey pubKey = privateKey.Neuter();
//save it's wifStr as key to the next server to use and generate all child keys ...
If you are ok with a third party service check out the Blockchain API.
They have a C# library and it's fairly easy to use.
If you need only the balance of an address you can use the code below as described on their BlockExplorer page:
// calculate the balanace of an address by fetching a list of all its unspent outputs
var outs = blockExplorer....
Verify() verifies if the transaction is properly signed.
Since Verify() doesn't really tell us if a transaction will successfully propagate
It is either untrue or you found a bug.
node.SendMessage(new TxPayload(tx)); should be perfect. However Stratis is currently building a Bitcoin .NET fullnode, with the lead of Nicolas Dorier, NBitcoin's creator,...
Not sure how NBitcoin works, but it looks like so far you have derived your private and public key, you now need to hash it in the Ethereum method rather than the bitcoin way.
Look at step 3 in this answer: https://ethereum.stackexchange.com/questions/3542/how-are-ethereum-addresses-generated
Nethereum has implemented it in C#: https://github.com/...
You can find an example here.
Specifically, see the first example where Alice sends bitcoins to Satoshi:
Transaction aliceFunding = new Transaction()
new TxOut("0.45", alice.GetAddress()),
new TxOut("0.8", alice.Key.PubKey)
Coin aliceCoins = aliceFunding
You can use BitcoinLib's GetTransactionSenderAddress method, however it is important that you understand that this is a hack, as bitcoin's protocol doesn't support a "sender's address", and will only work for fat clients such as bitcoin-core etc.
The quote below is taken from my answer to How to implement a game like SatoshiDice? What you are looking for is addressed in this portion of my answer below.
Get the customer amount and payment address
Call bitcoind getrawtransaction [The incoming transaction ID] 1. The 1 at the end will return the data in "verbose mode", which
RPC decoderawtransaction doesn't return a confirmations field so yes, you should use getrawtransaction in its verbose mode instead.
I called BitcoinLib's GetRawTransaction for the tx in question and I got a proper response, as expected:
Please make sure you have BitcoinLib's latest version and that your wallet is synched and indexed.