Questions tagged [nbitcoin]

A comprehensive Bitcoin library for the .NET framework.

Filter by
Sorted by
Tagged with
1 vote
1 answer
207 views

Transaction keep beeing rejected "non-mandatory-script-verify-flag"

I'm developping Bitcoin integration for Microsoft Dynamics Business Central to offer enterprise capability to apply Bitcoin receivable and payable to accounting. To send a transaction, I'm using ...
Maxime CATY's user avatar
2 votes
0 answers
49 views

Be notified when node rejects TX from mempool

I need to be notified on my C# backend implementing NBitcoin when my node detects a double spend and rejects a TX from its Mempool. Is there a RPC call or some kind of events that I can register to to ...
Turbolay's user avatar
  • 120
1 vote
0 answers
35 views

InvalidStackOperation for input

I've been trying to transfer BTC to another address but can't seem to get the transaction right. My address is https://www.blockchain.com/btc-testnet/address/mk3RhhbT1pGCtZnoYF856KpdsY1CdTmaNg var ...
Mihai Bratulescu's user avatar
1 vote
1 answer
119 views

NBitcoin in C# MVC App Gives Me A WitnessProgramMissmatch Error When I Try to Build The Transaction

I am writing tests for an app I built that uses NBitcoin to send bitcoin and make bitcoin transactions. I have the following code to create fake bitcoins for an integration test: private ICoin[] ...
ChristianOConnor's user avatar
1 vote
0 answers
59 views

Buy Bitcoin with NBitcoin c# Web App

I have been using the NBitcoin lib with c# to create a Bitcoin wallet app. I have pretty much sorted out the creation of the wallet and everything that this entails. What I need some help with is on ...
Michael Brooks's user avatar
1 vote
2 answers
1k views

Generate BTC Private key from user string input

I am looking to generate a Bitcoin Address from an user input text (like the good old days Brainwallet). User input a "Text string" and based on this text string generate the corresponding ...
Olivier Martin's user avatar
0 votes
1 answer
343 views

Generate public addresses (NBitcoin)

I'm trying to generate a public address and for that, I have the code: var key = new Key(); var wif = key.GetWif(Network.Main); Console.WriteLine($"WIF: {wif}"); var secret = new ...
Paulo Aboim Pinto's user avatar
0 votes
0 answers
118 views

How can I mine a block, in C#, on a new Testnet network where no other miners exist?

I want to demonstrate how to use NBitcoin or the most simple C# function to collect transactions for use in a block then sign that block submit it into the Bitcoin-QT network client on the RPC port? ...
makerofthings7's user avatar
1 vote
1 answer
182 views

Nbitcoin's BitcoinPubKeyAddress not recognizing native segwit addresses

I'm trying to build a transaction using Nbitcoin. When I run this line there is an error parsing the address. It runs fine with segwit addresses starting with a 1, but not native segwit. Using System; ...
Chiru's user avatar
  • 141
1 vote
0 answers
427 views

NBitcoin how to send a transaction?

