Author

Topic: Bitcoind sendrawtransaction / blockchain.info/pushtx (testnet) (Read 2831 times)

legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Yeah thanks, great idea!

The result is quite clear:
Quote
ERROR: CScriptCheck() : f853d2c31e VerifySignature failed
ERROR: CTxMemPool::accept() : ConnectInputs failed f853d2c31e
full member
Activity: 154
Merit: 100
Oh, sorry I missed that.

Anyway, bitcoind won't tell you what the error is directly, but it will be in the debug log.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Edit: I just realized that (without the header) bitcoind returns "TX rejected (code -22)"
So it seems that the format is correct, but something is not ok

Maybe it's something to do with the signature like you said...
The outpoint you're trying to spend is from a non-existent transaction
8f36f8c77add38f2fa0365fb134cca553ebf4d6ec607b225cdee9e13d9d7ebda
Sorry, I thought I said that it's in testnet
http://blockexplorer.com/testnet/tx/8f36f8c77add38f2fa0365fb134cca553ebf4d6ec607b225cdee9e13d9d7ebda
full member
Activity: 154
Merit: 100
Edit: I just realized that (without the header) bitcoind returns "TX rejected (code -22)"
So it seems that the format is correct, but something is not ok

Maybe it's something to do with the signature like you said...
The outpoint you're trying to spend is from a non-existent transaction
8f36f8c77add38f2fa0365fb134cca553ebf4d6ec607b225cdee9e13d9d7ebda
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
But this is for messages, whereas I'm just creating transactions here
I should not have to deal with the messaging protocol

Maybe I misunderstand the purpose of the tools but the blockchain.info/pushtx page seems to claim exactly what I understand:
Quote
Broadcast Transaction

This page allows you to paste a raw transaction in hex (i.e. characters 0-9, a-f) this will then be checked it is valid and transmitted over the network.


And yeah I found the hex transactions on the wiki, and mine is similar. That's why I don't get what happen

Edit: I just realized that (without the header) bitcoind returns "TX rejected (code -22)"
So it seems that the format is correct, but something is not ok

Maybe it's something to do with the signature like you said...
legendary
Activity: 1512
Merit: 1036
Did you do the version handshake first?

version:

When a node creates an outgoing connection, it will immediately advertise its version. The remote node will respond with its version. No futher communication is possible until both peers have exchanged their version.


When you get bitcoin to ack the version, you know you are making checksums right, and you've also opened up further communication.

There's dumps of hex transactions on the common structures wiki link above.

BTW, I've never done what you're trying to do, I'm just good at reading(?)
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
I'm transmitting over the wire, to both bitcoind and blockchain.info
And I create the tx by hand, so I don't use [create/sign]rawtransaction

I tried with the header but then bitcoind returns "TX decode failed (code -22)" and blockchain.info returns "Parse: Error Parsing Transaction", so I think I shouldn't put it

Here is the raw tx:
Code:
0b110907747800000000000000000000df000000c1e1483e (header)
0100000001daebd7d9139eeecd25b207c66e4dbf3e55ca4c13fb6503faf238dd7ac7f8368f010000008a473045022004d1f3c972d65c660400496f49ef85933b4562da1cce110b853fd482b946f02d022100d7b822866a9a426e6a9c8e16f7a8fb8faf592dbf7baecc326696a03382c3243e410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01804a5d05000000001976a91491b24bf9f5288532960ac687abb035127b1d28a588ac00000000

Btw why did you give me that private key? To see if bitcoind works well? If so yes it did import it
legendary
Activity: 1512
Merit: 1036
Now you can test: importprivkey cPixSa5hRDdiyLUwynjP5jfxWkGoEZHxYonVMvFD18pWgd8VjvcK "testfun"

You've got the v0.2.10 protocol change in? https://bitcointalksearch.org/topic/protocol-changes-scheduled-for-feb-20-55852 All messages require checksums.

https://en.bitcoin.it/wiki/Protocol_specification#Common_structures

Field Size    Description    Data type    Comments
4    magic    uint32_t    Magic value indicating message origin network, and used to seek to next message when stream state is unknown
testnet3    0x0709110B    0B 11 09 07

There's no magic in dumped raw transactions from bitcoin. Are you transmitting over the wire with your own code or just sending to bitcoind? If bitcoin, maybe you are not signing?

wiki:

Input selection control

1 Get a list of not-yet-spent outputs with listunspent
2 Create a transaction using createrawtransaction
3 Apply signatures using signrawtransaction
4 Submit it using sendrawtransaction
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
I never managed to make a correct transaction whereas they have the correct format, even though decoderawtransaction understands it
But I just realized that I don't put the header (magic bytes, "tx", payload size, checksum)

Is it why it doesn't work?
(I'm asking instead or trying because I can't test right now)
Jump to: