Back to Blog

Phoenix Wallet Bitcoin Accounting Import Guide | Lightning & On-Chain

Looking to track your Phoenix Wallet transactions with Bitcoin-only accounting software for accurate tax reporting? This guide walks you through converting Phoenix Wallet's CSV export format for import into Clams using the Import (CSV) connection option. Unlike direct wallet connections (like Lightning nodes or xpubs), this method requires a one-time CSV export from Phoenix, enabling you to track both Lightning and on-chain transactions with accurate cost basis calculations.

Why Import Phoenix Wallet Data to Clams?

Phoenix is a popular non-custodial mobile Bitcoin wallet that combines Lightning Network payments with on-chain support. When paired with Clams' Bitcoin-only accounting software, you get:

  • Accurate cost basis - Calculate gains/losses for every transaction
  • Tax-ready reports - Export formatted data for tax filing
  • Lightning precision - Track down to the millisatoshi level
  • Privacy-first - Your data stays on your device

Before You Start

What You'll Need:

  • Your Phoenix CSV export file
  • A spreadsheet application (Excel, Google Sheets, LibreOffice Calc, etc.)
  • Clams installed
  • Optional: mempool.space for looking up on-chain addresses

Time Required: A few minutes with AI conversion or 10-15 minutes with manual conversion depending on transaction volume

Custom Import Overview

As a reminder, here is how the Custom Import tool works in Clams:

Understanding Phoenix's CSV Export

Phoenix Wallet exports transaction data in CSV format, but it requires conversion before importing into Clams. The main differences:

  • Transaction types use Phoenix-specific names (swap_in, lightning_sent, etc.)
  • Amounts are in millisatoshis instead of BTC
  • Lightning payments use payment_hash as the transaction ID
  • On-chain deposit addresses are not included in the export
  • Fees are already included in the amount field

This guide will walk you through transforming Phoenix's format to Clams' standard format.

Important Note About On-Chain Deposit Addresses

Phoenix's CSV export does not include the on-chain addresses where you deposited funds. Without these addresses, Clams will treat all deposits as income.

Why this matters: If you funded your Phoenix wallet from another wallet (like an exchange or hardware wallet), Clams can only recognize it as a transfer if the deposit address is included in the CSV. Otherwise, it appears as income.

Your options:

  1. Look up addresses manually: Use the tx_id from the specific row in the CSV and mempool.space to find your deposit addresses
  2. Reference another wallet: If you deposited from an exchange or other wallet, check that wallet's transaction history using the date/time to identify the destination address
  3. Skip this step: Your balance will still be correct, but transfers will show as income

Recommendation: If accurate income tracking is important for your tax reporting, take the time to look up your on-chain deposit addresses.

Export Your Phoenix CSV

First, export your transaction history from Phoenix Wallet. Follow these steps:

  1. Click full payment history at the bottom of home screen:
Phoenix export screen 1
  1. Click export icon at top right of the next screen:
Phoenix export screen 2
  1. Click export button at bottom of the next screen:
Phoenix export screen 3

Choose Your Conversion Method

You have two options for converting your Phoenix CSV:

  1. AI-Assisted Conversion (Recommended) - Fast and automated using an AI assistant
  2. Manual Conversion - Step-by-step spreadsheet editing (detailed below).

Both methods produce the same result. Choose the one that fits your workflow.

AI Conversion Prompt

If you'd like to automate the conversion process, you can use an AI assistant like Claude or ChatGPT.

Privacy Note: For maximum privacy, you can use a locally running LLM via tools like Ollama to process your CSV without uploading your transaction history to any cloud service.

Upload your CSV and use this prompt:

Process this CSV and make these changes:

1. Rename the "destination" column to "btc_destination"

2. Rename the "description" column to "note"

3. Add a new "amount" column based on transaction type:
   - For lightning_sent: amount = (ABS(amount_msat) - service_fee_msat) / 100,000,000,000
   - For swap_out: amount = (ABS(amount_msat) - (mining_fee_sat × 1,000)) / 100,000,000,000
   - For all other types: amount = ABS(amount_msat) / 100,000,000,000
   Format with 11 decimal places.

