2

There is very good answer here: How to redeem a basic Tx? It works great.

But the algorithm is only for uncompressed addresses/keys, how can I change it to deal with compressed ones?

And the second question - how should I change the procedure to redeem several inputs?

amaclin
  • 6,760
  • 1
  • 21
  • 32
  • Uncompress it? I can't think of why anyone would use lossy compression. – John T Feb 02 '14 at 09:03
  • I think it should be a compressed key you want to redeem, not an address. Edited accordingly, please check if I got it right. – Murch Feb 02 '14 at 14:35
  • Sorry for my poor English. Of course I want to redeem the output to my address taken of compressed-form public-key. This part of question is solved. Now thinking how to put several inputs in one transaction – amaclin Feb 02 '14 at 18:54

1 Answers1

0

Exactly the same way, except instead of putting the compressed public key in the redeeming script, you use the compressed one. Decompressing it won't work, as that would change its hash (the address).

Pieter Wuille
  • 105,497
  • 9
  • 194
  • 308
  • Thank you very much. It really works either with compressed keys :) Now I have to sign several inputs and send them to one output. Unfortunately I can not understand how should I change this algorythm - seems to me that I should create several "simplified transactions" with one input and one output, sign them, and after that combine them into one final transaction. I've asked for a help also here: https://bitcointalk.org/index.php?topic=422021.msg4893746#msg4893746 – amaclin Feb 02 '14 at 17:40
  • Thank you again. The question is solved. I was able to manually sign two inputs for one output. On testnet of course. http://blockexplorer.com/testnet/tx/c693cccc8f54ec67ff7a1eddf7cb602584e8b20c73be37b025e71b273e8c4adb#i8282342 This one uses uncompressed public keys, but there is no difference – amaclin Feb 02 '14 at 21:12