The verification passed. But nothing happen after that. The balance in both accounts remain the same. Anything wrong in the way that I build my transaction? var fpk = new BitcoinSecret("<my ...
s k's user avatar
  • 175
0 votes
2 answers
84 views

NBitcoin how can I get notify when I receive coins?

I something like onCoinReceived in bitcoinj Example with bitcoinj
s k's user avatar
  • 175
-1 votes
1 answer
71 views

TransactionId Not working Second Time in NBitcoin and QBitNinja?

I am trying to send bitcon from my address to another address. i had 0.0024BTC in my wallet and then i performed a transfer using this article: https://programmingblockchain.gitbook.io/...
Yogesh Gautam's user avatar
0 votes
0 answers
101 views

How to Transfer Real BTC From My Wallet to another account using C#

Hi I wanted to send BTC from my wallet to another wallet through any C# Library. Currently i am using NBitcoin Library to perform this action. But, i am not able to get through it. Thanks
Yogesh Gautam's user avatar
0 votes
0 answers
224 views

Bitcoin payment gateways in c#

My question is about Bitcoin payment gateways and we can add their gateways to my site Like those sites (bitpay.com,https://gourl.io/), I want to create a bitcoin payment gateway in C# my question : ...
user2071969's user avatar
0 votes
1 answer
797 views

NBitcoin -- How do I just check the balance of my wallet from my seed phrase?

I've looked through the docs, I've Googled, I've searched here, and it all just seems like Greek to me... I must not be using the right keywords, because I just can't figure out what I think should be ...
encoder's user avatar
  • 103
0 votes
0 answers
36 views

In a closed, working test network, how would I generate a signed block that a Bitcoin miner would otherwise create?

I have a POC where the essential, critical, priority goal is to use C# and the .NET Core Framework (Bouncy Castle for crypto, or Microsoft primitives for BigInteger ) where I do the following Accept ...
makerofthings7's user avatar
0 votes
3 answers
2k views

Generate address of 'private key' from user input

I want to take a private key as input from the user and convert it to a wallet address using C#. I have seen this in a tutorial to generate a random key: Key privateKey = new Key(); PubKey publicKey = ...
svvc's user avatar
  • 21
2 votes
2 answers
1k views

What is needed to generate a bech32 address?

So I wrote a vanity address generator in c# with the NBitcoin lib. When I use the private key used to generate the address and input it in Mycelium it outputs a different address. This does not occur ...
Relaxo143's user avatar
0 votes
1 answer
178 views

NBitcoin Transaction sign(secret, bool) is giving error. Instead of bool it says to pass Coin Object

I am using NBitcoin (I'm new to it) to sign a transaction. Here Transaction sign(secret, bool) method is giving error. (I've searched the Internet, but got no help.) Instead of bool it says to pass ...
Abhishek Pandey's user avatar
0 votes
0 answers
56 views

How to recover bitcoin wallet from messed up seeds [duplicate]

I have a ledger nano s wallet that is broken , when i tried to recover wallet from 24 recovery word i got error that says the recovery phrase is incorrect, i think the place of some words is incorrect ...
M Taher's user avatar
1 vote
2 answers
419 views

How can I get all transaction for a specific address using Nbitcoin?

How can I get all transactions for a specific address using Nbitcoin?
user883509's user avatar
0 votes
1 answer
179 views

What is the signature digest for Segwit outputs

(Assume there's no OP_CODESEPERATOR) For standard P2PKH, the signature digest is generated this way: NewTransaction settle the TxOuts well set all TxIn scripts to empty insert the Previous Locking ...
gudako's user avatar
  • 159
0 votes
1 answer
53 views

Do transactions need to be signed

I always thought a transaction can be accepted when all its inputs are correctly provided with their unlock script (which usually contains a signature) ——yes transactions may also be rejected with ...
gudako's user avatar
  • 159
3 votes
1 answer
190 views

Why does a same transaction signed separately have different witness values?

I signed a bitcoin testnet transaction using nbitcoin library and got an output: ...
Akshay Dev's user avatar
2 votes
2 answers
7k views

Blockchain Explorer for local full node

I would like to build my own blockchain explorer because I have found that using the API's of 3rd party blockchain explorers only gives me around 2 or 3 requests per second. Does an open source ...
oshirowanen's user avatar
1 vote
1 answer
83 views

Send payment and message at the same time

I am using NBitcoin to write some code. I want to send some bitcoin to an address AND include a message with it. The message could say who the payment came from or why it was sent. According to the ...
ThirdPrize's user avatar
1 vote
2 answers
452 views

NBitcoin, how to implement wallet restoration? How does it work?

at first sorry for my ignorance, I have little experience at bitcoin programming. Im trying to implement a very simple wallet using NBitcoin library. I have done some work, but now Im stucked with ...
Martin Lipták's user avatar
1 vote
2 answers
394 views

Electrum's "script hash" form with NBitcoin?

I've come across how scripts are hashed in the electrum (stratum) protocol implementation by looking at the docs. I'm using NBitcoin, and I've tried to generate this hash from a segwit address, first ...
knocte's user avatar
  • 1,754
2 votes
1 answer
257 views

NBitcoin get signature, use spending P2SH transaction with non-standard script

After creating a new NBitcoin transaction (with a single pay-to-script hash input and multiple outputs), is there any way to calculate the transaction signature and manually put it in the inputs[0]....
BPFL's user avatar
  • 21
0 votes
1 answer
52 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 ...
Turgut Kanceltik's user avatar
3 votes
0 answers
462 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 { ...
Lolidze's user avatar
  • 161
3 votes
0 answers
2k 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(...
Lolidze's user avatar
  • 161
1 vote
1 answer
216 views

NBitcoin vs Bitcoin Core RPC

I initially thought NBitcoin was a wrapper for Bitcoin Core JSON RPC and that Bitcoin Core was the only way to communicate with the bitcoin network. But now that I've discovered it's not, I'm curious ...
ddrjca's user avatar
  • 125
2 votes
1 answer
512 views

Understanding a Wallet Restore

This is my first post on block chain related programming so please excuse my ignorance. I find the terminology in the BIP32 and BIP39 specs hard to understand so I'm trying to confirm my understanding ...
Christian Findlay's user avatar
3 votes
1 answer
163 views

NBitCoin Analyzing Blockchain

Maybe this question is utterly stupid, but I just don't get it: I am doing some POC work to understand the BitCoin network a little better and chose C# and the NBitCoin library as my implementation ...
AmbitiousScriptKiddy's user avatar
2 votes
2 answers
2k views

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

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'...
INNVTV's user avatar
  • 133
1 vote
1 answer
1k views

NBitcoin and Mnemonic Standards

I am very new to Bitcoin development so forgive me... I'm using NBitcoin in a .Net console app to generate a master key using a mnemonic and then derive hierarchical keys. Here is the code I am using: ...
INNVTV's user avatar
  • 133
3 votes
2 answers
2k views

How to sign a SegWit transaction via NBitcoin?

Most tutorials out there just show how to sign it in the legacy way. And I know that NBitcoin already supports SegWit, so is there a snippet out there on how to sign it this way?
knocte's user avatar
  • 1,754
2 votes
1 answer
3k 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 ...
Dr. David Bowman's user avatar
1 vote
3 answers
165 views

How can I integrate Bitcoin payments into my website created in C#?

I am new to Bitcoin. How can I integrate Bitcoin payments into my website which is designed using ASP.Net?
ajay sharma's user avatar
3 votes
1 answer
460 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,...
rosstripi's user avatar
  • 203
4 votes
0 answers
771 views

How to Use TransactionBuilder in NBitcoin

I have used this code. It returns a success, but does not send bitcoin. var txRepo = new NoSqlTransactionRepository(); // Let’s me introduce you, Alice, Bob, Satoshi, and Nico with their ...
Hitesh's user avatar
  • 51
4 votes
1 answer
1k views

How to run QBitNinja Server locally?

I have written a simple program that determines the available balance of a Bitcoin wallet, but it used the public API for QBitNinja at http://tapi.qbit.ninja, and everything is working fine, but I ...
Stephen MacDougall's user avatar
3 votes
3 answers
356 views

NBitcoin - how to set RBF to true in order to give higher fee for transaction

I have a few transactions staying unconfirmed - been a few days now. I suspect the minimum mining fee was upped - 15 minutes prior I was still doing hundreds of transactions a day at that fee - but ...
Peter PitLock's user avatar
2 votes
1 answer
694 views

How to confirm a payment was made?

I am planning to write a site that receive payments in Bitcoin. The client add products to the cart, then during check out I will create a Bitcoin address to let him pay for it (each cart gets a ...
Adi Wijaya's user avatar
2 votes
2 answers
611 views

How to get Master Chain Code

I'm using NBitcoin and I created an ExtKey object. Now I need to get the Master Chain Code (see page 89 of Mastering Bitcoin for a good explanation) for this HD node. How do I do this? According to ...
Leon Cullens's user avatar
7 votes
2 answers
8k 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 ?...
gideonlouw's user avatar
3 votes
1 answer
578 views

'The node is not in a connected state' error when trying to execute OP_RETURN transaction with NBitcoin

This is my first time trying out the NBitcoin library to create a transaction. I am trying to create an OP_RETURN transaction, but every time I try to execute the Version Handshake with the node I get ...
cfly24's user avatar
  • 101
7 votes
1 answer
773 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 ...
nopara73's user avatar
  • 806
7 votes
2 answers
7k 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 ...
Pa Ddy's user avatar
  • 71