-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payjoin - bip78 crate #45
Comments
I'm not thinking of using bip78 but instead a specific protocol for payjoins between coinswap peers. It would happen at the same time as the protocol negotiation for the coinswap itself. BIP78 uses http while teleport already has its own protocol, plus bip78 doesn't have decoy UTXOs. More details on what I'm thinking of doing: https://gist.github.com/chris-belcher/9144bd57a91c194e332fb5ca371d0964#payjoin-with-coinswap |
I wonder if BIP78 could still be used for some operations. Similarly to how I (ab)use it to open LN channels ;) |
I've read the description and noticed one more attack vector: Alice could contact multiple Bobs at the same time using same UTXO. Only one transaction would confirm obviously but Alice attacks unlimited number of Bobs. Possible mitigation: Alice also uses a fidelity bond and is required to send a signed message to Bob who then broadcasts it to known boards and waits a bit. If two conflicting messages are present Bobs abort and start ignoring the bond of Alice until it's moved. This leaks that these two participants are swapping but doesn't leak which UTXOs they are swapping so should be fine. |
More thinking: I strongly believe combining receiving over BIP78 with swap is doable and even beneficial:
It's doable because the transaction is very similar to channel opening and channel opening is already possible today. If the protocol is modified to enable replacing the transaction before broadcast then client can also be combined with BIP78 which would be a cool way to anonymize the change. |
I don't see how multiple Bobs changes anything? Alice can also probe the same Bob multiple times. The defence against this I see is decoy UTXOs. Fidelity bonds being required by Alice would also work, but really degrades the UX because it means ordinary users who take the role of Alice now need to create fidelity bonds. Also I don't think it would work as well as decoy UTXOs, since Alice still discovers Bob's UTXOs, she just has to pay for it. |
Alice can send signed transaction to each Bob reusing the same UTXO. Only one of the transactions gets confirmed, so Alice only pays once. If Alice attacks 10 Bobs at once she learns 10 UTXOs for the same price as learning 1 UTXO. This works even when decoy UTXOs are used.
Same applies when Alice repeats the protocol with Bob multiple times.
Yes, maybe some privacy-conscious people would be willing to accept it? |
Ah I see! I didn't think of that attack. I think I have another solution: The bitcoin network won't allow Alice's UTXO to be spent multiple times, even for unconfirmed transactions. So this attack works only if Alice really times it right and gets all the maker Bobs to broadcast the payjoin transaction at nearly the same time. Then Alice has to have a wide view of the network to be able to see all those conflicting unconfirmed transactions involving her own UTXO. There is something we can do to make this attack harder: have the maker Bobs wait. Makers should pick a random time between zero and (say) 5 minutes, and broadcast the payjoin after that time. If they see a conflicting transaction on the network before they broadcast then they won't broadcast (Their bitcoin node with Another alternative to fidelity bonds that might be worth considering is proof of discrete log equivalence (PoDLE) of Alice's UTXOs, which then get shared. This is used in Joinmarket to add costs to a similar attack like this. It also degrades the UX a little bit, more than decoy UTXOs but less than fidelity bonds.
The reason I'm hesitant is I'd really want as many people as possible to create privacy transactions, even if they're just on the fence and don't care a huge amount but just care a little bit about privacy. |
Random delay sounds good even though it also worsens UX a bit. (Strange it's not in BIP78.) Agree with making private transactions as accessible as possible. |
It shouldn't worsen UX that much, since users already have to wait for transactions to be confirmed which takes 10 minutes or even more if the user wants to save on miner fees. Plus they'll have to be random delays between transactions just to increase the anonymity set. CoinSwap will be slow (and on-chain transactions generally). Equal-Output CoinJoin and JoinMarket are already pretty slow if you use them properly like with joinmarket's tumbler script. |
I noticed there's payjoin task in README, I guess it's not a priority but you may want to know that I'm working on a bip78 crate which could be helpful. Will be happy to receive a feedback on it.
Feel free to close this to de-noise if you like.
The text was updated successfully, but these errors were encountered: