Post
Topic
Board Development & Technical Discussion
Re: Is this BIP65 sample script standard?
by
CIYAM
on 01/01/2016, 03:43:46 UTC
I don't really understand the question. Do you mean you cannot produce a valid signature by using your tool? I checked the rawtx you created and indeed the problem is within the signature. webbtc verifies this as well.

I have written code that signs "standard P2PKH" transactions here: https://github.com/ciyam/ciyam/blob/master/src/crypto_keys.cpp#L805 and if you look closely you'll see c_empty_sig_script (which is "00") being placed where the sig later goes (why I was mucking around with the extra 00 above) and also this:

Code:
signing_info_suffix += c_hash_code_type_all;

which appends "01000000" (only to what is signed rather than what is actually the raw tx).

Basically to manually do a sig I'll need to apply the same approach to non-standard txs (nothing too hard - just some modifications really).

I was actually hoping to just use bitcoin-cli rather than to have to write code though but it's beginning to look like signrawtransaction is not able to do what I am wanting it to.