0

I am building a platform (in node js) that users are going to pay for items using bitcoin. Some of the items has low prices (perhaps, even lower than the BTC fee).

The problem is: if I make an address for every user, the user buy low priced items and, once I want to retrieve the money, the UTXO be close to fee price, it won't be worth for me.

So, I'd like to know if it is possible to make a transaction from multiple addresses to a main address, paying just one transaction fee. If it is possible, how?
1
  • 2
    For smaller transactions you should really consider using the Lightning Network. Jan 19 at 21:19

2 Answers 2

2

So, I'd like to know if it is possible to make a transaction from multiple addresses to a main address, paying just one transaction fee. If it is possible, how?

Yes, it's totally possible to make transactions from multiple addresses even if these addresses aren't owned by the same person (entity). There is nothing in bitcoin that discourages this practice and from the standpoint of raising the privacy of the whole ecosystem, it's even highly appreciated.

The biggest issue for you would be the coordination of this transaction, it can make or break the feature. As all members of this transaction need to sign under it. You can check existing protocols (coinjoin) implementations like:

to get some inspiration for your case.

And I double the suggestion, for micropayments, it's better to use a lightning network. Adding inputs/outputs to the transaction raises the transaction weight, resulting in higher fees anyway.

0

The transaction fees in the Bitcoin network scale with the weight of the transaction rather than the amount spent. The biggest contributor to transaction weight are the inputs. You can spend unspent transaction outputs (UTXO) together and it is more cost effective to do so, but you will still need to create at least an additional input per UTXO.

Therefore, the cost of adding an input to the transaction is what determines the effective value of a UTXO. Besides spending multiple UTXO together, the cost can also be lowered by using more weight efficient transaction outputs. You should look to use a wallet that supports native segwit outputs since they cost less than half of legacy outputs to spend.

Still, it may be impractical to receive particularly small amounts per Bitcoin transactions. As Tony mentioned, the Lightning Network could be more practical for quick and cheap payments.

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.