Author

Topic: problem sending raw tx via bicoind (Read 1051 times)

hero member
Activity: 714
Merit: 662
May 30, 2014, 10:59:04 AM
#17
doof, for information

I created https://github.com/NicolasDorier/NBitcoin which has a RPCClient. (available through Nuget)
It is the most complete .NET lib on Bitcoin, and even more complete than BitcoinJ.
Hope it will be useful for you in the future.
hero member
Activity: 765
Merit: 503
May 17, 2014, 06:51:17 AM
#16
Thanks heaps guys!  Deleting wallet.dat worked!!
member
Activity: 229
Merit: 13
May 16, 2014, 04:36:03 AM
#15
hosts from my log
Code:
connected 23.239.17.57:18333
connected 85.153.13.35:18333
connected 162.242.155.221:18333
connected 83.238.60.78:18333
connected 188.226.139.138:18333
connected 184.107.180.2:18333
connected 5.9.2.145:18333

http://test.webbtc.com/tx/fbbba408cf505ea91e639d266f2425ac2ee83702ff7e4431df193b3ee0567177
sent ~50 testbtc to http://test.webbtc.com/address/mfh6ShtWWoTpYT2daZQKNtjDZq52LhgMw2

hope it helps

PS. I do not need testcoins right now and I am ready to share them with everyone who really needs them in testing
hero member
Activity: 765
Merit: 503
May 16, 2014, 04:21:34 AM
#14

So,
1) backup your existed wallet.dat (several times) [do not forget to shut down bitcoind before it]
2) remove wallet.dat
3) recreate empty wallet.dat - your local bitcoind installation will be only a proxy without keeping db of transactions
4) USE TESTNET. Let me send you some test btc. Just give me address
5) restart bitcoind each time after unsuccessful push tx into network to clear local memory-pool


I have a few VMs with empty wallets, so backup isn't too important.
hero member
Activity: 765
Merit: 503
May 16, 2014, 04:19:30 AM
#13
test net address mfh6ShtWWoTpYT2daZQKNtjDZq52LhgMw2

not finding any active connections though.
member
Activity: 229
Merit: 13
May 16, 2014, 02:04:18 AM
#12
Quote
>> 1) you should not split hex-representation to smaller pieces"
What do you mean by this?

Sorry, but I have to say that sending this tx was [possibly] done by me.
I've just copied from this thread your data, pasted it to editor, removed spaces and executed "sendrawtransaction" in bitcoin-qt consone. Oups! It was gone to the network!

May be it is a bug of my browser or this forum engine, but the transaction in editor was splitted and separated by spaces
01000...9010000008B....4F8650221...104C705D4C....361C

Quote
Also the sending address does not exist in the btc wallet of the node im sending from.  I am using blockexplorer to get the collection of utxo's, then creating the signature in c#

I advise use blank wallet.dat for experiments and restart bitcoind after each try.
Because bitcoind attempts to re-send not confirmed transactions for a while.

For example your first try was to send 0.001 btc from "A" to "B" (spending utxo xxxx:x ) with fee=0
Your local bitcoind passed this tx to network and keeped it in memory-pool
But the transaction was rejected by your peers (reason: dust, not enough fees, low priority etc)
You do not see this tx on network, you see that utxo xxxx:x is uspent,
but now you are not able to spend the same utxo, because your local bitcoind rejects double-spending

Quote
The sig seems valid, as it works in the blockchain.info send tx function
blockchain.info did not receive your first tries

So,
1) backup your existed wallet.dat (several times) [do not forget to shut down bitcoind before it]
2) remove wallet.dat
3) recreate empty wallet.dat - your local bitcoind installation will be only a proxy without keeping db of transactions
4) USE TESTNET. Let me send you some test btc. Just give me address
5) restart bitcoind each time after unsuccessful push tx into network to clear local memory-pool



hero member
Activity: 765
Merit: 503
May 15, 2014, 10:35:06 PM
#11

All of the above wrappers should work without a problem, I can definitely guarantee that the last one (BitcoinLib) handles raw transactions flawlessly so please follow @apxu's instructions and give it another go.

Thanks

"1) you should not split hex-representation to smaller pieces"

What do you mean by this?  Also the sending address does not exist in the btc wallet of the node im sending from.  I am using blockexplorer to get the collection of utxo's, then creating the signature in c#

The sig seems valid, as it works in the blockchain.info send tx function
member
Activity: 66
Merit: 10
May 15, 2014, 10:10:21 PM
#10

All of the above wrappers should work without a problem, I can definitely guarantee that the last one (BitcoinLib) handles raw transactions flawlessly so please follow @apxu's instructions and give it another go.
hero member
Activity: 765
Merit: 503
May 15, 2014, 08:32:47 PM
#8
Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

is it yours?
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb?format=hex
output: 0.0001 BTC
fees: 0.048921 BTC  Shocked

