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;
signing with Segwit is in no way different from signing with P2SH or P2PKH.
If you want interoperability, you need to use Segwit wrapped into P2SH. Please check https://programmingblockchain.gitbooks.io/programmingblockchain/content/other_types_of_ownership/ for more info.
But in a nutshell, if you want to have a P2WPKH-PS2SH (Segwit P2PKH wrapped into ...
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,...
Am I using hardened private derivation function?
No. You're using nonhardened derivation. That's the only kind of derivation that you can use when you only have the public key.
Hardened derivation looks like this:
BitcoinAddress address = privateKey.Derive(orderID, true).Key.PubKey.GetAddress(Network.Main);
It requires the private key. It also doesn't ...
////////////////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 ...
You aren't doing anything wrong. You just need to be able to handle those duplicate transaction ids. It actually happens a few times before BIP 30 went into effect making such duplicate txids invalid.
These duplicates happen because the coinbase transaction in two different blocks can be exactly the same, so they have exactly the same txid. This is because ...
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/...
The mnemonic standard is BIP 39, and that is not the problem. The problem is the derivation paths.
Exodus, Jaxx, Coinomi, and many other wallets use the BIP 44 specification for deriving keys. This means the m for those wallets is actually the key at the path m/44'/0'/0'. However in your code with NBitcoin, you are using direct BIP 32 paths, so your m is ...
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 ...
NBitcoin just follow BIP125
public bool RBF
return Inputs.Any(i => i.Sequence < 0xffffffff - 1);
If you are using the TransactionBuilder for creating a transaction, you have two ways:
One is to use TransactionBuilder.SetLockTime(blockHeight) where block height is the currentHeight-1 (actually, if you put 0 it will be ...
I'm not sure about Nbitcoin node's API, but I could help you on a blockchain explorer API.
I would recommend Blockr.io, they are fast and trustable. Use the following code to check for confirmed transactions: (output is in json)
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
I think the problem is that there is only OP_RETURN, I remember seeing in the Bitcoin code that only OP_RETURN without anything else is forbidden.
Except that, your code looks like what is in my book
https://blockchainprogramming.azurewebsites.net/ so I'm almost sure it is the problem.
EDIT : You are crashing during Handshake, can you check Node....