Hot answers tagged

9

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) Then ...


4

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; if (balanceModel....


4

Testnet code has been modified to lessen the impact of fluctuations of hashing power mining against testnet: http://github.com/bitcoin/bitcoin/pull/686 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 ...


4

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 ...


4

Since "Bitcoin Cash" is a fork of Bitcoin Core, you should be able to use the BitcoinLib C# Library to interact with a Bitcoin Cash node.


3

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 ...


3

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; EDIT Found another, in your BigInteger to compact method: ret = ret << (...


3

You're looking for bignum_tests.cpp: BOOST_AUTO_TEST_CASE(bignum_SetCompact) { CBigNum num; num.SetCompact(0); BOOST_CHECK_EQUAL(num.GetHex(), "0"); BOOST_CHECK_EQUAL(num.GetCompact(), 0); num.SetCompact(0x00123456); BOOST_CHECK_EQUAL(num.GetHex(), "0"); BOOST_CHECK_EQUAL(num.GetCompact(), 0); num.SetCompact(0x01123456); ...


3

The base58 number 16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH is a base58Check encoding of the (compressed) public key: 030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a which corresponds toKwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh, and whose address is 16reZXagkyToongduimD25SEerXwP3MQ4n. Note that your private key is ...


3

Just found a SharpCashAddr library. Has pure C# implementation of address conversion in both ways.


2

Welcome 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 ...


2

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 ...


2

NBitcoin supports connection to the bitcoin network. NBitcoin Github : https://github.com/NicolasDorier/NBitcoin NBitcoin Nuget : https://www.nuget.org/packages/NBitcoin/ Intro : http://www.codeproject.com/Articles/768412/NBitcoin-The-most-complete-Bitcoin-port-Part-Crypt Stealth Payment, and BIP38 : http://www.codeproject.com/Articles/775226/NBitcoin-...


2

Have you guys see this recent GitHub? I too have been poking around looking for a standalone library. https://github.com/TangibleCryptography/BitSharper I have it downloaded, just trying to fix dependencies so I can compile. Looks promising.


2

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 ...


2

This was not a case of BitcoinLib malfunctioning in any way. It was simply a case of using wrong privkeys to sign the unspent outputs.


2

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 ...


2

////////////////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 ...


2

To a private key corresponds a unique public key. In your case, 16reZXagkyToongduimD25SEerXwP3MQ4n is an address (the hash + encoding of a public key).


2

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....


2

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,...


2

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 Edit: Nethereum has implemented it in C#: https://github.com/...


2

You could check https://github.com/Blockstream/esplora I think it ticks all of the boxes, I am not sure about the NBitcoin though.


1

Take a look at Blockparser: https://github.com/znort987/blockparser** It will let you parse blockchain data to verify balances (among other things)


1

You can find an example here. Specifically, see the first example where Alice sends bitcoins to Satoshi: Transaction aliceFunding = new Transaction() { Outputs = { new TxOut("0.45", alice.GetAddress()), new TxOut("0.8", alice.Key.PubKey) } }; Coin[] aliceCoins = aliceFunding .Outputs .Select((o,...


1

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.


1

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 essentially ...


1

API selection with other technology selection is having major dependencies on final goal. so you have to select the best suit of technology as per the business requirement.


1

string Query() { string url = "https://api.bitfinex.com/v1/balances"; string paramDict = "{\"request\":\"\\/v1\\/balances\",\"nonce\":\"" + GetNonce() * 100000 + "\"}"; string payload = EncodeTo64(paramDict); string message = payload; string skey = secret; System.Text....


1

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.


Only top voted, non community-wiki answers of a minimum length are eligible