Post
Topic
Board Bitcoin Technical Support
Merits 16 from 3 users
Topic OP
How to sign raw transaction with openssl?
by
kzv
on 06/11/2019, 22:11:12 UTC
⭐ Merited by LoyceV (13) ,ABCbits (2) ,ETFbitcoin (1)
Hello

I know that transactions with non standard script is can not be signed with bitcoin-core. So I am looking for the way to sign transaction with other methods that not required any programming. For example openssl.

Look at this standard, but not signed transaction
02000000018d5379c5460adf4a83e75b8c14c9832268aa4539b3ce3f102dd59f4fc154b0ea00000 00021029501ef2a97b855ab35898a6f5901c6538bab08d8244cd88b213e777095a17c6ffeffffff 01105522000000000017a914e4b3d47cc59f2c895a4c09107c98f8acc476c9688700000000

when I signed it with
Code:
signrawtransactionwithwallet 02000000018d5379c5460adf4a83e75b8c14c9832268aa4539b3ce3f102dd59f4fc154b0ea0000000021029501ef2a97b855ab35898a6f5901c6538bab08d8244cd88b213e777095a17c6ffeffffff01105522000000000017a914e4b3d47cc59f2c895a4c09107c98f8acc476c9688700000000

I got this output
Quote
020000000001018d5379c5460adf4a83e75b8c14c9832268aa4539b3ce3f102dd59f4fc154b0ea0 0000000171600142fcfe0ee792965d852f392c5fe53e2be71274ca8feffffff0110552200000000 0017a914e4b3d47cc59f2c895a4c09107c98f8acc476c968870247304402206a59b9212efdacc2e6367c4a45b4e26b3a73a64d564c983cb82edcd2ae545647022 04a5ec3e3e729009cfc855b0c23bf2468e423344993847a37394d3810a1c7f1bb0121029501ef2a 97b855ab35898a6f5901c6538bab08d8244cd88b213e777095a17c6f00000000

So I guess that this is a signature part
Quote
0247304402206a59b9212efdacc2e6367c4a45b4e26b3a73a64d564c983cb82edcd2ae54564702204a5 ec3e3e729009cfc855b0c23bf2468e423344993847a37394d3810a1c7f1bb0121029501ef2a97b855ab35898a6f5901c6538bab08d8244cd88b213e777095a17c6f

Where this is my public key
029501ef2a97b855ab35898a6f5901c6538bab08d8244cd88b213e777095a17c6f

And this is my signature
304402206a59b9212efdacc2e6367c4a45b4e26b3a73a64d564c983cb82edcd2ae54564702204a5 ec3e3e729009cfc855b0c23bf2468e423344993847a37394d3810a1c7f1bb01


I do not known: what is 02
And got main question: can I obtain this part with openssl or other well-known utilities?