1) you should not split hex-representation to smaller pieces
2) your local bitcoind should have all inputs - wait for new block and check that previous tx has at least 1 confirmation before spending it
3) USE TESTNET! (I've asked for your testnet address twice!)


No, and oops!  Oh well, $20 mistake.  I've tried so many combinations now.   Yes yes, I will get test net sorted on the weekend.  Fulltime job and 2year old sucking up my free time.
member
Activity: 229
Merit: 13
May 15, 2014, 01:34:58 PM
#7
Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

is it yours?
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb?format=hex
output: 0.0001 BTC
fees: 0.048921 BTC  Shocked

1) you should not split hex-representation to smaller pieces
2) your local bitcoind should have all inputs - wait for new block and check that previous tx has at least 1 confirmation before spending it
3) USE TESTNET! (I've asked for your testnet address twice!)
member
Activity: 66
Merit: 10
May 15, 2014, 11:43:22 AM
#6
@doof which C# wrappers did you use for your test?
hero member
Activity: 765
Merit: 503
May 15, 2014, 01:40:56 AM
#5
Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

0100000001D0C5B9AE52B005C51930C3C63F46DABB9B6D5BE78A244B36D5E0CA29CB3A3C6901000 0008B48304502201C779DF47F3729B20CC127F6B69D035B674F55776B7846D8E8A9384D7D54F865 022100A24EF078FC35121EA3C5525BEB51C7865ED80416391A3F87A23C9AAAC96DEA37014104C70 5D4C7D65CB9CF1F71A31A998E9D3BB4AF6C5ED435B12C9359EFFC471F02351D2515E07E36E2361C 176E489FD844C70294C5E9EEB237E840C3B7ED200A3B3AFFFFFFFF0110270000000000001976A91 48D985E4CFE89AAD0C411BE3B512D097CACB484AF88AC00000000
hero member
Activity: 765
Merit: 503
May 15, 2014, 01:13:40 AM
#4
Steps I have tried to fix so far:

Create smaller signed tx with only 1 input
Change the amount to be sent value to a 0.01btc incase there was a size / fee limit
Increase the fee size

This was a previously successful tx https://blockchain.info/tx/4c5c3345d3d500269d0c0bed6b286cd1378e7e6749b9eb975d0394197aa9d71a
hero member
Activity: 765
Merit: 503
May 15, 2014, 01:03:16 AM
#3
Your program should be checking the error codes returned by bitcoind, because if it did, you would know that the reason it's failing is because the transaction is already in the blockchain (error code 5). You can't send a transaction that's already confirmed; all synchronised nodes already have it, so there's no point.

Sorry, i should have explained that better.  This is the one I created and tried to send via 2 different c# wrappers.  After failing via bitcoind I validated it using brain wallet and pushed it via blockchain.info successfully, to prove that it was indeed a valid signed TX.

The only error I get back from bitcoind is a 500 error.

I have previously sent tx via the same c# lib / bitcoind, however, all attempts now fail.
legendary
Activity: 4542
Merit: 3393
Vile Vixen and Miss Bitcointalk 2021-2023
May 14, 2014, 11:14:03 PM
#2
Your program should be checking the error codes returned by bitcoind, because if it did, you would know that the reason it's failing is because the transaction is already in the blockchain (error code 5). You can't send a transaction that's already confirmed; all synchronised nodes already have it, so there's no point.
hero member
Activity: 765
Merit: 503
May 14, 2014, 05:12:57 PM
#1
I have tried with a few c# wrappers, posting raw tx to bitcoind 0.9.1.

I previously had it working with a simple, one input tx, however, I can no longer successfully broadcast tx's.  Other bitcoind rpc calls work, so Im confident the node is configured correctly.  I've created the below signature via brain wallet, and it fails too.  Broadcasting via block chain.info push tx work though.

Any reasons why it wouldn't work via bitcoind?

0100000003b5adf6c671f83638e41e8e33d748f3ad0f0001c8f4c6d6ff30fd87f41729401801000 0008b48304502210098caad4ab3dc0feeb1f42ed7de3e8ec54e76d994ab093f05189a154b76dea4 ef0220687d8fee22fe43424999e851ed9363bd6817cf0b71d4069e6b2b1ab1aed88c0e014104c70 5d4c7d65cb9cf1f71a31a998e9d3bb4af6c5ed435b12c9359effc471f02351d2515e07e36e2361c 176e489fd844c70294c5e9eeb237e840c3b7ed200a3b3affffffff0d4a53d1a3ed3ffc57b6c8a5c 6ef9e7fe6dd18ae95ed7a596c74f18c2189370d010000008a4730440220625289ae4741010d8007 5d1abda4b0ae76e1100858dc032bc9ff091baa940eed02202ad030ecdab49a39bf97ae7e67ce009 9520877d1469f553c86ecb6574f871902014104c705d4c7d65cb9cf1f71a31a998e9d3bb4af6c5e d435b12c9359effc471f02351d2515e07e36e2361c176e489fd844c70294c5e9eeb237e840c3b7e d200a3b3affffffff8c0a8883b755a1d7293db5afd0bc6c549e1b6e647adde12b2091ef115a18cf 8a000000008b483045022005e9d0f2fc19af2af161eff5ab8456de2419664bdefd86979e3949282 35797c1022100b69de453350fbfc77da395966cf84952eb45f7cead9f784b7f06bbbe325a210001 4104c705d4c7d65cb9cf1f71a31a998e9d3bb4af6c5ed435b12c9359effc471f02351d2515e07e3 6e2361c176e489fd844c70294c5e9eeb237e840c3b7ed200a3b3affffffff02a086010000000000 1976a9148d985e4cfe89aad0c411be3b512d097cacb484af88acd4cc4a00000000001976a914a80 25359c5d54cb6414fc86933984624fbc5cca088ac00000000
Jump to: