JoinMarket-Org / joinmarket-clientserver

Bitcoin CoinJoin implementation with incentive structure to convince people to take part
GNU General Public License v3.0
712 stars 175 forks source link

[Feature request] send to multiple recipients and exact amounts #1012

Open openoms opened 2 years ago

openoms commented 2 years ago

Building on #1009.

Funding multiple channels from the JoinMarket wallet would need sending to multiple recipients and exact amounts (known before the address is known). It is possible to be done currently, but the transactions need to be constructed outside JoinMarket and signed with the wallet-tool.py signpsbt method.

Some current options:

less safe including sharing private keys:

In Electrum or Specter Desktop one just needs to paste the list of addresses followed by the amounts. would be good to be able to do it from JM without importing watch-only wallets or keys elsewhere.

Note: Batch channel opens do hurt the privacy on LN (by revealing which peer funded the channels), but a great tool to reduce the miner fees spent during high fee periods.

@AdamISZ on IRC: i don't know what to say re: multiple destinations and amounts, i mean obviously it can be done, and i can certainly see the desire for it. a likely starting point is simply a PR against jmclient.taker_utils.direct_send to accept multiple destinations and amounts.

AdamISZ commented 2 years ago

Just to note that this could perhaps be folded into 'sendtomany.py', or really, a rewrite of that (which was a super-crude script created specifically to add PoDLE tokens), but the point quoted above, that we should rewrite the direct_send for it, it still true.

kristapsk commented 6 months ago

There is one potential use casee which cannot be solved with PSBTs currently. When sending to multiple recipients, you might want to do it as a coinjoin too, think of it as batching multiple coinjoins into one. It's little bit more blockspace efficient than multiple individual coinjoins, without privacy loss. And I don't see why it shouldn't be theoretically possible.

kristapsk commented 6 months ago

a likely starting point is simply a PR against jmclient.taker_utils.direct_send to accept multiple destinations and amounts.

Looking at it. It doesn't happen too often, but today had a situation when I needed to send to two different addresses and amounts and support for this would have been handy. Didn't have time to manually construct PSBT, ended up just sending two separate non-cj send transactions, so overpaid in tx fees without much privacy gain.