Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

Pronounced "C-Sharp". A computer language developed by Microsoft.

0
votes
0answers
57 views
+50

Posting CREATERAWTRANSACTION via JSON-RPC via C#

UPDATE 1: I have changed the StringBuilder, and am now using objects and then serializing the object using Newtonsoft.Json. MY SECOND ATTEMPT TO USE THE API REFERENCE CODE FROM https://en.bitcoin.it/...
0
votes
2answers
37 views

Invoking the listunspent command via json-rpc on a full node

I am trying to use the following example code for C# programming, so I can connect to my own bitcoin full node: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#.NET_.28C.23.29 Which has resulted ...
0
votes
1answer
21 views

About Nbitcoin NodeBehavior

We wrote our transaction listener and we were implement the NodeBehavior class. But when I update version of NBitcoin v3.0.0.60 to v4.1.1.46 I can't use the NodeBehavior. Because Nbitcoin cannot ...
0
votes
0answers
66 views

Bitcoin/PIVX JSON-RPC and CURL just returns Unauthorized

No matter what I try, I cannot get a request to PIVX wallet / Blockchain Api. It works 100% in curl from CMD. curl --user user:pass --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"...
0
votes
1answer
67 views

Trying to understand parent fingerprint in HD wallets

I'm trying to implement a barebones HD wallet generator in C#. I'm starting with a mnemonic and derivation path m/0' and want to generate BIP141 p2wpkh-in-p2sh addresses. Obviously for the Master ...
2
votes
0answers
89 views

Nbitcoin node c#

Create a transaction to send money, then it needs to be "registered" in the system, before doing so : using (var node = Node.Connect(Network.Main, node_address))//, node_address { ...
1
vote
1answer
170 views

C# code for Bitcoin Cash address conversion between legacy and new format

I need to convert legacy Bitcoin Cash addresses to new format and back. I am aware of similar question, but it asks about PRC and has solution using python, JS. I need it done in C# with no ...
0
votes
0answers
381 views

QBitNinjaClient Get Balance c#

I generated 5 adresses 1KmjtM8aibtBqbPiJahYYEwcEAH2Duk9QH 1HV55k5erZrFA3SirFLULf1rTs4sKvvqQg 1B1Tx9wXVVmmySSDSFYekM7cy7xCTybEMg 1Py6rXFPepLa7nacuRhYsJWYcfFLYE6zkw 1GRHuGiHqtuLY3A6roH7fT9bjbbiG1foWM ...
1
vote
0answers
397 views

nbitcoin Get balance

