1

Is there any possible way to create a raw transaction using Bitcoin-cli createrawtransaction API that doesn't require spending the entire input?

What I'm doing now is consuming that entire input sending 0.01 to the address specified and sending the change back to the address I'm withdrawing from.

If I deposit 0.5 BTC to my wallet and withdraw 0.01 is there any method to be able to work with my 0.49 BTC I have remaining without having it consumed entirely and being sent to the change address because then I'm stuck waiting for it to confirm and it gives off the impression my wallet balance is 0 when it's really 0.49 BTC.

1 Answer 1

3

Is there any possible way to create a raw transaction using Bitcoin-cli createrawtransaction API that doesn't require spending the entire input?

No. It's an inherent feature of the Bitcoin protocol that inputs must be spent entirely or not at all. It's a binary state: spent or unspent. There is no "partially spent".

What I'm doing now is consuming that entire input sending 0.01 to the address specified and sending the change back to the address I'm withdrawing from.

Yes, that's what you have to do (though for privacy reasons it is better to send the change to a freshly generated address instead).

If I deposit 0.5 BTC to my wallet and withdraw 0.01 is there any method to be able to work with my 0.49 BTC I have remaining without having it consumed entirely and being sent to the change address

Nope.

because then I'm stuck waiting for it to confirm and it gives off the impression my wallet balance is 0 when it's really 0.49 BTC.

Yes, that's something you just have to live with. However, you don't necessarily have to wait for the transaction to confirm before spending the change. But the second transaction won't confirm until after the first one does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.