Can two signed transactions be merged into one?

2

I'm in a situation where I have a presigned transaction, which, due to a bug in software that generated it, has a fee lower than minimal relay fee. I have that transaction's hex, but it can't be broadcast in a way that'd get it mined, so that's no use. Thus, the question: is it possible to merge it with another transaction which I could arbitary create and sign with my wallet, so that that transaction would unlock enough bitcoin to cover the fee for the resulting transaction? If so, how could I do this?

Daerienn

Posted 2018-06-15T13:39:21.900

Reputation: 23

The term to search is "child-pays-for-parent." All it takes is one miner to pick up the parent-child pair for confirmation. Put a nice fat fee on the child transaction. You may be able to contact a miner directly, too.Rich Apodaca 2018-06-15T21:18:45.790

@RichApodaca You can't do a child pays for parent if your parent transaction fee is below minrelay. A node won't accept the child if it doesn't know about the parent, and nodes will not relay the parent, so they won't know about itRaghav Sood 2018-06-16T00:25:05.403

Nodes set their own relay polices. Bitcoin Core adds parentless transactions to an orphan pool. It only takes one miner to pick up the parent-child pair. True, it may not work depending on peers. But these aren't consensus rules.Rich Apodaca 2018-06-16T04:43:29.653

Answers

2

Potentially. It depends on how the transaction was signed.

If it was signed with a SIGHASH_ALL flag, you cannot combine it since the signature checks to make sure the inputs and outputs have not been changed.

If it was signed with an ANYONE_CAN_PAY flag, you can add additional inputs, and potentially more outputs depending on the rest of the signature.

All consumer wallets I'm aware of default to SIGHASH_ALL, so you're likely out of luck.

Your best bet would be to either send more BTC to that address and sign a new tx, or to import your private key into another wallet with more BTC, and create a tx spending from more than one address.

Raghav Sood

Posted 2018-06-15T13:39:21.900

Reputation: 10 897