Bitcoin Forum
May 05, 2024, 07:56:36 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind sendrawtransaction / blockchain.info/pushtx (testnet)  (Read 2802 times)
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
April 06, 2013, 11:03:16 AM
Last edit: April 06, 2013, 12:57:55 PM by jackjack
 #1

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)

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714895796
Hero Member
*
Offline Offline

Posts: 1714895796

View Profile Personal Message (Offline)

Ignore
1714895796
Reply with quote  #2

1714895796
Report to moderator
1714895796
Hero Member
*
Offline Offline

Posts: 1714895796

View Profile Personal Message (Offline)

Ignore
1714895796
Reply with quote  #2

1714895796
Report to moderator
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1028



View Profile WWW
April 06, 2013, 11:37:00 AM
Last edit: April 06, 2013, 11:56:48 AM by deepceleron
 #2

Now you can test: importprivkey cPixSa5hRDdiyLUwynjP5jfxWkGoEZHxYonVMvFD18pWgd8VjvcK "testfun"

You've got the v0.2.10 protocol change in? https://bitcointalk.org/index.php?topic=55852.0 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
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
April 06, 2013, 12:17:28 PM
 #3

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

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1028



View Profile WWW
April 06, 2013, 12:26:59 PM
 #4

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(?)
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
April 06, 2013, 12:43:29 PM
 #5

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...

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Zeilap
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
April 06, 2013, 12:52:05 PM
 #6

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
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
April 06, 2013, 12:57:42 PM
 #7

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

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Zeilap
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
April 06, 2013, 01:02:07 PM
 #8

Oh, sorry I missed that.

Anyway, bitcoind won't tell you what the error is directly, but it will be in the debug log.
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
April 06, 2013, 01:11:47 PM
 #9

Yeah thanks, great idea!

The result is quite clear:
Quote
ERROR: CScriptCheck() : f853d2c31e VerifySignature failed
ERROR: CTxMemPool::accept() : ConnectInputs failed f853d2c31e

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!