Spending Bitcoin Privately

Prerequistes

This guide explains how to send Bitcoin in a way that protects your privacy. If you’re new to Sparrow, the Quick Start guide provides a helpful introduction.

Why Privacy Matters in Bitcoin

To understand why privacy tools are needed, it’s important to understand the Bitcoin UTXO model.

Every Bitcoin balance is represented as a transaction output (TXO), which is sent to a specific address. Before these funds are spent, they are called unspent transaction outputs (UTXOs). Each UTXO has a unique, fixed amount.

When you spend Bitcoin, you combine one or more UTXOs as inputs for your transaction. After the transaction is confirmed on the blockchain, these input UTXOs become “spent”, meaning they can’t be used again. If the amount you’re spending doesn’t exactly match the input UTXOs, “change” is created, returning the remaining funds to your wallet as a new UTXO.

Because the Bitcoin blockchain is public, this model has several implications for privacy:

  • Revealing your Balance: Anyone can see the input UTXOs you used in your transactions, potentially revealing information about your balance.
  • Tracking your Spending: The public blockchain allows observers to see when “change” (and subsequent change outputs) are spent, revealing your spending patterns over time.
  • UTXO Clustering: All input UTXOs in a transaction are often assumed to belong to the same owner, creating a cluster that links your transactions.
  • Blockchain Analysis: Blockchain analysis tools use heuristics to determine ownership changes and identify your financial activity.

Privacy Tools

Privacy tools aim to disrupt these heuristics and protect your privacy. Examples include:

  • Coinjoins: These combine transactions from multiple users, introducing confusion and entropy in the transaction graph.
  • Payjoin: This breaks assumptions about UTXO ownership, making it harder to track your funds.

Why Privacy is Important

By using privacy tools, you can:

  • Obfuscate Transaction History: Make it difficult to link your transactions and track your spending.
  • Protect your Balance: Reduce the amount of information revealed about your financial holdings.

Fake Two-Person Coinjoin (Stonewall Transaction)

A common way to increase privacy when spending Bitcoin is to use a technique called an “equal output coinjoin.” This involves multiple individuals contributing inputs to create a transaction with equal output amounts. This ambiguity makes it harder to trace the ownership of funds, as each output could belong to any of the participants.

A simple way to introduce privacy without needing to coordinate with others is to create a “fake coinjoin” (also known as a “Stonewall transaction”). This is a transaction you create yourself, but it appears as if it could have been created by multiple individuals. An outside observer can’t tell if the coinjoin is real or fake.

Benefits of Fake Coinjoins:

  • No Collaboration: You don’t need to work with anyone else.
  • Works with any Wallet: This technique can be used with any type of wallet, including hardware wallets.

How it Works:

Imagine a transaction with two equal outputs. It could be a real coinjoin where two people contributed funds, or it could be you splitting your own funds into two equal outputs. This ambiguity makes it difficult to track which funds belong to whom.

Note: While fake coinjoins provide a layer of privacy, they are not as effective as real coinjoins, which involve genuine collaboration between multiple parties.

To create a coinjoin with yourself, go to the Send tab in Sparrow and create a transaction as you normally would. Then, turn on the optimize for Privacy toggle button in the lower left corner. If your wallet has enough funds, Sparrow will automatically construct a coinjoin for you.

Here’s how Sparrow will build the coinjoin:

fake coinjoin technique

Sparrow will create a coinjoin with two sets of inputs, representing each “individual” in the coinjoin. Because each “individual” needs to contribute more than the payment amount, your wallet must have enough funds to cover twice the payment you’re making. If you don’t have enough funds, you can still perform a collaborative coinjoin, which we’ll discuss later.

The transaction will have several outputs:

  • The first output is the actual payment to the address in the Pay to field.
  • The second output is a “decoy” of the same amount (5,670 sats), sent to one of your change addresses.
  • Finally, there are two change outputs, one for each “individual,” sent back to your wallet.

This transaction looks like a real two-person coinjoin to an outside observer, but it’s actually a transaction where you’re using your own funds to create the illusion of a coinjoin. This extra layer of privacy comes at the cost of a slightly higher fee due to the additional inputs and outputs.

To create this type of coinjoin in Sparrow, the address you’re paying to needs to be the same type as your wallet. This ensures that the outputs look similar and further enhance the illusion of a real coinjoin.

