Hot answers tagged

10

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

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

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


3

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


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

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


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

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

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

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 can use my blockchain parser (python script) that converts the local copy of blockchain (blkXXXXX.dat files) to human readable text view -> my parser Bases on this parser you can do anything you want with that data.


1

The issue is that you are sending the 1000 parameter as a string, not as a number. The JSON type when the RPC server receives it will be a string, which is incorrect. It does not convert this to an integer implicitly so you need to explicitly set the type. So instead you should be doing: JObject data = JObject.Parse(RequestServer("listunspent", new List<...


1

It's ripemd160(sha256(parentpriv)) also known as hash160(parentpriv) source. There is also a python implementation here


1

If you're looking for more than just price data, Coinigy is another option. https://www.coinigy.com/ I found their API easy to implement and very reliable and they covered all the exchanges I was interested in.


1

The question is pretty general in that you may be using Blockchain API in the generic way. Blockchain.info is a company that provides an API to use on the Bitcoin network. If you want to write applications using that API can read about it here. https://blockchain.info/api/ Along with that API you could look into other services like BitPay or even Stripe ...


1

I do not understand why some samples use port 8332, some 8333, etc. Port 8333 is the port that bitcoin uses to connect to other nodes on the network. Port 8332 is the default port for a bitcoin RPC interface. To connect with RPC, use port 8332 or specify a different port with rpcport=<port> option


1

I have found your transaction here: 12e548ababf06160486f91bfa2a406f131631258b2db025eb36bcd5230a70524 It was successfully created, signed and submitted. I can also see a message that you added in. There are a few things I picked up that are different when I look into the transaction vs how you built it up. The address that is derived from that private key ...


1

The signature you produced is correct but for a wrong "message", which is the only mistake that I could find. This is what you sign: f64b6480a2888596636d4995153e990ce95582a1308c9c568d2698e6dc1f7893 Which is wrong (since you reversed the has result). Instead you should have signed the actual result you get from your SHA256(SHA256(<bytes>)) to your ...


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


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