Skip to content

Commit

Permalink
Add Brandon's Edits
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Jul 21, 2024
1 parent d41b64d commit beec547
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/how-payjoin-saves.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 1
---

# How Can Payjoin Save 1/6 of the Cost of Transacting?
# How Can Payjoin Save 16% on Transaction Fees?

Payment batching is the most common way for high-volume settlement services like exchanges and payment processors to save fees. But it has been limited to one party, the sender, combining multiple sends together. Ideally, multiple types of transfers could all be combined together. Imagine your deposit to an exchange was batched with others' withdrawals. This combination saves significant overhead compared to making individual transfers, [scaling Bitcoin](./why-payjoin/scaling). Before Payjoin, one could assume all inputs to a transaction were owned by sender. Payjoin breaks that [common input assumption](https://en.bitcoin.it/wiki/Common-input-ownership_heuristic) by including inputs owned by both sender and receiver, preserving [privacy](./why-payjoin/privacy) as a side effect. Implementing Payjoin batching is the next step to upgrade the whole Bitcoin network's scaling and privacy without any consensus change.

Expand All @@ -25,9 +25,9 @@ Exchange 2 btc -> 1 btc to Carol
~1 btc minus fees to Exchange
```

Each transaction would cost the exchange 𝑏 + 𝑖 + 2π‘œ, and they would pass the fees onto their customers in order to make a profit. The sum of these costs would be 3𝑏 + 3𝑖 + 6π‘œ, which would come out of the final ~2 BTC change the exchange keeps in the end. We're ignoring some future 𝑖 fees that the the change output would need to pay to be spent in the future too.
Each transaction would cost the exchange 𝑏 + 𝑖 + 2π‘œ, and they would pass the fees onto their customers in order to make a profit. The sum of these costs would be 3𝑏 + 3𝑖 + 6π‘œ, which would come out of the final ~2 BTC change the exchange keeps in the end. We're also ignoring some fees 𝑖 that would need to be paid to spend the change output in the future.

## Old-school Payment Batching
## Old-School Payment Batching

Batching helps the exchange save time and money in two ways. First, the overall cost to post such a transaction is cheaper than the cost of making three individual transactions to produce the same result. Second, a single unspent output can fund multiple withdrawals without waiting for each one to settle.

Expand All @@ -47,7 +47,7 @@ All else being equal, an exchange making this batch instead of three separate tr
What if Dave the depositor can payjoin? He gets a benefit of preserved privacy, and he can save the exchange some fees that could be passed on to him. Let's say Dave sweeps some bitcoins to the exchange:

```
Dave 3 btc -> ~3 btc minus fees to the Exchange
Dave 3 btc -> ~3 btc minus fees to Exchange
```

Without Payjoin, the exchange would have to take on a new UTXO from Dave's deposit and pay at least 𝑖 fees to spend it at some later date.
Expand All @@ -74,7 +74,7 @@ Exchange 3 btc 1 btc to Carol
~2 btc minus fees to Exchange
```

Which only cost 𝑏 + 2𝑖 + 5π‘œ, saving 𝑏 + π‘œ compared to when Payjoin isn't used. On top of this, the Exchange only creates one change output, which will cost 𝑖 fees to spend in the future. So the real comparison is 𝑏 + 3𝑖 + 5π‘œ versus 2𝑏 + 4𝑖 + 6π‘œ, saving 𝑏 + 𝑖 + π‘œ compared to when Payjoin isn't used, saving 1/6 the costs of transaction in this case.
Which only cost 𝑏 + 2𝑖 + 5π‘œ, saving 𝑏 + π‘œ compared to when Payjoin isn't used. On top of this, the exchange only creates one change output, which will cost 𝑖 fees to spend in the future. So the real comparison is 𝑏 + 3𝑖 + 5π‘œ versus 2𝑏 + 4𝑖 + 6π‘œ, saving 𝑏 + 𝑖 + π‘œ compared to when Payjoin isn't used, saving 16.66% the costs of transaction in this case.

Since Dave's sweep to the exchange "[cut-through](./why-payjoin/scaling#transaction-cut-through)" to Alice, Bob, Carol, and Erin,

Expand All @@ -83,8 +83,8 @@ Since Dave's sweep to the exchange "[cut-through](./why-payjoin/scaling#transact
3. All parties enjoy better privacy since deposits and withdrawals are indistinguishable from an exchange consolidation, and these batched transactions are indistinguishable from individual transactions.

Dave knows that Payjoin was used, but not which outputs are withdrawals vs consolidations.
The Exchange can see everything as it could before, but an outside observer cannot without that information being leaked.
Alice, Bob, Carol, Erin, or any outside observer can't tell whether or not all inputs came from the exchange or include an depositor's input. They know they got paid and that's their main concern. The exchange used less block space to save money they can pass onto the customer in the form more competitive fees and the Bitcoin network sees more ambiguous transactions that helps everyone's privacy.
The exchange can see everything as it could before, but an outside observer cannot without that information being leaked.
Alice, Bob, Carol, Erin, or any outside observer can't tell whether or not all inputs came from the exchange or include a depositor's input. The exchange used less block space to save money they can pass onto the customer in the form of more competitive fees and the Bitcoin network sees more ambiguous transactions that helps everyone's privacy.

## Future Payjoin Batching

Expand All @@ -94,9 +94,9 @@ Bitcoin technically allows even more depositors to batch their transactions toge
Dave 3 btc -> 1 btc to Alice
Frank 1 btc 1 btc to Bob
Greg 2 btc 1 btc to Carol
2 btc to Erin
Exchange 4 btc 2 btc to Erin
4 btc to Hal
Exchange 4 btc ~1 btc minus fees to Exchange
~1 btc minus fees to Exchange
```

However, such transactions are more complicated to coordinate, so it will take an effort to develop a new protocol and get it deployed. Integrating Payjoin V2 can save money, improve privacy, and help get to the next iteration that massively fixes Bitcoin's privacy through batching. Batching bitcoins, saving sats, and preserving privacy seem like different goals, but with a little joint effort all three can be satisfied in every single transaction.

0 comments on commit beec547

Please sign in to comment.