4. Add a new "fee" column based on transaction type:
   - For lightning_sent: fee = service_fee_msat / 100,000,000,000
   - For swap_out: fee = mining_fee_sat / 100,000,000
   - For all other types: fee = 0
   Format with 11 decimal places.

5. Change all transaction types using these mappings:
   - swap_in → DEPOSIT
   - swap_out → WITHDRAWAL
   - channel_close → WITHDRAWAL
   - lightning_sent → WITHDRAWAL
   - lightning_received → DEPOSIT

6. Add a new "asset" column with the value "BTC" for all rows.

7. Update the "id" column: if payment_hash exists, use it; otherwise use tx_id.

8. Clean the "btc_destination" column: delete any values that don't start with "1" (P2PKH), "3" (P2SH), "bc1" (Bech32/Bech32m - includes SegWit and Taproot), or "lnbc" (Lightning invoice). Keep only valid Bitcoin addresses and Lightning invoices.

Provide the converted file for download.

After AI conversion: Skip to the Final Checklist to verify your converted file before importing.

Note: The AI method handles the basic conversion but won't add on-chain deposit addresses (Step 2 in the manual process). If you need transfer detection, you'll still need to look up and add those addresses manually.

Manual Step-by-Step CSV Conversion

Prefer to do it yourself? Follow these detailed steps.

Important: This guide involves converting Phoenix's CSV format to match Clams' import format. You'll need basic spreadsheet skills (copy/paste, find-and-replace, simple formulas).

Open your CSV file in your spreadsheet application.

Step 1: Rename Columns

  • destinationbtc_destination (where funds were sent)
  • descriptionnote (transaction descriptions)

Step 2: Add On-Chain Deposit Addresses (Optional)

For swap_in transactions:

  1. Copy the tx_id and look it up on mempool.space
  2. Add your deposit address to btc_destination

Skip if you don't need to track wallet-to-wallet transfers.

Step 3: Add amount Column

Create an amount column. The formula depends on transaction type because fees need to be separated:

  • lightning_sent uses service_fee_msat (millisatoshis)
  • swap_out uses mining_fee_sat (satoshis, multiply by 1,000 to convert to millisatoshis)
  • All other types have no fee to subtract

Use this formula (assuming type is column A, amount_msat is column B, service_fee_msat is column C, mining_fee_sat is column D):

=IF(A2="lightning_sent", (ABS(B2)-C2)/100000000000, IF(A2="swap_out", (ABS(B2)-(D2*1000))/100000000000, ABS(B2)/100000000000))

Format with 11 decimal places (Right-click → Format Cells → Number → 11 decimals).

Step 4: Add fee Column

Create a fee column. The formula depends on transaction type:

  • lightning_sent uses service_fee_msat (millisatoshis → divide by 100,000,000,000 for BTC)
  • swap_out uses mining_fee_sat (satoshis → divide by 100,000,000 for BTC)
  • All other types have fee = 0

Use this formula (assuming type is column A, service_fee_msat is column C, mining_fee_sat is column D):

=IF(A2="lightning_sent", C2/100000000000, IF(A2="swap_out", D2/100000000, 0))

Format with 11 decimal places.

Step 5: Update Transaction Types

Find and replace:

  • swap_inDEPOSIT
  • swap_outWITHDRAWAL
  • channel_closeWITHDRAWAL
  • lightning_sentWITHDRAWAL
  • lightning_receivedDEPOSIT

Step 6: Add asset Column

Create an asset column and fill all rows with BTC.

Step 7: Map Payment Identifiers to id

Create an id column with this formula:

=IF(payment_hash<>"", payment_hash, tx_id)

Step 8: Clean btc_destination

Keep only values starting with: 1, 3, bc1 (Bitcoin addresses), or lnbc (Lightning invoices).

