please I need help, am using Bitcore-lib in my project and am having issues sending BTC, let’s assume I have addresses A, B, C, D, E & F and they have A = 0.2BTC, B = 0.13BTC, C = 0.25BTC, D = 0.0015BTC & E = 0.36BTC and I want to send the sum of BTC in A, B, C, D & E to F at once. Please can anyone help me on how to do that in node js?

  • Since you have different addresses with different keys each transaction has to be placed from a different address (it doesn't matter if your wallet has all of them) so I don't think it will be possible to move all the funds at once without gathering all of them in one of those addresses.
    – YoMismo
    Jul 17 '18 at 7:06
  • @YoMismo Please can you give a detailed explanation?
    – kene
    Jul 17 '18 at 7:14
  • Go to blockchain.info and check the transactions. One single transaction may imply moving funds from different addresses to just one (check the next arbitrary transaction: blockchain.com/es/btc/tx/…). So if you want to create a transaction where a single origin address appears you may need to gather funds in just one address and transfer funds from there.
    – YoMismo
    Jul 17 '18 at 7:45
  • Quick question, please how do you go about transaction fees using this solution any pointers??
    – kene
    Jul 17 '18 at 21:59
  • @yomismo Please can you give me a guide on how to go about the transaction fees, i have done all this but it's still not clear on how to tackle transaction fees i'm using bitcore-lib
    – kene
    Oct 13 '18 at 14:08

First, it is worth noting that the bitcoin network does not have any notion of ‘account balances’ at the protocol level, this is an abstraction used by wallets for convenience.

Bitcoin uses UTXOs, and it is possible for multiple UTXOs to exist at the same address.

In your case, you can spend all of the UTXOs at the addresses you’ve listed in a single transaction, your wallet software will simply need to consume the relevant UTXOs as inputs, spending the coins to new outputs (creating new UTXOs).

Whether the coins exist at one address, or many, is irrelevant in your ability to spend the coins. A bitcoin transaction can have many inputs, and many outputs, if you so desire. Note that in general, the larger the number of inputs/outputs, the larger the vbyte size of the transaction will be, and thus the higher the fees will be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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