Samourai Wallet Android Documentation

repository·develop·Indexed 20 days ago

https://github.com/samourai-wallet/samourai-wallet-android

Documentation for Samourai Wallet, an Android-based Bitcoin wallet focused on privacy and advanced transaction techniques. Includes guides on building from source, using OpenDime, and implementing a self-hosted Samourai Dojo backend. Covers supported Bitcoin Improvement Proposals (BIP44, BIP47, BIP49, BIP69, BIP84, BIP125, BIP141, BIP173, BIP174), UTXO management, and detailed privacy metrics including Transaction Entropy, Link Probability (LP), and Link Probability Matrix (LPM).

Tokens
18.9K
Snippets
19
Records
102
Agent score
71%

What's inside Samourai Wallet

  1. What is Samourai Dojo?

    develop

    Samourai Dojo is a backend server/node for the Samourai Wallet. While the wallet connects to Samourai's default servers by default, users can implement their own Dojo to achieve greater privacy and financial self-sovereignty.

    A self-hosted Dojo provides:

    • HD account management
    • Loose address (BIP47) balances
    • Transaction lists and unspent output (UTXO) lists
    • A PushTX endpoint to broadcast transactions via a backing bitcoind node, all routed through Tor.
  2. Security and Privacy Features in Samourai Wallet

    develop

    Samourai Wallet provides several security mechanisms to protect private keys and user privacy:

    • Key Storage: Private keys are stored locally on the device and are never communicated to any server.
    • Access Control: Access is protected by a 5-to-8 digit PIN, which can be entered via a scrambled grid to prevent shoulder surfing.
    • Encryption: Internal metadata is encrypted using AES-256.
    • Backups: Backups are exportable and encrypted using a BIP39 passphrase.
    • Network Privacy:
      • Supports connecting via a preferred VPN.
      • Supports connecting via Tor (using Orbot as a Socks5 proxy).
      • pushTx operations are routed over Tor.
    • Node Configuration: Users can route outgoing transactions via their own trusted node using JSON-RPC, which includes a PoW (proof-of-work) check.
    • Alerts: The wallet provides real-time alerts if the wallet is being targeted by "dusting" attacks.
  3. The Samourai Wallet Toolset overview

    develop

    The Samourai Wallet ecosystem consists of several specialized tools designed to enhance privacy and self-sovereignty:

    ToolPurpose
    DojoAllows you to back up your own wallet.
    RoninDojoSimplifies Dojo setup (e.g., on a Raspberry Pi 4).
    WhirlpoolProvides coin mixing capabilities on mobile.
    PayNymsEnables stealth payments.
    Stonewall / StonewallX2 / StowawayTools designed to chip away at blockchain heuristics.
    RicochetAdds distance to prevent exchanges from monitoring deposit/withdraw patterns.
    SentinelAllows you to deposit to or watch wallets, including cold wallets.
    TxTennaEnables broadcasting transactions via SMS.
  4. Review Samourai Wallet security and transaction features

    develop

    Samourai Wallet provides several advanced privacy and security features for Bitcoin users:

    Security Features

    • Private Key Control: Keys are stored on-device and never communicated to servers.
    • Access Control: 5-to-8 digit PIN protection with an optional scrambled entry grid.
    • Encryption: AES-256 encryption for internal metadata.
    • Network Privacy: Support for connecting via VPN or Tor (Socks5 proxy using Orbot).
    • Alerts: Real-time alerts for "dusting" attacks.

    Transaction & Privacy Features

    • Segwit Support: Full support for P2SH-P2WPKH and spending to Bech32 addresses.
    • BIP69: Deterministic sorting of inputs/outputs to prevent blockchain fingerprinting.
    • RBF (Replace-by-Fee): Detection and opt-in support for RBF.
    • CPFP (Child-Pays-For-Parent): Support for both incoming and outgoing unconfirmed transactions.
    • Obfuscation: Support for Ricochet spends (multiple hops) and BIP126 spending.
    • UTXO Management: Ability to flag UTXOs as "unspendable" and view UTXO lists (including redeem scripts for P2SH-P2WPKH).
  5. What is Dojo and how to use it

    develop

    Samourai Dojo is the backend server/node for the Samourai Wallet. While the wallet connects to Samourai's default Dojo servers, users can implement their own Dojo to achieve financial self-sovereignty and enhanced privacy.

    A self-hosted Dojo provides:

    • HD account management
    • Loose addresses (BIP47) balances
    • Transaction lists
    • Unspent output lists
    • PushTX endpoint (broadcasts transactions via a backing bitcoind node over Tor)

    For a simplified implementation, users can use Ronin.

  6. What is Whirlpool and how does it work?

    develop

    Whirlpool is Samourai Wallet's implementation of CoinJoin designed to break deterministic links between UTXOs. It is non-custodial; your UTXOs never leave your wallet during the mixing process.

    Key Mechanics:

    • Tx0: The initial step that takes your deposit and breaks it into equal-sized UTXOs based on your selected pool (e.g., 0.5, 0.05, or 0.01 BTC). This prevents attackers from distinguishing inputs and outputs based on size.
    • Mixing Fees: You pay a mixing fee during the Tx0 stage. This fee is kept separate from the mix to prevent deterministic links.
    • Remixing: Whirlpool incentivizes users to remix. 'Premixers' pay miner fees to initiate mixes, while others can 'freeride' to provide liquidity and increase the anonymity set (entropy) for all participants.
  7. Wallet Management and UTXO Control

    develop

    The wallet provides granular control over funds and UTXOs:

    • Fund Management: Supports sweeping funds from private keys (including P2SH-P2WPKH and P2WPKH/bech32 formats).
    • UTXO Visibility: Displays the UTXO list, with options to show private keys, P2SH-P2WPKH redeem scripts, or P2WPKH details.
    • UTXO Control:
      • Any UTXO can be flagged as "unspendable".
      • Ability to block UTXOs used in non-broadcast transactions to avoid accidental double-spending.
    • Stealth Mode: A feature to hide the wallet on the device, which may require a separate PIN code for launch.
    • Recovery: Supports remote SMS commands to regain access to funds if the phone is lost, and allows obtaining a new phone number if the SIM card is swapped.
  8. Understand Bitcoin address standards (BIP44, BIP49, BIP84)

    develop

    Samourai Wallet supports three main address derivation standards:

    • BIP44 (Legacy): Non-segwit addresses. These always begin with 1.
    • BIP49 (Segwit Compatibility): Segwit compatibility addresses. These begin with 3.
    • BIP84 (Native Segwit): Native segwit addresses (also called bech32). These begin with bc1. This is the Samourai default.
  9. Understand Samourai privacy features and terminology

    develop

    Samourai Wallet includes several privacy-enhancing features and concepts:

    • Whirlpool: Samourai's implementation of CoinJoin, a transaction type where multiple users contribute inputs and outputs to break chain analysis and increase fungibility.
    • #cahoots: A general term for post-mix methods used after a CoinJoin to avoid merging non-CoinJoined Bitcoins with CoinJoined ones.
    • Post-mix methods:
      • Stonewall: A basic transaction that resembles a mini-CoinJoin on the blockchain.
      • Stonewallx2: A mini-CoinJoin where a friend provides inputs.
      • Stowaway: A special transaction that looks normal but is actually a mini-CoinJoin between you and a friend, obfuscating the real transacted amount.
    • Ricochet: A feature designed to put distance between you and an exchange to prevent exchanges from blacklisting or freezing your Bitcoins due to CoinJoin history. Staggered Ricochet is a slower, more realistic version that leaves a better fingerprint on the blockchain.
    • PayNyms: Payment codes based on BIP47. They allow you to share a code instead of a public address, preventing anyone from looking up the balance of that address on the blockchain.