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?
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.