Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: MikeJ_NpC on February 28, 2023, 10:53:15 PM



Title: Signed txn - inserting scriptsig
Post by: MikeJ_NpC on February 28, 2023, 10:53:15 PM
So i have a signed txn with core but is missing the scriptsig which i do have....
Just wondering if there is anything else someone can recommend besides brain-wallet or coinb which never works correctly... 
Is there something my python that will decompress it and allow edits step by step?  .... i cant post the transaction since its signed.

Thanks.


Title: Re: Signed txn - inserting scriptsig
Post by: jackg on March 01, 2023, 04:21:40 AM
What do you mean? Why are you wanting to merge them if the software hasn't? Why can't you just use the command line to build the transaction if using the GUI has lead to you thinking there's a problem - I think this would be the safest and easiest solution?

Signed transactions are safe to publish too (unless you want to maintain your privacy) - the signing process doesn't mean your funds are spend able by anyone with a signature, the complete transaction must be present too.


Title: Re: Signed txn - inserting scriptsig
Post by: pooya87 on March 01, 2023, 05:01:16 AM
So i have a signed txn with core but is missing the scriptsig which i do have....
Do you mean you have signed the transaction using core? In which case if the signing process was successful the transaction should already contain the required signature inserted in it already. It may not be inside the scriptsig (like spending P2WPKH where scriptsig is empty and the signature is in the witness).


Title: Re: Signed txn - inserting scriptsig
Post by: nc50lc on March 02, 2023, 05:50:03 AM
So i have a signed txn with core but is missing the scriptsig which i do have....
Try signrawtransactionwithkey and fill the optional "prevtx" arg with the required script depending on the input(s).
More info about the command: https://bitcoincore.org/en/doc/24.0.0/rpc/rawtransactions/signrawtransactionwithkey/


Title: Re: Signed txn - inserting scriptsig
Post by: digaran on March 02, 2023, 10:36:28 PM
So i have a signed txn with core but is missing the scriptsig which i do have....
Just wondering if there is anything else someone can recommend besides brain-wallet or coinb which never works correctly... 
Is there something my python that will decompress it and allow edits step by step?  .... i cant post the transaction since its signed.

Thanks.
Is this somehow related to your case about the 10,000BTC (https://bitcointalk.org/index.php?topic=5425729.0) lost/ stolen coins?
Hope you get a proper help with an open eye this time.


Title: Re: Signed txn - inserting scriptsig
Post by: MikeJ_NpC on March 03, 2023, 04:30:34 AM
No its not related to that..


Just to clarify...   when i submit something signed it says its in mempool and just sits .. never is picked up for confirmation ...
Follow up question .. when you fundtransaction is this the same as singing it ?  As it indicates its signed at that point

Just trying to figure out what is the issue...


Title: Re: Signed txn - inserting scriptsig
Post by: nc50lc on March 03, 2023, 04:48:30 AM
Just to clarify...   when i submit something signed it says its in mempool and just sits .. never is picked up for confirmation ...
It's your mempool, it's still subjected to other node's mempool if your transaction will propagate.
Try to search its txid in blockexplorers; if it's not there, chances that it's only in your node is high. (or a few nodes)

Quote from: MikeJ_NpC
Follow up question .. when you fundtransaction is this the same as singing it ?  As it indicates its signed at that point
No, it's used to add inputs to an existing transaction.
Mainly used for funding no input transactions created via createrawtransaction command.


Title: Re: Signed txn - inserting scriptsig
Post by: MikeJ_NpC on March 03, 2023, 05:00:20 AM
Just to clarify...   when i submit something signed it says its in mempool and just sits .. never is picked up for confirmation ...
It's your mempool, it's still subjected to other node's mempool if your transaction will propagate.
Try to search its txid in blockexplorers; if it's not there, chances that it's only in your node is high. (or a few nodes)



Quote from: MikeJ_NpC
Follow up question .. when you fundtransaction is this the same as singing it ?  As it indicates its signed at that point
No, it's used to add inputs to an existing transaction.
Mainly used for funding no input transactions created via createrawtransaction command.



I have checked mempool site its self and only says its waiting for it to appear which means i guess it hasn't made it to the chain... ?
besides pushing a raw on the various sites, is there another way to submit this ?


Okay just wanted to make sure about that. Regardless i do sign it afterwards.
So on both the fund and the sign comnmands.. it would add extra data on to the string correct?
I only see it add the data onto it when i fund it .. not when its signed despite it coming back as true... would this still be valid?


Title: Re: Signed txn - inserting scriptsig
Post by: nc50lc on March 03, 2023, 05:48:10 AM
I have checked mempool site its self and only says its waiting for it to appear which means i guess it hasn't made it to the chain... ?
besides pushing a raw on the various sites, is there another way to submit this ?
I don't know which site that shows "waiting to appear" so I have no idea, usually there'll be a result or none.
On a side note, there's no official mempool ('cause of the phrase "mempool site itself"), every node has its own and has their own set of rules. (usually the default)
So if the majority of the nodes don't have your transaction, chances that it's non-standard is high.

