Transcript for #bitcoin-dev 2017/07/14

14:43 mmgen arubi: are you there?
14:43 arubi mmgen, yea
14:44 arubi so you wanna show the data that you're signing?
14:44 mmgen sure
14:44 mmgen 02000000000101517103aaebde01ae59971223020a8cc1b467cec9c92905d2abb63990771721dd0000000017160014fc1fa9b1449a75438f8a5f2d98cffd38c9c383a9ffffffff01d0e22c000000000017a914cb6aaea6ae5739c2801d8e622cb084636836c064870247304402203619ae3cbeabe37346469f2a7659d330f4120af3fa0edbf87e57ad811fded7c10220322f00c9d2f21cbc8368092b9c44c7468d4b8a14354e08f95a75a9c98701103a01210248c35b571c4c5b1246114df85e008b328a8e534a819e0173
14:44 mmgen 152a70a515655d6b00000000
14:46 arubi that can't be right, is that what you're hashing towards signing?
14:46 arubi (do you know that there's a new sighash scheme for segwit?)
14:47 mmgen no I didn't
14:47 mmgen that's the already signed transaction
14:48 arubi and what did you sign?
14:48 mmgen that's the tx I signed. Sending it fails
14:49 arubi or did you use core to sign?
14:49 mmgen yes, signed with Core
14:49 mmgen the data is on two lines here, if you missed that
14:50 mmgen 02000... and 152a...
14:50 arubi I didn't, also I'm pretty sure I just sent it
14:51 arubi
14:51 mmgen bitcoin-cli -testnet decoderawtransaction <the data I posted here>
14:51 arubi mmgen, the transaction you signed is ok
14:51 mmgen so why does txsend fail?
14:52 arubi on your end, I don't know. I just sent it from my node and it didn't complain
14:54 arubi huh, maybe I got confused and relayed the one I signed locally
14:55 arubi not sure. anyway, if you used core to sign it, can you show the json you used as input for prevtx?
14:56 arubi anyway, I don't think I relayed my own test. pretty sure I used yours
14:58 mmgen you could try resending it
14:59 arubi what do you mean? relay the same thing? how will it help?
15:00 mmgen now it's working for me too.
15:00 mmgen I just relayed it again. It worked
15:01 mmgen No error this time.
15:01 arubi awesome
15:02 arubi maybe just a copy paste issue the previous time. happens a lot for me
15:09 mmgen arubi: oops, I sent you the wrong data. Here's the failed signed tx:
15:09 mmgen 020000000001015dbd884f953a7a930314f95e8f14ee5766c5738e91ec10de49ba4cbe47f3c89d00000000171600148d4f3ba7746c8bf8b920176a346bd06acb9466b0ffffffff0159da2c000000000017a914cb6aaea6ae5739c2801d8e622cb084636836c064870247304402205d09c1c1ab755d1395f6e93f18178a1e65f581c1904f03125d8d3234f355317b02200d04e1099d5e8e51d6417cd2cf9c5fa792a5af7fa3876ed573bb46c235faa529012102421e545e7d38e10cafbf23fc5cbf6a68629f523d4bc8d8d6
15:09 mmgen 941d7cf6d2aaa88d00000000
15:10 arubi that's redeeming a different input
15:10 mmgen sendrawtransaction fails with error code: -26
15:10 mmgen I know
15:11 arubi okay, can you show what it is that you're sining?
15:11 arubi signing*
15:11 arubi I mean, the `signrawtransaction` command
15:13 mmgen the unsigned hex? wait a sec
15:14 arubi the unsigned hex, the prevtx json, the privkey json
15:15 mmgen 02000000015dbd884f953a7a930314f95e8f14ee5766c5738e91ec10de49ba4cbe47f3c89d0000000000ffffffff0159da2c000000000017a914cb6aaea6ae5739c2801d8e622cb084636836c0648700000000
15:17 mmgen Did you try just sending the signed data?
15:18 mmgen Your previous send worked, whereas mine didn't
15:18 arubi no. the private key you shared before is not correct for this tx
15:19 mmgen I know
15:19 mmgen here: cUHonksjUUSEkmACwdbhQ2YguRrprL5ujYDyALvjK5Xtv16Qm546
15:19 arubi and what's the json that you used for prevtx?
15:20 arubi mmgen, It'd be a lot easier for me if you just lay out the data as you used it
15:21 arubi so, when you ran bitcoin-cli -testnet signrawtransaction ... , what did you input?
15:22 mmgen I'm not working at the cmdline but inside a script. Wait a sec
15:23 arubi still the commands are the same if you're using core
15:26 mmgen Here's what I passed to signrawtransaction, besides the key and hex:
15:26 mmgen { 'redeemScript': '00148d4f3ba7746c8bf8b920176a346bd06acb9466b0',
15:26 mmgen 'scriptPubKey': u'a914cb6aaea6ae5739c2801d8e622cb084636836c06487',
15:26 mmgen 'txid': u'9dc8f347be4cba49de10ec918e73c56657ee148f5ef91403937a3a954f88bd5d',
15:26 mmgen 'vout': 0}
15:27 mmgen The key and hex are the ones above
15:28 mmgen I'm not passing a sighashtype
15:31 arubi this is what I'm getting:
15:31 arubi 020000000001015dbd884f953a7a930314f95e8f14ee5766c5738e91ec10de49ba4cbe47f3c89d00000000171600148d4f3ba7746c8bf8b920176a346bd06acb9466b0ffffffff0159da2c000000000017a914cb6aaea6ae5739c2801d8e622cb084636836c0648702483045022100f068f4da1d33c29412b34e3294a7c218cd7439eb04a4a920b0fcacf8f74fea740220774e2d6bd83b4f7685fe2c39b2ba63d1d3bf581d5ce1c1ecde968b83d90d7855012102421e545e7d38e10cafbf23fc5cbf6a68629f523d4bc8d8d6941d7cf6d2aaa88d00000000
15:32 arubi using: `bitcoin-cli -testnet signrawtransaction "$(bitcoin-cli -testnet createrawtransaction '[{"txid":"9dc8f347be4cba49de10ec918e73c56657ee148f5ef91403937a3a954f88bd5d","vout":0}]' '{"2NBnnxdthfqdhm3KoiWkQ3Q9h8gmDie373X":0.02939481}')" '[{"txid":"9dc8f347be4cba49de10ec918e73c56657ee148f5ef91403937a3a954f88bd5d","vout":0,"scriptPubKey":"A914CB6AAEA6AE5739C2801D8E622CB084636836C06487","redeemScript":"00148D4F3BA7746C8BF8B920176A346BD06ACB9466B0
15:32 arubi ","amount":0.02941648}]' '["cUHonksjUUSEkmACwdbhQ2YguRrprL5ujYDyALvjK5Xtv16Qm546"]'`
15:32 arubi redeemed in c9640421ed7d95a1c1b8e72df0320a6b8c5aee7354c3995dddaa4a498b7f652e
15:33 arubi maybe you're not passing an amount, or passing the wrong amount for signing. not sure, the output is kinda broken
15:34 mmgen your data differs from mine. It's two bytes longer
15:38 mmgen arubi: That's it. The amount is missing
15:39 mmgen I just forgot it
15:48 mmgen arubi: Success! 5bb5937b610f9b3efda431af74bf75bc4b0671c0fdd512fa3886a5b4a53d56ea
15:49 mmgen Oh those stupid errors...
15:49 mmgen arubi: can't thank you enough for your help
15:52 To7 General dev, time to protect bitcoin !
15:52 To7 I need help spreading the word on this:
15:52 To7 Instructions are here:
15:59 arubi mmgen, cheers :)
15:59 mmgen arubi: :)
16:00 mmgen arubi:
16:01 mmgen Segwit support coming soon
16:02 arubi awesome. just in time