You can now create, sign, and broadcast this transaction as you normally would, gaining additional privacy in the process.

PayNym and Payment Codes for Non-Interactive Payments

In the previous example, you needed to get a fresh address from the recipient for each payment. But what if you want to pay someone without needing to contact them every time? This is where PayNyms and payment codes come in.

Payment Codes:

  • Unique Identifier: Each wallet can create a unique identifier called a payment code.
  • Deterministic Generation: This code is generated deterministically, meaning it’s calculated based on a specific algorithm.
  • Privacy: A payment code doesn’t reveal any information about your wallet, making it safe to share.
  • Length: Payment codes are quite long, making them difficult to share in person.

PayNyms:

  • Directory: The PayNym directory at https://PayNym.is allows you to create a short, friendly name for your payment code.
  • Example: A PayNym might look like +roundgrass881.
  • Uniqueness: Each PayNym is unique.
  • Profile Pictures: PayNyms have associated “robot” profile pictures to make them easier to remember.
  • Contacts: Each PayNym can have a list of contacts representing other PayNyms you regularly interact with.

Using PayNyms:

  • Optional: PayNym use is optional and can be enabled in the config file.
  • Payment Codes: You can still use payment codes directly without creating PayNyms.

Benefits:

  • Non-Interactive Payments: You can pay someone without needing to ask for a new address each time.
  • Privacy: PayNyms and payment codes help protect your privacy by hiding your wallet information.
  • Ease of Use: Short, friendly PayNyms make it easier to share payment information.

PayNyms are a feature within Sparrow that allows for more seamless and private non-interactive payments.

Paying to a PayNym

You can send a payment directly to a PayNym, which will automatically route the funds to a private address known only to you and the recipient.

In the Send tab, click the down arrow to the right of the Pay To field and select PayNym…

send to paynym

Нou will see a dialog box displaying the PayNym associated with your wallet. If you need to retrieve it, click the Retrieve PayNym button.

paying to paynym

Once you have selected PayNym… in the Send tab, you will need to find the PayNym of the recipient:

  1. Find Contact: Look for the PayNym in your list of Contacts.
  2. Add Contact: If the PayNym isn’t in your list, enter it in the Find Contact field and click Add Contact when it appears.
  3. Link Contact: After adding the PayNym, click the Link Contact button.

Linking a Contact:

Linking a contact involves sending a small notification transaction to an address associated with the PayNym you’re sending to. This is necessary to establish a connection and ensure the PayNym is ready to receive funds. This notification transaction will cost 546 sats (plus the mining fee).

Alternative: Direct Payment with Payment Code:

You can also send directly to a payment code by pasting it into the “Pay To” field.

Note: Currently, direct payments to PayNyms are not supported with Taproot (P2TR) wallets.

paynym linking

After linking a contact, Sparrow and the PayNym wallet will create a unique set of send and receive addresses for both wallets. This allows you to send payments independently and privately to this PayNym without needing further interaction.

  • One-Time Linking: The notification transaction only needs to be sent once to establish the link.
  • Contact Linking: If the PayNym adds you as a contact, they will be automatically linked to you and can send payments in the same way.
  • Blockchain Storage: The link is stored on the blockchain.
  • Seed Restoration: If you need to restore your wallet from a backup, you can use your wallet seed to recover any funds sent to these addresses.
  • Master Wallet: Funds sent to you through this feature will appear in your main (master) wallet even if you have multiple accounts configured.

Sending to a Linked PayNym:

  1. Send To Contact: Click Send To Contact to initiate the payment.
  2. PayNym in Pay To Field: The dialog will close, and the Pay To field will show that you’re paying to a PayNym.
  3. Label and Amount: Enter your payment label and the amount.

Direct Payment:

  • Private Address: Sparrow will automatically use a private send address known only to you and the PayNym recipient.
  • Create Transaction: Continue with the transaction as usual (create, sign, and broadcast).

Conclusion

By utilizing these tools, you can significantly enhance your privacy when transacting with Bitcoin. Linking and paying directly to a PayNym is particularly useful for sending and receiving payments independently, without needing a server to provide fresh addresses. It’s a powerful feature that can help you maintain control over your financial privacy. Consider using these privacy techniques for every transaction you send. It’s never too late to start prioritizing your privacy in the Bitcoin ecosystem.