For broadcasting transactions, every site with push service has a Bitcoin node on its backend so it's all basically the same as sendrawtransaction command.


Title: Re: Signed txn - inserting scriptsig
Post by: hexvir on March 03, 2023, 01:28:54 PM
I have checked mempool site its self and only says its waiting for it to appear which means i guess it hasn't made it to the chain... ?
besides pushing a raw on the various sites, is there another way to submit this ?

I use this page to check the mempool: https://mempool.space/

The page give you an estimated time for your tx id.



Title: Re: Signed txn - inserting scriptsig
Post by: BlackHatCoiner on March 03, 2023, 05:18:58 PM
What you describe is contradictory. If it's a signed transaction, then it comes with the scriptSig. If it doesn't have the scriptSig, then it isn't signed. In Bitcoin Core, you can sign with signrawtransactionwithkey (https://bitcoincore.org/en/doc/0.19.0/rpc/rawtransactions/signrawtransactionwithkey/), but I'm not sure why you don't want that. Are you trying to sign something non-standard which Core will refuse?


Title: Re: Signed txn - inserting scriptsig
Post by: digaran on March 03, 2023, 07:55:04 PM
What you describe is contradictory. If it's a signed transaction, then it comes with the scriptSig. If it doesn't have the scriptSig, then it isn't signed. In Bitcoin Core, you can sign with signrawtransactionwithkey (https://bitcoincore.org/en/doc/0.19.0/rpc/rawtransactions/signrawtransactionwithkey/), but I'm not sure why you don't want that. Are you trying to sign something non-standard which Core will refuse?
Maybe because he doesn't have the key to sign the transaction, I remember OP somewhere mentioned that someone stole 10,000 bitcoins only having signatures and something other than private key, in the past he had asked if it's possible to spend by using signatures of a transaction or not. This however could be totally a different situation, but I can't see a reason as to why someone would want to go all the long way and not just use the key.

Maybe the OP is trying to broadcast a forged transaction and that's why no other nodes accept the tx?


Title: Re: Signed txn - inserting scriptsig
Post by: BlackHatCoiner on March 03, 2023, 08:03:02 PM
Maybe because he doesn't have the key to sign the transaction, I remember OP somewhere mentioned that someone stole 10,000 bitcoins only having signatures and something other than private key, in the past he had asked if it's possible to spend by using signatures of a transaction or not.
Yes, but as I can see above, it's not related to that case.

This however could be totally a different situation, but I can't see a reason as to why someone would want to go all the long way and not just use the key.
Maybe just for educational purposes?

@hexvirMikeJ_NpC, with what message do other nodes respond? If you don't have a scriptSig, and you attempt to broadcast such transaction, you'll likely get a "transaction has no inputs" message.


Title: Re: Signed txn - inserting scriptsig
Post by: nc50lc on March 04, 2023, 05:47:33 AM
@hexvir, with what message do other nodes respond? If you don't have a scriptSig, and you attempt to broadcast such transaction, you'll likely get a "transaction has no inputs" message.
hexvir isn't the OP  :D
From what I see, his reply is to give OP an alternative mempool explorer or blockexplorer site.


Title: Re: Signed txn - inserting scriptsig
Post by: Pmalek on March 04, 2023, 05:10:42 PM
Maybe because he doesn't have the key to sign the transaction...
He mentioned in the OP that the transaction is signed and that he also has the scriptsig, but somehow it's missing from the transaction he built. Maybe he just thinks it's signed. I don't understand how it can be missing and still be a valid and signed transaction. How do you prove to the software you can spend those coins without the scriptsig? It shouldn't work. And if it doesn't, how can there still be a valid signature for something you can't spend?