Delete everything else (like node IDs). Sort alphabetically to group and clear invalid values efficiently.

Final Checklist

Before importing to Clams, verify your CSV has:

  • destination column renamed to btc_destination
  • description column renamed to note
  • btc_destination populated for swap_in deposits (optional but recommended)
  • ✅ All transaction types are DEPOSIT or WITHDRAWAL (no Phoenix-specific types)
  • amount column exists with values in BTC (11 decimals, all positive)
  • asset column = BTC for all rows
  • id column contains payment_hash for Lightning or tx_id for on-chain (no UUIDs)
  • btc_destination only contains valid Bitcoin addresses
  • fee column properly extracted: 0 for deposits/channel_close/swap_in, service_fee_msat converted to BTC for lightning_sent, mining_fee_sat converted to BTC for swap_out

Pro tip: Save your converted CSV with a new filename like phoenix-converted.csv so you keep the original export as backup.

Import to Clams

Now you're ready to import your converted CSV:

  1. Open Clams
  2. Navigate to Connections
  3. Click Add and select Import
  4. Give your connection a descriptive name (e.g., "Phoenix Wallet - Mobile")
  5. Click the menu icon (three dots) on your new connection
  6. Select Import
  7. Upload your converted CSV file
  8. Wait for processing to complete

Clams will process each transaction and calculate cost basis using your selected accounting method (FIFO, LIFO, etc.).

Understanding Your Balance

After import, you should see a new balance line in Clams:

Phoenix balance in Clams

Clams Desktop interface

Phoenix tracks balance in millisatoshis internally but only displays whole satoshis. Your Clams balance may be 1 satoshi higher/lower than Phoenix shows.

While Phoenix is a non-custodial wallet (you control your keys), Clams will technically label it as a custodial wallet when you import it. This is intentional and perfectly fine.

Phoenix uses a technique called splicing where:

  • On-chain receives are automatically converted into Lightning channel capacity
  • On-chain sends reduce Lightning channel capacity (via splicing)

This creates a unique accounting challenge. Until we develop better splicing support in Clams, treating Phoenix as a custodial wallet is the most accurate way to handle these transactions.

Pro Tips for Phoenix + Clams

Regular Imports

Phoenix doesn't support continuous syncing like Xpub-based wallets. Plan to:

  • Export and import monthly, quarterly, or before tax season
  • Keep your CSV exports organized by date for easy re-import if needed
  • Document any manual address lookups you did for future reference

Improve Transfer Detection

To maximize transfer detection between Phoenix and other wallets:

  1. Look up on-chain deposit addresses for swap_in transactions
  2. Connect your other wallets to Clams using Xpubs or Descriptors
  3. Clams will automatically detect when Phoenix deposits came from your other wallets

Multiple Phoenix Wallets

If you have multiple Phoenix wallets:

  • Import each wallet's CSV separately
  • Use descriptive names ("Phoenix - Old Phone", "Phoenix - Current")

Next Steps

  1. Review imported transactions for accuracy
  2. Set up additional wallet connections to capture all your Bitcoin activity
  3. Configure your accounting method (FIFO, LIFO) if you haven't already
  4. Generate tax reports when needed using Clams' export features

Need Help?

Having trouble with your Phoenix import? We're here to help:

  • Join our Discord community for quick assistance
  • Email us directly: hello@clams.tech

Common issues:

  • Import fails: Check the Final Checklist section above
  • Wrong balance: Verify fee column is set to zero and amounts are positive
  • Missing transactions: Ensure you exported the complete history from Phoenix
  • Transfer detection: Add on-chain deposit addresses (Step 2)

About Phoenix Wallet: Phoenix is a non-custodial, self-custodial Lightning wallet developed by ACINQ. It provides automated channel management, making Lightning Network payments accessible to mobile users without technical complexity.

About Clams: Clams is purpose-built Bitcoin accounting software that provides accurate cost basis tracking and exports reports like capital gains for individuals, businesses and enterprises.