Try to get balance : var bitcoinPrivateKey = new BitcoinSecret("xxxx"); var network = bitcoinPrivateKey.Network; var address = bitcoinPrivateKey.GetAddress(); var client = new QBitNinjaClient(...
1
vote
0answers
336 views

call JSON RPC API Using C#?

I am trying to call JSON RPS API Using C#. I have added my own IP address with its credentials. Before writing API in C#, I have installed Bitcoin on my server. Now, using the server details, i ...
0
votes
0answers
200 views

Testnet: ErrorCode: INVALID Error message: mandatory-script-verify-flag-failed (Operation not valid with the current stack size)

I am new to blockchain programming. Following the book blockchain programming in C# book, I am trying to make a transaction in c#. But I am facing an error while broadcasting the transaction and also ...
0
votes
2answers
392 views

C#, How can I actively query the crypto-market?

Are there any wrappers to get the real-time crypto-currency value similar to coincap.io? Right now I am using Json to deserialize a download string from CoinMarketCap, however, the api does not ...
0
votes
0answers
318 views

How to create Payment Request with callback in Bitcoin Core using RPC and C#?

I want to make bitcoin wallet with Deposit functionality. I need generate address where users need to pay. How do I know when is paid? I can know this only with callback but I don't know how to ...
0
votes
1answer
450 views

Creating Payment system using Blockchain API

I see a whole lot of websites using the blockchain API to create bitcoin wallets (if i am correct), send and receive payments, I know how to ordinarily make a payment system using C#/MSSQL or PHP/...
1
vote
1answer
416 views

C# library for exploring Bitcoin Cash blockchain

Does anyone know of a good C# library which would enable me to explore the Bitcoin Cash blockchain by communicating with my own node? Something like Nethereum (Web3) for Ethereum. Or, alternatively, ...
1
vote
1answer
246 views

Can't RPC to Bitcoind (C# / Windows)

I am running a node on Windows Server 2016. Everything seems to be running fine. If I go to https://bitnodes.earn.com/ and put myip:8333, the node is successfully reachable. My bitcoin.conf is: ...
0
votes
0answers
348 views

Coinpayments transaction not happening

I was referring the following link to make a transaction through my test faucet. Link The api calls for transferring (LTCT) as made through following line of code var purchase = await ...
2
votes
1answer
788 views

Using NBitcoin or C# to derive Litecoin and Ethereum Addresses from Master HD Key

I am using NBitcoin, C# and the Bip44 standard to create an hdroot to derive child keys from. I then create keys that I want to use for Litecoin and Ethereum addresses by setting the proper 'coin_type'...
1
vote
0answers
158 views

Creating HD wallets with BouncyCastle in C#?

I'm trying to write a class that can be used to generate public/private key pairs for bitcoin (and any of its 'clones'), I found some code elsewhere that uses BouncyCastle to generate keys, here's the ...
1
vote
0answers
454 views

How can I see the wallet balance using Blockchain Api? C#

Stupid question, but I cant get it So, then I type my wallet adress on blockchain.info I immediately can see my balance, but from my project I can't type something like: WalletAddress wa = new ...
2
votes
1answer
2k views

NBitcoin: signing a transaction in TestNet

I am using the NBitcoin Library to program a simple Bitcoin Transfer Program in C#. The Program will take the coins from a Transaction ID and then Transfer it to a Destination Wallet Address The ...
3
votes
1answer
316 views

How to determine if transaction is going to propagate?

So I am creating a transaction using TransactionBuilder like this: var builder = new TransactionBuilder(); Transaction tx = builder .AddCoins(coins) .AddKeys(privateKeys) .Send(recipientAddress,...
4
votes
2answers
670 views

Is the generated Public Key from Private Key Unique in Bitcoin?

I am generating public key from my private key. I did in Java script and C#. but generated public keys are different. My Code in c# (KeyCore.NET): PrivateKey pv = new PrivateKey(Globals....
2
votes
1answer
640 views

C# BC, successfully creating and signing raw transaction

First time on stackexchange to ask for help, sorry if i make mistakes (english is not my native language). I try to create a valid raw transaction on C# with bouncycastle and i seems stuck, not able ...
4
votes
3answers
2k views

How to get the bitcoin balance of a public key in C#?

How can I get the bitcoin balance of a public key in C#? E.g. for this public key: 1FqLoEpbQpMxow5bqEPpFbPVnBEbFcsg3J How can I get its balance in C#?
6
votes
2answers
4k views

How can i send bitcoin using c# and the nbitcoin library?

I am using NBitcoin library to create my private keys and addresses, but I can't find an example of how to send Bitcoin. Does anyone have a c# example code to send Bitcoin using the NBitcoin library ?...
1
vote
0answers
314 views

How to add parameters like “-regtest=1” to a JSON-RPC call in C#?

I'm trying to modify the CoiniumServ codebase ( https://github.com/int6/CoiniumServ ), so it supports bitcoind in regtest mode. I know using bitcoin-cli you need to add -regtest to the bitcoin-cli ...
1
vote
0answers
721 views

Creating publicKey from random programtically in c#

I've been looking around I can't understand or find a complete explanation of how to accomplish this, I've tried multiple way even this link How do you get a Bitcoin Public Key from a Private Key ...
0
votes
0answers
195 views

bitcoinlib 'There was a problem sending the request to the wallet'

I've configured the bitcoin.conf and web.config file in visual studio to match, and I keep getting the above exception, also getting this when I run it... 'No connection could be made because the ...
3
votes
2answers
489 views

Sender address from DecodeRawTransaction (C#)

I'm trying to get the senders address using the Bitcoin JSON RPC in C#. So I GetRawTransaction and then use the DecodeRawTransaction method to return my JSON object. I can see in the 'vout' of this ...
7
votes
1answer
695 views

Which language has better Bitcoin API experience, C# or Node.js?

At the moment it seems to me on the .NET side NBitcoin would compete with Bitcoin.js on the other. Update: I decided on NBitcoin. It has a great book to learn from. Note I will not form opinion on my ...
7
votes
2answers
4k views

C# parse bitcoin blockchain to get balance of an address

Is there a way to scan the Bitcoin blockchain in C# without using an external API? I am looking for the amount of spendable money of a Bitcoin address. I am using NBitcoin. // create new key pair ...
4
votes
2answers
2k views

How to use NBitcoin for BIP32 wallets

I'm using c# NBitcoin to generate master key at an offline server ExtKey privateKey = new ExtKey("[My seed]"); ExtPubKey pubKey = privateKey.Neuter(); I will need to give the online server the ...
3
votes
2answers
1k views

How to generate a Litecoin Private key and correspondent Public Address in C#

I found this C# tool to generate addresses for Bitcoin (compressed and uncompressed): https://en.bitcoin.it/wiki/Bitcoin_Address_Utility https://github.com/casascius/Bitcoin-Address-Utility It ...
0
votes
2answers
809 views

Bitfinex 400 error

string url = @"https://api.bitfinex.com/v1/balances"; string paramDict = "{\"request\": \"/v1/balances\",\"nonce\": \"" + GetNonce() * 10000 + "\"}"; string payload = Convert....
1
vote
1answer
311 views

c# BitcoinLib: GetRawTransaction verbose=1 does not work

I want to find out confirmation number for non-wallet transaction. When I use CoinService.DecodeRawTransaction(CoinService.GetRawTransaction("...
1
vote
1answer
316 views

Matching KeyPath in application with Wallet32 Keypath for Bip44 wallets

I have an application where I create an HD wallet with a passphrase and save the public master key to the database for the user. Then, I want the user to be able to back up the wallet to their own ...
2
votes
2answers
596 views

Options for a Client Only C# application

If I want to create a client only, C# desktop application, what are my options for working with Bitcoin? I could try to port BitcoinJ, which seems like a lot of overhead in terms of initial effort ...
1
vote
1answer
327 views

What encoding is “pubkey” from the JSONRPC validateaddress command?

I need to convert a public key into a form suitable for use with BouncyCastle. To do this I open the debugger and write: ListAddressGroupings I then pick an address and write validateaddress ...
4
votes
1answer
1k views

JSON-RPC signrawtransaction returns false when using private keys

I've been working with BitcoinLib testing various parameters on the signrawtransaction rpc call. It's been mostly successful, however there seems to be a persisting problem when using only private ...
1
vote
0answers
263 views

Mt.Gox API v2 with C# - authentication problem 403

I'm trying to access the Mt.Gox API v2 via C# and HTTP requests. I've put together the following code based on various examples I found online (e.g. the nitrous documentation). private string ...
1
vote
0answers
3k views

C# - JSON-RPC - How to build the json object before serialization (createrawtransaction)

I am trying to build a C# application working on JSON-RPC with Bitcoin-qt (server mode). I am using Bitsharp, though I don't think this should matter at all. First off the InvokeMethod: ...
1
vote
1answer
671 views

Coinbase IPN test page not posting data?

On Coinbase under Merchant Profile I'm entering the URL: https://www.scirra.com/handlers/coinbasecallback.ashx For the IPN tester. This ashx page has the code: var r = ""; foreach(string name in ...
1
vote
1answer
361 views

MtGox http api “trades since” requests keep being timed out

i wrote a simple function to retrieve trades from mtgox with following HTTP API call: https://data.mtgox.com/api/1/BTCUSD/trades?since documented here: https://en.bitcoin.it/wiki/MtGox/API/HTTP/v1#...
2
votes
2answers
4k views

MtGox websockets api returning “400 Bad Request”

I want to get started with the Mt. Gox websockets API, but I can't seem to get a good response from the server. I'm sending the following (captured with Wireshark): GET /mtgox HTTP/1.1 User-Agent: ...
2
votes
0answers
905 views

bitcoind 400 bad request - what's wrong with this code?

As per this code sample, I'm attempting to make a .net httpwebrequest from my local machine to a local bitcoind -daemon server. However, I'm only receiving a 400 bad request at webRequest.GetResponse()...
3
votes
1answer
1k views

What is wrong with this C# code that converts a block's bits into a target?

UPDATE: The code in this question works for all test cases (Hurray!) however I don't like how GetCompact uses the Math.Abs function and don't think it's true to the OpenSSL implementation. Fixing ...
2
votes
1answer
178 views

Looking for unit testing data for Block.Bits to & from a JSON-RPC string

I'm trying to convert the JSON-RPC result of a Block's compressed bits property into a C# float with the following constraint //3 bytes mantissa, the leading byte as exponent (where only the 5 ...
8
votes
6answers
8k views

Are there any C# Bitcoin libraries and/or mining pool software packages?

I was keen to write/launch a .Net pooled mining server as an exercise of getting into the Bitcoin universe. Are there any C# ports of the libraries needed to achieve this? If not Are there any ...
3
votes
1answer
3k views

How do I Base58 Checked encode / decode an address in C#? What does “normalize leading zeros” mean?

I am trying to encode and decode a Base58 address in C#. The following function is a start, but it has a few issues: This code does not normalize leading zeros (what does that look like?) If this ...