Author: Kukks
New protocol design: Discrete Payments through Wabisabi coinjoins and Nostr ecnrypted communication
- Merchant creates invoice of 0.1BTC
- Merchant generates a unique key for invoice
- Merchant shows the pubkey of (2), a recommended nostr relay uri
- Customer generates a unique key for this invoice payment
- Customer posts an encrypted event addressed to pubkey of (3) with a message stating intent to pay invoice of 0.1BTC using a specific wabisabi coordinator
- Merchant replies with an encrypted event with acknowledgement (or rejects)
- Customer joins next round, adds inputs >0.1 BTC, gets credentials
- Customer reissues credentials, gets one credential of 0.1BTC
- Customer posts an encrypted event addressed to pubkey of (3) with the credential in a text format
- Merchant reissues credentials
- Merchant replies with an encrypted event with acknowledgement (or rejects)
- Round enters output registration stage
- Merchant registers outputs
- Round enters tx signing stage
- Merchant verifies output is there
- Merchant replies with an encrypted event stating payment is present in tx hash
- Customer verifies round tx equals hash
- Customer signs
Notes:
- a pseudo nostr relay will connect to multiple relays and retrieve all relelavnt events and aggregate. This will then serve them in a unified entrypoint, allowing users to not leak their ip to a dedicated nostr relay for private payments
- Customer specifies which coordinator to use, not tied to only one
- Merchant can provide own coins to same coinjoin to increase anonymity
- Can theoretically chain the payments to other hops within the same coinjoin, serves as a trustless, private layer 3 equivalent to ecash systems, without the custodians (but with a much stricter time horizon)
Savings analysis when applying this tech towards fee savings for businesses (no privacy decomposition done). (yes I used ai to fluff up the text around the formulas)
Detailed Formulas and Analysis of Batching Bitcoin Transactions
Batching transactions in Bitcoin involves combining multiple deposits and withdrawals into fewer transactions to save on fees and reduce UTXO bloat. This process can significantly optimize transaction costs and improve network efficiency. Below, we outline the formulas for calculating transaction sizes and savings across three modes: Single Transaction Mode, Withdrawal Batching Mode, and Full Batching Mode.
Variables and Constants
Transaction Modes
Single Transaction Mode
In Single Transaction Mode, each deposit and each withdrawal are processed as separate transactions. This mode represents the highest cost due to the repeated overhead of many small transactions.
Transaction Size Calculation:
Total Size for Single Transaction Mode:
Where:
Withdrawal Batching Mode
In Withdrawal Batching Mode, deposits remain as individual transactions, but all withdrawals are combined into a single batched transaction. This mode reduces the overhead cost associated with processing multiple withdrawals separately.
Transaction Size Calculation:
Total Size for Withdrawal Batching Mode:
Where:
Full Batching Mode
Full Batching Mode represents the most efficient strategy, where deposits and withdrawals are combined into a single transaction. This mode minimizes the total number of inputs and outputs by using deposits directly to fund withdrawals and consolidating change outputs.
Transaction Size Calculation:
Total Size for Full Batching Mode:
Where:
Calculating Savings
To determine the savings achieved by batching methods compared to the baseline single transaction approach, we use the following formulas:
Savings Between Single Transaction and Withdrawal Batching:
Savings Between Single Transaction and Full Batching:
Savings Between Withdrawal Batching and Full Batching:
Forward-Facing Savings and Efficiency Gains
Batching not only provides immediate savings but also leads to forward-facing benefits, including:
Reduced UTXO Bloat:
Elimination of Dust Outputs:
Long-Term Transaction Efficiency:
Conclusion
Batching Bitcoin transactions significantly reduces transaction costs by minimizing redundant inputs, outputs, and overhead. Full batching, in particular, achieves the greatest savings by directly utilizing deposits to fund withdrawals and optimizing UTXO management. These savings are compounded over time, making batching a crucial strategy for sustainable and efficient Bitcoin transaction processing.