Skip to content

Add CoinJoin functionality to improve transaction privacy #191

Description

@nejos97

We want to implement CoinJoin in Grimm App to enhance user privacy by allowing multiple users to combine their Bitcoin transactions into a single transaction, making it difficult to trace inputs to outputs.

This feature should be designed for both beginner-friendly usage and advanced user control, aligned with Grimm App’s goal of being simple yet powerful.


Objectives

  • Improve on-chain privacy for users
  • Support collaborative transaction building
  • Provide a seamless UX for privacy features

Scope

1. CoinJoin Strategy

  • Choose implementation model:

    • Centralized coordinator (e.g., similar to Wasabi Wallet)
    • Decentralized (P2P, more complex)
  • Define anonymity set target (e.g., 5, 10, 50 participants)


2. Transaction Flow

  • Allow user to opt-in to CoinJoin
  • Queue system for participants
  • Build PSBT (Partially Signed Bitcoin Transaction)
  • Handle signing flow securely (client-side only)
  • Broadcast final transaction

3. Backend / Coordinator (if applicable)

  • Create CoinJoin coordinator service
  • Manage session lifecycle (register inputs/outputs)
  • Prevent double-spending
  • Ensure no custody of user funds

4. Privacy & Security

  • Ensure no logs linking inputs ↔ outputs
  • Integrate Tor support (optional but recommended)
  • Protect against Sybil attacks
  • Validate equal output amounts (standard denomination)

5. UX/UI

  • Simple toggle: “Enhance Privacy (CoinJoin)”

  • Display:

    • Estimated delay
    • Fees
    • Anonymity level
  • Status states:

    • Waiting for participants
    • Signing
    • Broadcasting

6. Fees Handling

  • Define fee model:

    • Mining fee split
    • Coordinator fee (if any)
  • Show clear fee breakdown to user


Acceptance Criteria

  • User can opt-in to CoinJoin from send flow
  • Transactions are combined with multiple participants
  • Final transaction breaks deterministic input-output linkage
  • No private keys leave the device
  • Feature works on testnet before mainnet

Risks / Considerations

  • Legal/regulatory implications (important given past cases like Samourai Wallet)
  • UX complexity for beginners
  • Liquidity problem (not enough participants)
  • Potential DoS / Sybil attacks

References

  • Bitcoin CoinJoin concept (BIP-related docs)
  • Wasabi / Whirlpool design patterns

Nice-to-have (Future)

  • CoinJoin rounds automation
  • Custom anonymity sets
  • Integration with PayJoin (BIP78)
  • Post-mix wallet segregation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions